diff options
-rw-r--r-- | llvm/lib/Target/X86/X86InstrVecCompiler.td | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86InstrVecCompiler.td b/llvm/lib/Target/X86/X86InstrVecCompiler.td index e6e9a92af32..e98843bd3ae 100644 --- a/llvm/lib/Target/X86/X86InstrVecCompiler.td +++ b/llvm/lib/Target/X86/X86InstrVecCompiler.td @@ -416,7 +416,7 @@ def : Pat<(f128 (X86fxor VR128:$src1, VR128:$src2)), (XORPSrr VR128:$src1, VR128:$src2)>; } -let Predicates = [HasAVX] in { +let Predicates = [HasAVX, NoVLX] in { // andps is shorter than andpd or pand. andps is SSE and andpd/pand are in SSE2 def : Pat<(f128 (X86fand VR128:$src1, (loadf128 addr:$src2))), (VANDPSrm VR128:$src1, f128mem:$src2)>; @@ -436,3 +436,24 @@ def : Pat<(f128 (X86fxor VR128:$src1, (loadf128 addr:$src2))), def : Pat<(f128 (X86fxor VR128:$src1, VR128:$src2)), (VXORPSrr VR128:$src1, VR128:$src2)>; } + +let Predicates = [HasVLX] in { +// andps is shorter than andpd or pand. andps is SSE and andpd/pand are in SSE2 +def : Pat<(f128 (X86fand VR128X:$src1, (loadf128 addr:$src2))), + (VANDPSZ128rm VR128X:$src1, f128mem:$src2)>; + +def : Pat<(f128 (X86fand VR128X:$src1, VR128X:$src2)), + (VANDPSZ128rr VR128X:$src1, VR128X:$src2)>; + +def : Pat<(f128 (X86for VR128X:$src1, (loadf128 addr:$src2))), + (VORPSZ128rm VR128X:$src1, f128mem:$src2)>; + +def : Pat<(f128 (X86for VR128X:$src1, VR128X:$src2)), + (VORPSZ128rr VR128X:$src1, VR128X:$src2)>; + +def : Pat<(f128 (X86fxor VR128X:$src1, (loadf128 addr:$src2))), + (VXORPSZ128rm VR128X:$src1, f128mem:$src2)>; + +def : Pat<(f128 (X86fxor VR128X:$src1, VR128X:$src2)), + (VXORPSZ128rr VR128X:$src1, VR128X:$src2)>; +} |