Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #135462

Re: F>R, FR@ and FR> Float to return stack words

From marcel hendrix <mhx@iae.nl>
Newsgroups comp.lang.forth
Subject Re: F>R, FR@ and FR> Float to return stack words
Date 2026-08-28 19:35 +0200
Organization A noiseless patient Spider
Message-ID <116sgt6$ll12$1@dont-email.me> (permalink)
References <20260828000428.00007e53@tin.it>

Show all headers | View raw


On 8/28/2026 12:04 AM, peter wrote:
> 
> I recently wanted to adapt compelx-kahan.fs, the complex implementation
> by Julian V. Noble and David N. Williams, to the capabilities of
> ntf64/lxf64.
> 
> One thing I wanted to get away from was the Baden-style float locals,
> fa fb .. and to-fa to-fb .. and the use of temporary buffers.
> 
> I replaced them with F>R, FR@ and FR>. Moving floats to the return stack.
> This works well as both stacks are 64 bits. The effect was very good.
>
... > What do you have in your system?
> 
> BR
> Peter

Using the FPU:
FORTH> see z*
Flags: ANSI
$0135F340  : Z*
$0135F34A  fpop,
$0135F354  sub           rsi, #16 b#
$0135F358  fstp          [rsi] tbyte
$0135F35A  fpop,
$0135F364  sub           rsi, #16 b#
$0135F368  fstp          [rsi] tbyte
$0135F36A  fpop,
$0135F374  sub           rsi, #16 b#
$0135F378  fstp          [rsi] tbyte
$0135F37A  fpop,
$0135F384  sub           rsi, #16 b#
$0135F388  fstp          [rsi] tbyte
$0135F38A  fld           [rsi] tbyte
$0135F38C  fld           [rsi #32 +] tbyte
$0135F38F  fmulp         ST(1), ST
$0135F391  fld           [rsi #16 +] tbyte
$0135F394  fld           [rsi #48 +] tbyte
$0135F397  fmulp         ST(1), ST
$0135F399  fsubp         ST(1), ST
$0135F39B  fld           [rsi] tbyte
$0135F39D  fld           [rsi #48 +] tbyte
$0135F3A0  fmulp         ST(1), ST
$0135F3A2  fld           [rsi #16 +] tbyte
$0135F3A5  fld           [rsi #32 +] tbyte
$0135F3A8  fmulp         ST(1), ST
$0135F3AA  faddp         ST(1), ST
$0135F3AC  lea           r13, [r13 #-32 +] qword
$0135F3B0  fxch          ST(2)
$0135F3B2  fstp          [r13 #16 +] tbyte
$0135F3B6  fstp          [r13 0 +] tbyte
$0135F3BA  add           rsi, #64 b#
$0135F3BE  ;
116 bytes.

-marcel

Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

F>R, FR@ and FR> Float to return stack words peter <peter.noreply@tin.it> - 2026-08-28 00:04 +0200
  Re: F>R, FR@ and FR> Float to return stack words dxf <dxforth@gmail.com> - 2026-08-28 14:44 +1000
  Re: F>R, FR@ and FR> Float to return stack words anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-08-28 06:50 +0000
  Re: F>R, FR@ and FR> Float to return stack words marcel hendrix <mhx@iae.nl> - 2026-08-28 19:35 +0200
  Re: F>R, FR@ and FR> Float to return stack words peter <peter.noreply@tin.it> - 2026-08-30 10:06 +0200
    Re: F>R, FR@ and FR> Float to return stack words anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-08-30 13:31 +0000
      Re: F>R, FR@ and FR> Float to return stack words peter <peter.noreply@tin.it> - 2026-08-30 15:58 +0200
        Re: F>R, FR@ and FR> Float to return stack words anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-08-30 15:12 +0000

csiph-web