Sujet : FP stack (was: Parsing timestamps?)
De : anton (at) *nospam* mips.complang.tuwien.ac.at (Anton Ertl)
Groupes : comp.lang.forthDate : 04. Jul 2025, 07:06:20
Autres entêtes
Organisation : Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID : <2025Jul4.080620@mips.complang.tuwien.ac.at>
References : 1 2 3 4 5 6
User-Agent : xrn 10.11
dxf <
dxforth@gmail.com> writes:
He said he uses the hardware fp stack for speed. Is he really only
using 8 levels of stack?
An 8-deep FP stack. Yes, SwiftForth users do:
SwiftForth x64-Linux 4.0.0-RC89 15-Jul-2024
: foo f+ f* ; ok
: bar f@ f@ f@ execute f! ; ok
fvariable a ok
fvariable b
B isn't unique. ok
fvariable c ok
fvariable d ok
2e a f! ok
3e b f! ok
4e c f! ok
d ' foo c b a bar ok
d f@ f. 14.00000000 ok
see foo
4519B7 ST(0) ST(1) FADDP DEC1
4519B9 ST(0) ST(1) FMULP DEC9
4519BB RET C3 ok
see bar
4519D3 0 [RBX] TBYTE FLD DB2B
4519D5 0 [RBP] RBX MOV 488B5D00
4519D9 8 [RBP] RBP LEA 488D6D08
4519DD 0 [RBX] TBYTE FLD DB2B
4519DF 0 [RBP] RBX MOV 488B5D00
4519E3 8 [RBP] RBP LEA 488D6D08
4519E7 0 [RBX] TBYTE FLD DB2B
4519E9 0 [RBP] RBX MOV 488B5D00
4519ED 8 [RBP] RBP LEA 488D6D08
4519F1 4028CB ( EXECUTE ) CALL E8D50EFBFF
4519F6 0 [RBX] TBYTE FSTP DB3B
4519F8 0 [RBP] RBX MOV 488B5D00
4519FC 8 [RBP] RBP LEA 488D6D08
451A00 RET C3 ok
No saving of FP values elsewhere around the EXECUTE in BAR, and no
loading of FP values from elsewhere in FOO. So yes, on SwiftForth, if
you push more than 8 FP stack values at the same time, you are in
trouble.
On VFX with the default FP package, it's the same, but VFX has
alternative FP packages for those who cannot live with this
limitation.
As long as you use the FP stack just withing a colon definition and
for parameter passing, i.e., not as temporary storage while calling
another word, that limitation should not be particularly onerous.
Moore uses 6 data stack items on his hardware since the uP20, and
that's not just the FP stack.
- anton
-- M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.htmlcomp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html New standard: https://forth-standard.org/EuroForth 2023 proceedings: http://www.euroforth.org/ef23/papers/EuroForth 2024 proceedings:
http://www.euroforth.org/ef24/papers/