I'm trying to understand (/NDP) and MAKE-ROUND . FLDCW must an 80X86 NPC
register. I would like to see the definition. FpMath.f says /NDP sets the
Control Register to the value saved in the floating point options registry
settings only SwiftX doesn't have an interface to the registry!
________________________________________
Tools | Words | ...double-click:
***** ASSEMBLER *****
FLDCW
***** ASM-WORDLIST *****
FLDCW
LOCATE FLDCW FLDCW Can't be located
________________________________________
FpMath.f:
CODE (/NDP)
FINIT 'FPOPT 2+ EDX ADDR 0 [EDX] FLDCW
' /FSTACK >CODE JMP
END-CODE
' (/NDP) IS /NDP /NDP
CODE MAKE-ROUND
FP-ROUND EAX ADDR
0 [EAX] FLDCW
FNEXT
________________________________________
PS. Setting FP-ROUND FP_ROUND_TRUNC + alone doesn't provide consistent
results without:
0 CONSTANT FPOPT_STACK
1 CONSTANT FPOPT_WAIT
2 CONSTANT FPOPT_FPUCW
4 CONSTANT FPOPT_PRECISION
5 CONSTANT FPOPT_FORMAT
... 'FPOPT FPOPT_FPUCW + H!
-----Original Message-----
From: Bulgrien, Dennis
Sent: Wednesday, February 27, 2002 13:35
To: swiftx_at_forth.com
Subject: [swiftx] Re: MAKE-ROUND Use
...or prefereably:
0 CONSTANT FP_ROUND_ROUND
2 CONSTANT FP_ROUND_DOWN
4 CONSTANT FP_ROUND_UP
6 CONSTANT FP_ROUND_TRUNC
FP-ROUND FP_ROUND_ROUND + H@
FP-ROUND FP_ROUND_TRUNC + H!
-----Original Message-----
From: Bulgrien, Dennis
Sent: Wednesday, February 27, 2002 13:33
To: swiftx_at_forth.com
Subject: [swiftx] Re: MAKE-ROUND Use
The following code makes it happen but it is such a horrible solution. What
is says in English is "Whenever the floating point chip is set up for
truncation really set it to round to the nearest value instead." Its like
putting RAID in a Windex bottle to keep the flies off the window. Something
more intentional desired...
FP-ROUND 0 + H@
FP-ROUND 6 + H!
-----Original Message-----
From: Bulgrien, Dennis
Sent: Wednesday, February 27, 2002 13:16
To: swiftx_at_forth.com
Subject: [swiftx] MAKE-ROUND Use
SwiftX HOST is apparently set for ANS use of floating point truncation by
default. I need floating point operations on the host to be rounded to
match the higher precision target floating point calculations. Words such
as ROUND and MAKE-ROUND are intended to allow this to be changed prior to
calculations but I have not gotten them to work. Even changing the FPU
control word with $322 'FPOPT 2 + H! doesn't ($322 is 64-bit round nearest;
LOCATE FP-ROUND ). Any ideas?
----------------------------------------------------------------------
swiftx_at_forth.com The SwiftX programming discussion email list
To unsubscribe, send subject "unsubscribe swiftx" to listar_at_forth.com
For help with listar commands, send subject "help" to listar_at_forth.com
Archives are located at http://www.forth.com/swiftx -- check them out!
----------------------------------------------------------------------
THIS LIST IS NOT FOR BUG REPORTS! Send bug reports to support_at_forth.com.
Received on Thu Feb 28 2002 - 12:37:01 PST
Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!
This archive was generated 08-Feb-2012. Archive updated nightly.