diff options
| author | Craig Topper <craig.topper@gmail.com> | 2016-12-17 19:26:00 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@gmail.com> | 2016-12-17 19:26:00 +0000 |
| commit | d3295c6a3a8f108c3e2c84dff502747482c39098 (patch) | |
| tree | f60051cc4cc87e23fec342f6a9e3cc7a16919efb | |
| parent | 81b021e7c0ea5693579d6190bd568bdb2798e9e0 (diff) | |
| download | bcm5719-llvm-d3295c6a3a8f108c3e2c84dff502747482c39098.tar.gz bcm5719-llvm-d3295c6a3a8f108c3e2c84dff502747482c39098.zip | |
[AVX-512] Use EVEX encoded logic operations for scalar types when they are available. This gives the register allocator more registers to work with.
llvm-svn: 290049
| -rw-r--r-- | llvm/lib/Target/X86/X86InstrAVX512.td | 37 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86InstrSSE.td | 2 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/fp-logic-replace.ll | 8 |
3 files changed, 42 insertions, 5 deletions
diff --git a/llvm/lib/Target/X86/X86InstrAVX512.td b/llvm/lib/Target/X86/X86InstrAVX512.td index bdf21c799da..ac226e6c6ff 100644 --- a/llvm/lib/Target/X86/X86InstrAVX512.td +++ b/llvm/lib/Target/X86/X86InstrAVX512.td @@ -4559,6 +4559,43 @@ defm : avx512_fp_logical_lowering_sizes<"VPOR", or>; defm : avx512_fp_logical_lowering_sizes<"VPXOR", xor>; defm : avx512_fp_logical_lowering_sizes<"VPANDN", X86andnp>; +let Predicates = [HasDQI] in { + // Use packed logical operations for scalar ops. + def : Pat<(f64 (X86fand FR64X:$src1, FR64X:$src2)), + (COPY_TO_REGCLASS (VANDPDZ128rr + (COPY_TO_REGCLASS FR64X:$src1, VR128X), + (COPY_TO_REGCLASS FR64X:$src2, VR128X)), FR64X)>; + def : Pat<(f64 (X86for FR64X:$src1, FR64X:$src2)), + (COPY_TO_REGCLASS (VORPDZ128rr + (COPY_TO_REGCLASS FR64X:$src1, VR128X), + (COPY_TO_REGCLASS FR64X:$src2, VR128X)), FR64X)>; + def : Pat<(f64 (X86fxor FR64X:$src1, FR64X:$src2)), + (COPY_TO_REGCLASS (VXORPDZ128rr + (COPY_TO_REGCLASS FR64X:$src1, VR128X), + (COPY_TO_REGCLASS FR64X:$src2, VR128X)), FR64X)>; + def : Pat<(f64 (X86fandn FR64X:$src1, FR64X:$src2)), + (COPY_TO_REGCLASS (VANDNPDZ128rr + (COPY_TO_REGCLASS FR64X:$src1, VR128X), + (COPY_TO_REGCLASS FR64X:$src2, VR128X)), FR64X)>; + + def : Pat<(f32 (X86fand FR32X:$src1, FR32X:$src2)), + (COPY_TO_REGCLASS (VANDPSZ128rr + (COPY_TO_REGCLASS FR32X:$src1, VR128X), + (COPY_TO_REGCLASS FR32X:$src2, VR128X)), FR32X)>; + def : Pat<(f32 (X86for FR32X:$src1, FR32X:$src2)), + (COPY_TO_REGCLASS (VORPSZ128rr + (COPY_TO_REGCLASS FR32X:$src1, VR128X), + (COPY_TO_REGCLASS FR32X:$src2, VR128X)), FR32X)>; + def : Pat<(f32 (X86fxor FR32X:$src1, FR32X:$src2)), + (COPY_TO_REGCLASS (VXORPSZ128rr + (COPY_TO_REGCLASS FR32X:$src1, VR128X), + (COPY_TO_REGCLASS FR32X:$src2, VR128X)), FR32X)>; + def : Pat<(f32 (X86fandn FR32X:$src1, FR32X:$src2)), + (COPY_TO_REGCLASS (VANDNPSZ128rr + (COPY_TO_REGCLASS FR32X:$src1, VR128X), + (COPY_TO_REGCLASS FR32X:$src2, VR128X)), FR32X)>; +} + multiclass avx512_fp_scalef_p<bits<8> opc, string OpcodeStr, SDNode OpNode, X86VectorVTInfo _> { defm rr: AVX512_maskable<opc, MRMSrcReg, _, (outs _.RC:$dst), diff --git a/llvm/lib/Target/X86/X86InstrSSE.td b/llvm/lib/Target/X86/X86InstrSSE.td index 9a54e98f771..6f344fcd7d6 100644 --- a/llvm/lib/Target/X86/X86InstrSSE.td +++ b/llvm/lib/Target/X86/X86InstrSSE.td @@ -2932,7 +2932,7 @@ let Predicates = [HasAVX, NoVLX_Or_NoDQI] in { (VANDNPDYrm VR256:$src1, addr:$src2)>; } -let Predicates = [HasAVX] in { +let Predicates = [HasAVX, NoDQI] in { // Use packed logical operations for scalar ops. def : Pat<(f64 (X86fand FR64:$src1, FR64:$src2)), (COPY_TO_REGCLASS (VANDPDrr diff --git a/llvm/test/CodeGen/X86/fp-logic-replace.ll b/llvm/test/CodeGen/X86/fp-logic-replace.ll index 1afbcbf6009..628e99f8859 100644 --- a/llvm/test/CodeGen/X86/fp-logic-replace.ll +++ b/llvm/test/CodeGen/X86/fp-logic-replace.ll @@ -22,7 +22,7 @@ define double @FsANDPSrr(double %x, double %y) { ; ; AVX512DQ-LABEL: FsANDPSrr: ; AVX512DQ: # BB#0: -; AVX512DQ-NEXT: vandps %xmm1, %xmm0, %xmm0 # encoding: [0xc5,0xf8,0x54,0xc1] +; AVX512DQ-NEXT: vandps %xmm1, %xmm0, %xmm0 # encoding: [0x62,0xf1,0x7c,0x08,0x54,0xc1] ; AVX512DQ-NEXT: retq # encoding: [0xc3] ; %bc1 = bitcast double %x to i64 @@ -46,7 +46,7 @@ define double @FsANDNPSrr(double %x, double %y) { ; ; AVX512DQ-LABEL: FsANDNPSrr: ; AVX512DQ: # BB#0: -; AVX512DQ-NEXT: vandnps %xmm0, %xmm1, %xmm0 # encoding: [0xc5,0xf0,0x55,0xc0] +; AVX512DQ-NEXT: vandnps %xmm0, %xmm1, %xmm0 # encoding: [0x62,0xf1,0x74,0x08,0x55,0xc0] ; AVX512DQ-NEXT: retq # encoding: [0xc3] ; %bc1 = bitcast double %x to i64 @@ -70,7 +70,7 @@ define double @FsORPSrr(double %x, double %y) { ; ; AVX512DQ-LABEL: FsORPSrr: ; AVX512DQ: # BB#0: -; AVX512DQ-NEXT: vorps %xmm1, %xmm0, %xmm0 # encoding: [0xc5,0xf8,0x56,0xc1] +; AVX512DQ-NEXT: vorps %xmm1, %xmm0, %xmm0 # encoding: [0x62,0xf1,0x7c,0x08,0x56,0xc1] ; AVX512DQ-NEXT: retq # encoding: [0xc3] ; %bc1 = bitcast double %x to i64 @@ -93,7 +93,7 @@ define double @FsXORPSrr(double %x, double %y) { ; ; AVX512DQ-LABEL: FsXORPSrr: ; AVX512DQ: # BB#0: -; AVX512DQ-NEXT: vxorps %xmm1, %xmm0, %xmm0 # encoding: [0xc5,0xf8,0x57,0xc1] +; AVX512DQ-NEXT: vxorps %xmm1, %xmm0, %xmm0 # encoding: [0x62,0xf1,0x7c,0x08,0x57,0xc1] ; AVX512DQ-NEXT: retq # encoding: [0xc3] ; %bc1 = bitcast double %x to i64 |

