summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-03-17 06:10:37 +0000
committerCraig Topper <craig.topper@gmail.com>2017-03-17 06:10:37 +0000
commit6a1290a0fd35776f87c81dbf631f1b73c6a9b59a (patch)
treed6a9b34b067391d6996d94782b76db4bacf4bf26 /llvm
parentc1338f21ed8f3f06067b058914ad05ee2abeb7e5 (diff)
downloadbcm5719-llvm-6a1290a0fd35776f87c81dbf631f1b73c6a9b59a.tar.gz
bcm5719-llvm-6a1290a0fd35776f87c81dbf631f1b73c6a9b59a.zip
[AVX-512] Give priority to EVEX encoded scalar FMA instructions when we have FMA, AVX512 and no VLX.
We were giving priority if VLX was enabled. llvm-svn: 298046
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Target/X86/X86InstrFMA.td16
-rw-r--r--llvm/test/CodeGen/X86/fma.ll4
2 files changed, 11 insertions, 9 deletions
diff --git a/llvm/lib/Target/X86/X86InstrFMA.td b/llvm/lib/Target/X86/X86InstrFMA.td
index 4b19f801dae..1941ae57f0f 100644
--- a/llvm/lib/Target/X86/X86InstrFMA.td
+++ b/llvm/lib/Target/X86/X86InstrFMA.td
@@ -191,13 +191,15 @@ multiclass fma3s_rm_int<bits<8> opc, string OpcodeStr,
multiclass fma3s_forms<bits<8> opc132, bits<8> opc213, bits<8> opc231,
string OpStr, string PackTy, string Suff,
SDNode OpNode, RegisterClass RC,
- X86MemOperand x86memop> {
- defm NAME#132#Suff : fma3s_rm<opc132, !strconcat(OpStr, "132", PackTy),
- x86memop, RC>;
- defm NAME#213#Suff : fma3s_rm<opc213, !strconcat(OpStr, "213", PackTy),
- x86memop, RC, OpNode>;
- defm NAME#231#Suff : fma3s_rm<opc231, !strconcat(OpStr, "231", PackTy),
- x86memop, RC>;
+ X86MemOperand x86memop> {
+ let Predicates = [HasFMA, NoAVX512] in {
+ defm NAME#132#Suff : fma3s_rm<opc132, !strconcat(OpStr, "132", PackTy),
+ x86memop, RC>;
+ defm NAME#213#Suff : fma3s_rm<opc213, !strconcat(OpStr, "213", PackTy),
+ x86memop, RC, OpNode>;
+ defm NAME#231#Suff : fma3s_rm<opc231, !strconcat(OpStr, "231", PackTy),
+ x86memop, RC>;
+ }
}
// The FMA 213 form is created for lowering of scalar FMA intrinscis
diff --git a/llvm/test/CodeGen/X86/fma.ll b/llvm/test/CodeGen/X86/fma.ll
index 8c50677b935..f5002c01846 100644
--- a/llvm/test/CodeGen/X86/fma.ll
+++ b/llvm/test/CodeGen/X86/fma.ll
@@ -46,7 +46,7 @@ define float @test_f32(float %a, float %b, float %c) #0 {
;
; AVX51264-LABEL: test_f32:
; AVX51264: ## BB#0: ## %entry
-; AVX51264-NEXT: vfmadd213ss %xmm2, %xmm1, %xmm0 ## encoding: [0xc4,0xe2,0x71,0xa9,0xc2]
+; AVX51264-NEXT: vfmadd213ss %xmm2, %xmm1, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x71,0xa9,0xc2]
; AVX51264-NEXT: retq ## encoding: [0xc3]
entry:
%call = call float @llvm.fma.f32(float %a, float %b, float %c)
@@ -91,7 +91,7 @@ define double @test_f64(double %a, double %b, double %c) #0 {
;
; AVX51264-LABEL: test_f64:
; AVX51264: ## BB#0: ## %entry
-; AVX51264-NEXT: vfmadd213sd %xmm2, %xmm1, %xmm0 ## encoding: [0xc4,0xe2,0xf1,0xa9,0xc2]
+; AVX51264-NEXT: vfmadd213sd %xmm2, %xmm1, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0xf1,0xa9,0xc2]
; AVX51264-NEXT: retq ## encoding: [0xc3]
entry:
%call = call double @llvm.fma.f64(double %a, double %b, double %c)
OpenPOWER on IntegriCloud