Skip to content
Snippets Groups Projects
Commit 1f1e6297 authored by Julian Seward's avatar Julian Seward
Browse files

[project @ 2000-02-04 17:26:58 by sewardj]

GSQRT, GSIN, GCOS, GTAN: if result size is float (as opposed to double),
truncate the result to that length by writing it into memory and
getting it back again (duh!), since that's what gcc does.
parent e02a4c6f
No related merge requests found
......@@ -28,7 +28,9 @@ All these bugs are for x86; I don't know about sparc/alpha.
Currently, implementation of GITOF et al use the stack, so are
incompatible with current ccall implementation. When the latter
is fixed, GITOF et al should present no problem.
is fixed, GITOF et al should present no problem. Same issue
applies to GCOS, GSIN, GTAN, GSQRT if they have to truncate their
result to 32-bit float.
-- nofib/real/hidden gets slightly different FP answers from the
via-C route; possibly due to exp/log not being done in-line.
......
......@@ -1019,17 +1019,21 @@ pprInstr g@(GABS sz src dst)
= pprG g (hcat [gtab, gpush src 0, text " ; fabs ; ", gpop dst 1])
pprInstr g@(GNEG sz src dst)
= pprG g (hcat [gtab, gpush src 0, text " ; fchs ; ", gpop dst 1])
pprInstr g@(GSQRT sz src dst)
= pprG g (hcat [gtab, gpush src 0, text " ; fsqrt ; ", gpop dst 1])
= pprG g (hcat [gtab, gpush src 0, text " ; fsqrt"] $$
hcat [gtab, gcoerceto sz, gpop dst 1])
pprInstr g@(GSIN sz src dst)
= pprG g (hcat [gtab, gpush src 0, text " ; fsin ; ", gpop dst 1])
= pprG g (hcat [gtab, gpush src 0, text " ; fsin"] $$
hcat [gtab, gcoerceto sz, gpop dst 1])
pprInstr g@(GCOS sz src dst)
= pprG g (hcat [gtab, gpush src 0, text " ; fcos ; ", gpop dst 1])
= pprG g (hcat [gtab, gpush src 0, text " ; fcos"] $$
hcat [gtab, gcoerceto sz, gpop dst 1])
pprInstr g@(GTAN sz src dst)
= pprG g (hcat [gtab, text "ffree %st(6) ; ",
gpush src 0, text " ; fptan ; ",
text " fstp %st(0) ; ", gpop dst 1])
text " fstp %st(0)"] $$
hcat [gtab, gcoerceto sz, gpop dst 1])
pprInstr g@(GADD sz src1 src2 dst)
= pprG g (hcat [gtab, gpush src1 0,
......@@ -1054,6 +1058,11 @@ pprInstr GFREE
]
--------------------------
-- coerce %st(0) to the specified size
gcoerceto DF = empty
gcoerceto F = text "subl $4,%esp ; fstps (%esp) ; flds (%esp) ; addl $4,%esp ; "
gpush reg offset
= hcat [text "ffree %st(7) ; fld ", greg reg offset]
gpop reg offset
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment