diff options
author | Quentin Colombet <qcolombet@apple.com> | 2013-10-25 18:04:12 +0000 |
---|---|---|
committer | Quentin Colombet <qcolombet@apple.com> | 2013-10-25 18:04:12 +0000 |
commit | ed400c710890313116aeea9a070dce7956da44d1 (patch) | |
tree | 12e417a0a6a8c3dde29e1bcc459fddfa993a7b68 | |
parent | 52d4822f71a76ef113be24afdce4e8ccfba2c3c1 (diff) | |
download | external_llvm-ed400c710890313116aeea9a070dce7956da44d1.zip external_llvm-ed400c710890313116aeea9a070dce7956da44d1.tar.gz external_llvm-ed400c710890313116aeea9a070dce7956da44d1.tar.bz2 |
[X86][AVX512] Add patterns that match the AVX512 floating point register vbroadcast intrinsics.
Patch by Cameron McInally <cameron.mcinally@nyu.edu>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193422 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/X86/X86InstrAVX512.td | 5 | ||||
-rw-r--r-- | test/CodeGen/X86/avx512-intrinsics.ll | 14 |
2 files changed, 19 insertions, 0 deletions
diff --git a/lib/Target/X86/X86InstrAVX512.td b/lib/Target/X86/X86InstrAVX512.td index 79b9ae8..ed90a4b 100644 --- a/lib/Target/X86/X86InstrAVX512.td +++ b/lib/Target/X86/X86InstrAVX512.td @@ -465,6 +465,11 @@ def : Pat<(v16f32 (X86VBroadcast (v4f32 VR128X:$src))), (VBROADCASTSSZrr VR128X:$src)>; def : Pat<(v8f64 (X86VBroadcast (v2f64 VR128X:$src))), (VBROADCASTSDZrr VR128X:$src)>; + +def : Pat<(v16f32 (int_x86_avx512_vbroadcast_ss_ps_512 (v4f32 VR128X:$src))), + (VBROADCASTSSZrr VR128X:$src)>; +def : Pat<(v8f64 (int_x86_avx512_vbroadcast_sd_pd_512 (v2f64 VR128X:$src))), + (VBROADCASTSDZrr VR128X:$src)>; // Provide fallback in case the load node that is used in the patterns above // is used by additional users, which prevents the pattern selection. diff --git a/test/CodeGen/X86/avx512-intrinsics.ll b/test/CodeGen/X86/avx512-intrinsics.ll index 01e7b69..5cd7311 100644 --- a/test/CodeGen/X86/avx512-intrinsics.ll +++ b/test/CodeGen/X86/avx512-intrinsics.ll @@ -219,3 +219,17 @@ define <8 x double> @test_x86_vbroadcast_sd_512(i8* %a0) { ret <8 x double> %res } declare <8 x double> @llvm.x86.avx512.vbroadcast.sd.512(i8*) nounwind readonly + +define <16 x float> @test_x86_vbroadcast_ss_ps_512(<4 x float> %a0) { + ; CHECK: vbroadcastss + %res = call <16 x float> @llvm.x86.avx512.vbroadcast.ss.ps.512(<4 x float> %a0) ; <<16 x float>> [#uses=1] + ret <16 x float> %res +} +declare <16 x float> @llvm.x86.avx512.vbroadcast.ss.ps.512(<4 x float>) nounwind readonly + +define <8 x double> @test_x86_vbroadcast_sd_pd_512(<2 x double> %a0) { + ; CHECK: vbroadcastsd + %res = call <8 x double> @llvm.x86.avx512.vbroadcast.sd.pd.512(<2 x double> %a0) ; <<8 x double>> [#uses=1] + ret <8 x double> %res +} +declare <8 x double> @llvm.x86.avx512.vbroadcast.sd.pd.512(<2 x double>) nounwind readonly |