Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #41391
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail |
|---|---|
| From | "Rod Pemberton" <boo@fasdfrewar.cdm> |
| Newsgroups | comp.lang.forth |
| Subject | Re: CMOVE/CMOVE> |
| Date | Wed, 19 Aug 2015 02:48:32 -0400 |
| Organization | Aioe.org NNTP Server |
| Lines | 59 |
| Message-ID | <op.x3lru60wyfako5@localhost> (permalink) |
| References | <62627f57-1e63-4156-844a-db5708923aaf@googlegroups.com> <2015Aug18.180551@mips.complang.tuwien.ac.at> <c3289222-a562-44db-a30a-1f8d58d0fc6b@googlegroups.com> |
| NNTP-Posting-Host | n4wpt9zq8xR26Ttf9mo2BA.user.speranza.aioe.org |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=iso-8859-1; format=flowed; delsp=yes |
| Content-Transfer-Encoding | 7bit |
| X-Complaints-To | abuse@aioe.org |
| User-Agent | Opera Mail/12.16 (Linux) |
| X-Notice | Filtered by postfilter v. 0.8.2 |
| Xref | csiph.com comp.lang.forth:41391 |
Show key headers only | View raw
On Tue, 18 Aug 2015 12:59:01 -0400, Mark Wills <markwills1970@gmail.com> wrote: > On Tuesday, 18 August 2015 17:16:28 UTC+1, Anton Ertl wrote: >> Mark Wills <markwills1970@gmail.com> writes: >> >I'm aware of the word MOVE which will choose to perform either a CMOVE >> >or CMOVE> depending on overlap and direction. My system doesn't have >> >MOVE though I'd like to implement it. >> > >> >Does anyone have any nice concise logic for checking the parameters and >> >calling either CMOVE or CMOVE> accordingly? >> >> : move ( from to count -- ) >> >r 2dup u< if >> r> cmove> >> else >> r> cmove >> then ; >> >> Better branch prediction accuracy: >> >> [...] > > That's nice code, thank you. Mine also included WITHIN but your first > example is neater IMO. I just tested it quickly and it seems to work fine. There is lots of useful information to be found in Google Groups archive of comp.lang.forth. BruceMcF Dec 2010 https://groups.google.com/d/msg/comp.lang.forth/zFEW7-NWJXM/rI8nbNsw9z0J His '>' should probably be 'U>'. His IF sections are reversed too. Michael L Gassanenko's CMOVE CMOVE> MOVE Mar 2002 https://groups.google.com/d/msg/comp.lang.forth/hYokH0zY9RY/xSFFFb2CSJ0J He has a slight variation for MOVE. He moves the duplicate R> outside the conditional. I have the same as Anton's, except the IF sections are reversed from Anton's, like BruceMcF did too, i.e., U> instead of U< . Both CMOVE and CMOVE> should perform the copy of the region if 'from' = 'to'. So, this shouldn't matter, unless there is an implementation issue with CMOVE or CMOVE> . I.e., it's possibly worth checking to make sure it actually works when 'from' = 'to'. If 'from' and 'to' are actually equal - unlikely, but possible - you might want to kick out of the definition, i.e., to not waste time doing a useless copy. Rod Pemberton -- Scientists now say we'll experience a mini-ice in 2030. So, I guess we need more global warming today ...
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
CMOVE/CMOVE> Mark Wills <markwills1970@gmail.com> - 2015-08-18 08:44 -0700
Re: CMOVE/CMOVE> anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-08-18 16:05 +0000
Re: CMOVE/CMOVE> november.nihal@gmail.com - 2015-08-18 09:34 -0700
Re: CMOVE/CMOVE> anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-08-18 16:41 +0000
Re: CMOVE/CMOVE> Mark Wills <markwills1970@gmail.com> - 2015-08-18 09:59 -0700
Re: CMOVE/CMOVE> Michael Barry <barrym95838@yahoo.com> - 2015-08-18 10:10 -0700
Re: CMOVE/CMOVE> hughaguilar96@gmail.com - 2015-08-18 10:41 -0700
Re: CMOVE/CMOVE> "Alex McDonald" <blog@rivadpm.com> - 2015-08-18 23:55 +0100
Re: CMOVE/CMOVE> anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-08-19 08:40 +0000
Re: CMOVE/CMOVE> "Alex McDonald" <blog@rivadpm.com> - 2015-08-19 12:15 +0100
Re: CMOVE/CMOVE> Mark Wills <markwills1970@gmail.com> - 2015-08-18 11:35 -0700
Re: CMOVE/CMOVE> Mark Wills <markwills1970@gmail.com> - 2015-08-18 11:36 -0700
Re: CMOVE/CMOVE> "HAA" <someone@microsoft.com> - 2015-08-20 04:39 +1000
Re: CMOVE/CMOVE> "Elizabeth D. Rather" <erather@forth.com> - 2015-08-19 09:15 -1000
Re: CMOVE/CMOVE> "HAA" <someone@microsoft.com> - 2015-08-28 22:39 +1000
Re: CMOVE/CMOVE> Coos Haak <chforth@hccnet.nl> - 2015-08-28 15:06 +0200
Re: CMOVE/CMOVE> "HAA" <someone@microsoft.com> - 2015-08-29 17:15 +1000
Re: CMOVE/CMOVE> Coos Haak <chforth@hccnet.nl> - 2015-08-29 13:24 +0200
Re: CMOVE/CMOVE> "HAA" <someone@microsoft.com> - 2015-08-31 11:38 +1000
Re: CMOVE/CMOVE> "Elizabeth D. Rather" <erather@forth.com> - 2015-08-29 07:59 -1000
Re: CMOVE/CMOVE> "HAA" <someone@microsoft.com> - 2015-08-30 13:00 +1000
Re: CMOVE/CMOVE> Mark Wills <markwills1970@gmail.com> - 2015-08-28 07:33 -0700
Re: CMOVE/CMOVE> Mark Wills <markwills1970@gmail.com> - 2015-08-28 07:36 -0700
Re: CMOVE/CMOVE> "HAA" <someone@microsoft.com> - 2015-08-29 02:23 +1000
Re: CMOVE/CMOVE> mhx@iae.nl - 2015-08-28 11:41 -0700
Re: CMOVE/CMOVE> "HAA" <someone@microsoft.com> - 2015-08-29 17:30 +1000
Re: CMOVE/CMOVE> anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-08-19 08:04 +0000
Re: CMOVE/CMOVE> "Rod Pemberton" <boo@fasdfrewar.cdm> - 2015-08-19 02:48 -0400
Re: CMOVE/CMOVE> Mark Wills <markwills1970@gmail.com> - 2015-08-19 00:49 -0700
Re: CMOVE/CMOVE> Bernd Paysan <bernd.paysan@gmx.de> - 2015-08-19 02:58 +0200
csiph-web