diff options
author | Andreas Klebinger <klebinger.andreas@gmx.at> | 2020-10-27 15:45:10 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-11-04 16:47:24 -0500 |
commit | bb100805337adc666867da300ee5b0b11c18fe00 (patch) | |
tree | 232a048a5e5550f53d844fa01dd0e408e92f9b64 /compiler/GHC/CmmToAsm/X86/Cond.hs | |
parent | bff74de713dac3e62c3bb6f1946e0649549f2215 (diff) | |
download | haskell-bb100805337adc666867da300ee5b0b11c18fe00.tar.gz |
NCG: Fix 64bit int comparisons on 32bit x86
We no compare these by doing 64bit subtraction and
checking the resulting flags.
We used to do this differently but the old approach was
broken when the high bits compared equal and the comparison
was one of >= or <=.
The new approach should be both correct and faster.
Diffstat (limited to 'compiler/GHC/CmmToAsm/X86/Cond.hs')
-rw-r--r-- | compiler/GHC/CmmToAsm/X86/Cond.hs | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/compiler/GHC/CmmToAsm/X86/Cond.hs b/compiler/GHC/CmmToAsm/X86/Cond.hs index c91281e6a8..728a281bce 100644 --- a/compiler/GHC/CmmToAsm/X86/Cond.hs +++ b/compiler/GHC/CmmToAsm/X86/Cond.hs @@ -11,22 +11,22 @@ import GHC.Prelude data Cond = ALWAYS -- What's really used? ToDo - | EQQ - | GE - | GEU - | GTT - | GU - | LE - | LEU - | LTT - | LU - | NE - | NEG - | POS - | CARRY - | OFLO - | PARITY - | NOTPARITY + | EQQ -- je/jz -> zf = 1 + | GE -- jge + | GEU -- ae + | GTT -- jg + | GU -- ja + | LE -- jle + | LEU -- jbe + | LTT -- jl + | LU -- jb + | NE -- jne + | NEG -- js + | POS -- jns + | CARRY -- jc + | OFLO -- jo + | PARITY -- jp + | NOTPARITY -- jnp deriving Eq condToUnsigned :: Cond -> Cond |