[AVX512] FMA support for the 231 variants

This is asm/diasm-only support, similar to AVX.

For ISeling the register variant, they are no different from 213 other than
whether the multiplication or the addition operand is destructed.

For ISeling the memory variant, i.e. to fold a load, they are no different
than the 132 variant.  The addition operand (op3) in both cases can come from
memory.  Again the ony difference is which operand is destructed.

There could be a post-RA pass that would convert a 213 or 132 into a 231.

Part of <rdar://problem/17082571>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220540 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Adam Nemet 2014-10-24 00:03:00 +00:00
parent 97a3cd4383
commit 7f7bf0da6a
2 changed files with 41 additions and 13 deletions

View File

@ -3356,40 +3356,44 @@ multiclass avx512_fma3p_rm<bits<8> opc, string OpcodeStr, X86VectorVTInfo _,
}
} // Constraints = "$src1 = $dst"
multiclass avx512_fma3p_forms<bits<8> opc213,
multiclass avx512_fma3p_forms<bits<8> opc213, bits<8> opc231,
string OpcodeStr, X86VectorVTInfo VTI,
SDPatternOperator OpNode> {
defm v213 : avx512_fma3p_rm<opc213, !strconcat(OpcodeStr, "213", VTI.Suffix),
VTI, OpNode>,
EVEX_V512, EVEX_CD8<VTI.EltSize, CD8VF>;
defm v231 : avx512_fma3p_rm<opc231, !strconcat(OpcodeStr, "231", VTI.Suffix),
VTI>,
EVEX_V512, EVEX_CD8<VTI.EltSize, CD8VF>;
}
let ExeDomain = SSEPackedSingle in {
defm VFMADDPSZ : avx512_fma3p_forms<0xA8, "vfmadd",
defm VFMADDPSZ : avx512_fma3p_forms<0xA8, 0xB8, "vfmadd",
v16f32_info, X86Fmadd>;
defm VFMSUBPSZ : avx512_fma3p_forms<0xAA, "vfmsub",
defm VFMSUBPSZ : avx512_fma3p_forms<0xAA, 0xBA, "vfmsub",
v16f32_info, X86Fmsub>;
defm VFMADDSUBPSZ : avx512_fma3p_forms<0xA6, "vfmaddsub",
defm VFMADDSUBPSZ : avx512_fma3p_forms<0xA6, 0xB6, "vfmaddsub",
v16f32_info, X86Fmaddsub>;
defm VFMSUBADDPSZ : avx512_fma3p_forms<0xA7, "vfmsubadd",
defm VFMSUBADDPSZ : avx512_fma3p_forms<0xA7, 0xB7, "vfmsubadd",
v16f32_info, X86Fmsubadd>;
defm VFNMADDPSZ : avx512_fma3p_forms<0xAC, "vfnmadd",
defm VFNMADDPSZ : avx512_fma3p_forms<0xAC, 0xBC, "vfnmadd",
v16f32_info, X86Fnmadd>;
defm VFNMSUBPSZ : avx512_fma3p_forms<0xAE, "vfnmsub",
defm VFNMSUBPSZ : avx512_fma3p_forms<0xAE, 0xBE, "vfnmsub",
v16f32_info, X86Fnmsub>;
}
let ExeDomain = SSEPackedDouble in {
defm VFMADDPDZ : avx512_fma3p_forms<0xA8, "vfmadd",
defm VFMADDPDZ : avx512_fma3p_forms<0xA8, 0xB8, "vfmadd",
v8f64_info, X86Fmadd>, VEX_W;
defm VFMSUBPDZ : avx512_fma3p_forms<0xAA, "vfmsub",
defm VFMSUBPDZ : avx512_fma3p_forms<0xAA, 0xBA, "vfmsub",
v8f64_info, X86Fmsub>, VEX_W;
defm VFMADDSUBPDZ : avx512_fma3p_forms<0xA6, "vfmaddsub",
defm VFMADDSUBPDZ : avx512_fma3p_forms<0xA6, 0xB6, "vfmaddsub",
v8f64_info, X86Fmaddsub>, VEX_W;
defm VFMSUBADDPDZ : avx512_fma3p_forms<0xA7, "vfmsubadd",
defm VFMSUBADDPDZ : avx512_fma3p_forms<0xA7, 0xB7, "vfmsubadd",
v8f64_info, X86Fmsubadd>, VEX_W;
defm VFNMADDPDZ : avx512_fma3p_forms<0xAC, "vfnmadd",
defm VFNMADDPDZ : avx512_fma3p_forms<0xAC, 0xBC, "vfnmadd",
v8f64_info, X86Fnmadd>, VEX_W;
defm VFNMSUBPDZ : avx512_fma3p_forms<0xAE, "vfnmsub",
defm VFNMSUBPDZ : avx512_fma3p_forms<0xAE, 0xBE, "vfnmsub",
v8f64_info, X86Fnmsub>, VEX_W;
}

View File

@ -4351,3 +4351,27 @@ vextractf32x4 $3, %zmm3, %xmm1 {%k1}
// CHECK: vextracti64x4 $1
// CHECK: encoding: [0x62,0x53,0xfd,0xcb,0x3b,0xf4,0x01]
vextracti64x4 $1, %zmm14, %ymm12 {%k3} {z}
// CHECK: vfmadd231ps
// CHECK: encoding: [0x62,0xb2,0x1d,0x48,0xb8,0xe7]
vfmadd231ps %zmm23, %zmm12, %zmm4
// CHECK: vfmsub231pd
// CHECK: encoding: [0x62,0xe2,0xed,0x48,0xba,0x73,0x08]
vfmsub231pd 0x200(%rbx), %zmm2, %zmm22
// CHECK: vfmaddsub231ps
// CHECK: encoding: [0x62,0xd2,0x65,0x4b,0xb6,0xec]
vfmaddsub231ps %zmm12, %zmm3, %zmm5 {%k3}
// CHECK: vfmsubadd231pd
// CHECK: encoding: [0x62,0x72,0x85,0xc5,0xb7,0xdd]
vfmsubadd231pd %zmm5, %zmm31, %zmm11 {%k5}{z}
// CHECK: vfnmadd231ps
// CHECK: encoding: [0x62,0xf2,0x4d,0x48,0xbc,0xfd]
vfnmadd231ps %zmm5, %zmm6, %zmm7
// CHECK: vfnmsub231pd
// CHECK: encoding: [0x62,0xf2,0xcd,0x48,0xbe,0xfd]
vfnmsub231pd %zmm5, %zmm6, %zmm7