diff options
author | Peter Trommler <ptrommler@acm.org> | 2017-05-01 11:17:25 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-05-01 11:17:40 -0400 |
commit | 068af0162a47b1fd7809d056ccc2d80e480d53f5 (patch) | |
tree | 1ad7499a37c7a1997a628af32b38a848483ab6f7 /compiler/codeGen/StgCmmPrim.hs | |
parent | 667abf17dced8b4a4cd2dc6a291a6f244ffa031f (diff) | |
download | haskell-068af0162a47b1fd7809d056ccc2d80e480d53f5.tar.gz |
PPC NCG: Lower MO_*_Fabs as PowerPC fabs instruction
In Phab:D3265 we introduced MO_F32_Fabs and MO_F64_Fabs.
This patch improves code generation by generating PowerPC fabs
instructions.
Test Plan: run numeric/should_run/numrun015 or validate
Reviewers: austin, bgamari, hvr, simonmar, erikd
Reviewed By: erikd
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3512
Diffstat (limited to 'compiler/codeGen/StgCmmPrim.hs')
-rw-r--r-- | compiler/codeGen/StgCmmPrim.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/codeGen/StgCmmPrim.hs b/compiler/codeGen/StgCmmPrim.hs index 235109ffe9..e0a68f68d8 100644 --- a/compiler/codeGen/StgCmmPrim.hs +++ b/compiler/codeGen/StgCmmPrim.hs @@ -852,10 +852,12 @@ callishPrimOpSupported dflags op || ppc) || llvm -> Left (MO_U_Mul2 (wordWidth dflags)) | otherwise -> Right genericWordMul2Op - FloatFabsOp | (ncg && x86ish) + FloatFabsOp | (ncg && x86ish + || ppc) || llvm -> Left MO_F32_Fabs | otherwise -> Right $ genericFabsOp W32 - DoubleFabsOp | (ncg && x86ish) + DoubleFabsOp | (ncg && x86ish + || ppc) || llvm -> Left MO_F64_Fabs | otherwise -> Right $ genericFabsOp W64 |