diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2016-03-21 11:30:03 +0100 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2016-03-21 22:40:51 +0100 |
commit | 6f0e41da96b79cde49ad8761738c281cd190ac65 (patch) | |
tree | 81cf85745ef423c9fefe45508292b40e0da3750f /compiler | |
parent | 2d6d907d8dcc051a7656dafcc0bc827cc651c6c0 (diff) | |
download | haskell-6f0e41da96b79cde49ad8761738c281cd190ac65.tar.gz |
PPC NCG: Emit more portable `fcmpu 0, ...` instead of `fcmpu cr0, ...`
Use `fcmpu 0, ...` rather than `fcmpu cr0, ...` for better
portability since some non-GNU assembler (such as IBM's `as`) tend to not
support the symbolic register name `cr0`. This matches the syntax that
GCC emits for PPC targets.
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/nativeGen/PPC/Ppr.hs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/nativeGen/PPC/Ppr.hs b/compiler/nativeGen/PPC/Ppr.hs index 08c02f01c6..9326813a78 100644 --- a/compiler/nativeGen/PPC/Ppr.hs +++ b/compiler/nativeGen/PPC/Ppr.hs @@ -764,10 +764,14 @@ pprInstr (FNEG reg1 reg2) = pprUnary (sLit "fneg") reg1 reg2 pprInstr (FCMP reg1 reg2) = hcat [ char '\t', - text "fcmpu\tcr0, ", + text "fcmpu\t0, ", -- Note: we're using fcmpu, not fcmpo -- The difference is with fcmpo, compare with NaN is an invalid operation. - -- We don't handle invalid fp ops, so we don't care + -- We don't handle invalid fp ops, so we don't care. + -- Morever, we use `fcmpu 0, ...` rather than `fcmpu cr0, ...` for + -- better portability since some non-GNU assembler (such as + -- IBM's `as`) tend not to support the symbolic register name cr0. + -- This matches the syntax that GCC seems to emit for PPC targets. pprReg reg1, text ", ", pprReg reg2 |