summaryrefslogtreecommitdiff
path: root/ghc/compiler/nativeGen/MachMisc.lhs
diff options
context:
space:
mode:
authorsewardj <unknown>2001-12-20 15:20:38 +0000
committersewardj <unknown>2001-12-20 15:20:38 +0000
commit0cc54eac4ab05b44ddab78d1531ccb9edc5d7e6c (patch)
tree978e2f2794544ade93c021607524c8eb3d1d0395 /ghc/compiler/nativeGen/MachMisc.lhs
parent5aaf7975d944b50433a15c08e5b9626a78a95227 (diff)
downloadhaskell-0cc54eac4ab05b44ddab78d1531ccb9edc5d7e6c.tar.gz
[project @ 2001-12-20 15:20:37 by sewardj]
Generate floating-point comparisons on x86 which deal with NaNs in what I assume is an IEEE854 compliant fashion. For == >= > <= < if either arg is a NaN, produce False, and for /= if either arg is a NaN, produce True. This is the behaviour that gcc has, by default. Requires some ultramagical x86 code frags to be emitted. A big comment in PprMach explains how it works.
Diffstat (limited to 'ghc/compiler/nativeGen/MachMisc.lhs')
-rw-r--r--ghc/compiler/nativeGen/MachMisc.lhs6
1 files changed, 5 insertions, 1 deletions
diff --git a/ghc/compiler/nativeGen/MachMisc.lhs b/ghc/compiler/nativeGen/MachMisc.lhs
index ed5737f524..ee9d934ad2 100644
--- a/ghc/compiler/nativeGen/MachMisc.lhs
+++ b/ghc/compiler/nativeGen/MachMisc.lhs
@@ -544,7 +544,11 @@ but we don't care, since it doesn't get used much. We hope.
| GSUB Size Reg Reg Reg -- src1, src2, dst
| GMUL Size Reg Reg Reg -- src1, src2, dst
- | GCMP Size Reg Reg -- src1, src2
+ -- FP compare. Cond must be `elem` [EQQ, NE, LE, LTT, GE, GTT]
+ -- Compare src1 with src2; set the Zero flag iff the numbers are
+ -- comparable and the comparison is True. Subsequent code must
+ -- test the %eflags zero flag regardless of the supplied Cond.
+ | GCMP Cond Reg Reg -- src1, src2
| GABS Size Reg Reg -- src, dst
| GNEG Size Reg Reg -- src, dst