summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2018-05-22 20:13:34 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2018-05-22 20:13:34 +0000
commit606bc315d66e9aa077d04b1076227263b9c971e6 (patch)
treecc9dbfd6d443e465d2bdf6bcc1d5ae423484c055 /llvm/lib/Target/AMDGPU
parent785acce51dc3f1d3398222d5bfa0ab2f2dfa8442 (diff)
downloadbcm5719-llvm-606bc315d66e9aa077d04b1076227263b9c971e6.tar.gz
bcm5719-llvm-606bc315d66e9aa077d04b1076227263b9c971e6.zip
AMDGPU: Fix v2f16 fneg/fabs pattern
The integer operation convertion for some reason only happens if the source is a bitcast from an integer, which happens to always be the situation when the result is loaded. Add an additional pattern for when the source operation is really an FP operation. llvm-svn: 333019
Diffstat (limited to 'llvm/lib/Target/AMDGPU')
-rw-r--r--llvm/lib/Target/AMDGPU/SIInstructions.td5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIInstructions.td b/llvm/lib/Target/AMDGPU/SIInstructions.td
index 363b0e71223..27efb8e7dea 100644
--- a/llvm/lib/Target/AMDGPU/SIInstructions.td
+++ b/llvm/lib/Target/AMDGPU/SIInstructions.td
@@ -996,6 +996,11 @@ def : GCNPat <
(S_OR_B32 (S_MOV_B32 (i32 0x80008000)), $src) // Set sign bit
>;
+def : GCNPat <
+ (fneg (v2f16 (fabs v2f16:$src))),
+ (S_OR_B32 (S_MOV_B32 (i32 0x80008000)), $src) // Set sign bit
+>;
+
/********** ================== **********/
/********** Immediate Patterns **********/
/********** ================== **********/
OpenPOWER on IntegriCloud