|
|
Up |
|
|
  |
Author: Krishna MyneniKrishna Myneni Date: Mar 8, 2008 10:04
Anybody know a good reason for the presence of SWAP in the following word, from
fsl-util.xxx?
: } ( addr n -- addr[n]) \ word that fetches 1-D array addresses
OVER CELL- @
* SWAP +
;
Also, do the native code optimizing compilers eliminate the unnecessary SWAP in
the compiled code?
Krishna
|
| |
|
| | 11 Comments |
|
  |
Author: C. G. MontgomeryC. G. Montgomery Date: Mar 8, 2008 14:38
> Anybody know a good reason for the presence of SWAP in the following
> word, from fsl-util.xxx?
>
> : } ( addr n -- addr[n]) \ word that fetches 1-D array addresses
> OVER CELL- @
> * SWAP +
> ;
>
> Also, do the native code optimizing compilers eliminate the unnecessary
> SWAP in the compiled code?
>
> Krishna
Don't know where you found that fsl-util.xxx. I (well, grep) can't
find "swap +" anywhere in the library's files. Thank heavens. ;-)
cheers cgm
|
| |
|
| | no comments |
|
  |
Author: Krishna MyneniKrishna Myneni Date: Mar 8, 2008 17:35
C. G. Montgomery wrote:
>> Anybody know a good reason for the presence of SWAP in the following
>> word, from fsl-util.xxx?
>>
>> : } ( addr n -- addr[n]) \ word that fetches 1-D array addresses
>> OVER CELL- @
>> * SWAP +
>> ;
>>
>> Also, do the native code optimizing compilers eliminate the unnecessary
>> SWAP in the compiled code?
>>
>> Krishna
>
> Don't know where you found that fsl-util.xxx. I (well, grep) can't
> find "swap +" anywhere in the library's files. Thank heavens. ;-)
>
> cheers cgm ...
|
| Show full article (0.73Kb) |
| no comments |
|
  |
Author: Krishna MyneniKrishna Myneni Date: Mar 8, 2008 20:27
Krishna Myneni wrote:
> Anybody know a good reason for the presence of SWAP in the following
> word, from fsl-util.xxx?
>
> : } ( addr n -- addr[n]) \ word that fetches 1-D array addresses
> OVER CELL- @
> * SWAP +
> ;
>
> Also, do the native code optimizing compilers eliminate the unnecessary
> SWAP in the compiled code?
>
> Krishna
Recoding "}" to remove the frivolous SWAP, and manually inlining the word CELL-
gave roughly an 8%% improvement in performance, in kForth, for a curve fitting
routine which uses array indexing heavily. The above definition of "}" is
replaced by
: } OVER [ 1 CELLS ] LITERAL - @ * + ;
|
| Show full article (1.41Kb) |
| no comments |
|
  |
|
|
  |
Author: Anton ErtlAnton Ertl Date: Mar 9, 2008 03:57
Krishna Myneni bellsouth.net> writes:
>OFF THIS TOPIC: it would be nice if Forth 200x would standardize a keyword for
>denoting inline words, e.g.
>
>: CELL- [ 1 CELLS ] LITERAL - ; inline
>
>A Forth implementation could choose to ignore the keyword, or to give the marked
>word appropriate compile time behavior.
If you think it's worth the effort, go ahead and make an RfD. This
one should not be too controversial. I am sure you will find a
committee member willing to help you when you need help.
- anton
|
| |
| no comments |
|
  |
Author: Albert van der HorstAlbert van der Horst Date: Mar 9, 2008 07:56
>Krishna Myneni bellsouth.net> writes:
>>OFF THIS TOPIC: it would be nice if Forth 200x would standardize a keyword for
>>denoting inline words, e.g.
>>
>>: CELL- [ 1 CELLS ] LITERAL - ; inline
>>
>>A Forth implementation could choose to ignore the keyword, or to give the marked
>>word appropriate compile time behavior.
>
>If you think it's worth the effort, go ahead and make an RfD. This
>one should not be too controversial. I am sure you will find a
>committee member willing to help you when you need help.
What would it mean? An optimizing compiler inlines that code
anyway. In my embedded renesas Forth I would just do : INLINE ;
and get over it.
|
| Show full article (1.25Kb) |
| no comments |
|
  |
Author: Krishna MyneniKrishna Myneni Date: Mar 9, 2008 12:09
Albert van der Horst wrote:
>> Krishna Myneni bellsouth.net> writes:
>>> OFF THIS TOPIC: it would be nice if Forth 200x would standardize a keyword for
>>> denoting inline words, e.g.
>>>
>>> : CELL- [ 1 CELLS ] LITERAL - ; inline
>>>
>>> A Forth implementation could choose to ignore the keyword, or to give the marked
>>> word appropriate compile time behavior.
>> If you think it's worth the effort, go ahead and make an RfD. This
>> one should not be too controversial. I am sure you will find a
>> committee member willing to help you when you need help.
>
> What would it mean? An optimizing compiler inlines that code
> anyway. In my embedded renesas Forth I would...
|
| Show full article (1.80Kb) |
| no comments |
|
  |
Author: C. G. MontgomeryC. G. Montgomery Date: Mar 9, 2008 14:24
> Anybody know a good reason for the presence of SWAP in the following
> word, from fsl-util.xxx?
>
> : } ( addr n -- addr[n]) \ word that fetches 1-D array addresses
> OVER CELL- @
> * SWAP +
> ;
The superfluous SWAPs have been removed from the various FSL auxiliary
files.
Also, the gzipped tarball with the complete Library has been updated.
[those auxiliary files will be the death of me yet :( ]
regards to all cgm
|
| |
| no comments |
|
  |
|
|
  |
Author: Andrew HaleyAndrew Haley Date: Mar 10, 2008 14:46
Krishna Myneni bellsouth.net> wrote:
> Albert van der Horst wrote:
>>> Krishna Myneni bellsouth.net> writes:
>>>> OFF THIS TOPIC: it would be nice if Forth 200x would standardize a keyword for
>>>> denoting inline words, e.g.
>>>>
>>>> : CELL- [ 1 CELLS ] LITERAL - ; inline
>>>>
>>>> A Forth implementation could choose to ignore the keyword, or to give the marked
>>>> word appropriate compile time behavior.
>>> If you think it's worth the effort, go ahead and make an RfD. This
>>> one should not be too controversial.
Heh! :-)
>>> I am sure you will find a committee member willing to help you
>>> when you need help.
|
| Show full article (1.39Kb) |
| no comments |
|
RELATED THREADS |
  |
|
|
|
|
|