2017-02-26 03:18:04 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2018-06-03 22:56:04 +08:00
|
|
|
; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx512er --show-mc-encoding | FileCheck %s --check-prefixes=CHECK,X86
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512er --show-mc-encoding | FileCheck %s --check-prefixes=CHECK,X64
|
2014-11-12 15:31:03 +08:00
|
|
|
|
|
|
|
define <16 x float> @test_rsqrt28_ps(<16 x float> %a0) {
|
2017-02-26 03:18:04 +08:00
|
|
|
; CHECK-LABEL: test_rsqrt28_ps:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-02-26 03:18:04 +08:00
|
|
|
; CHECK-NEXT: vrsqrt28ps {sae}, %zmm0, %zmm0 # encoding: [0x62,0xf2,0x7d,0x18,0xcc,0xc0]
|
2018-06-03 22:56:04 +08:00
|
|
|
; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
|
2014-11-12 15:31:03 +08:00
|
|
|
%res = call <16 x float> @llvm.x86.avx512.rsqrt28.ps(<16 x float> %a0, <16 x float> zeroinitializer, i16 -1, i32 8)
|
|
|
|
ret <16 x float> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <16 x float> @test1_rsqrt28_ps(<16 x float> %a0, <16 x float> %a1) {
|
2017-02-26 03:18:04 +08:00
|
|
|
; CHECK-LABEL: test1_rsqrt28_ps:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-02-26 03:18:04 +08:00
|
|
|
; CHECK-NEXT: movw $6, %ax # encoding: [0x66,0xb8,0x06,0x00]
|
|
|
|
; CHECK-NEXT: kmovw %eax, %k1 # encoding: [0xc5,0xf8,0x92,0xc8]
|
|
|
|
; CHECK-NEXT: vrsqrt28ps {sae}, %zmm0, %zmm1 {%k1} # encoding: [0x62,0xf2,0x7d,0x19,0xcc,0xc8]
|
|
|
|
; CHECK-NEXT: vmovaps %zmm1, %zmm0 # encoding: [0x62,0xf1,0x7c,0x48,0x28,0xc1]
|
2018-06-03 22:56:04 +08:00
|
|
|
; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
|
2014-11-12 15:31:03 +08:00
|
|
|
%res = call <16 x float> @llvm.x86.avx512.rsqrt28.ps(<16 x float> %a0, <16 x float> %a1, i16 6, i32 8)
|
|
|
|
ret <16 x float> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <16 x float> @test2_rsqrt28_ps(<16 x float> %a0) {
|
2017-02-26 03:18:04 +08:00
|
|
|
; CHECK-LABEL: test2_rsqrt28_ps:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-02-26 03:18:04 +08:00
|
|
|
; CHECK-NEXT: movw $6, %ax # encoding: [0x66,0xb8,0x06,0x00]
|
|
|
|
; CHECK-NEXT: kmovw %eax, %k1 # encoding: [0xc5,0xf8,0x92,0xc8]
|
|
|
|
; CHECK-NEXT: vrsqrt28ps %zmm0, %zmm0 {%k1} {z} # encoding: [0x62,0xf2,0x7d,0xc9,0xcc,0xc0]
|
2018-06-03 22:56:04 +08:00
|
|
|
; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
|
2014-11-12 15:31:03 +08:00
|
|
|
%res = call <16 x float> @llvm.x86.avx512.rsqrt28.ps(<16 x float> %a0, <16 x float> undef, i16 6, i32 4)
|
|
|
|
ret <16 x float> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <16 x float> @test3_rsqrt28_ps(<16 x float> %a0) {
|
2017-02-26 03:18:04 +08:00
|
|
|
; CHECK-LABEL: test3_rsqrt28_ps:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-02-26 03:18:04 +08:00
|
|
|
; CHECK-NEXT: movw $6, %ax # encoding: [0x66,0xb8,0x06,0x00]
|
|
|
|
; CHECK-NEXT: kmovw %eax, %k1 # encoding: [0xc5,0xf8,0x92,0xc8]
|
|
|
|
; CHECK-NEXT: vrsqrt28ps %zmm0, %zmm0 {%k1} {z} # encoding: [0x62,0xf2,0x7d,0xc9,0xcc,0xc0]
|
2018-06-03 22:56:04 +08:00
|
|
|
; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
|
2014-11-12 15:31:03 +08:00
|
|
|
%res = call <16 x float> @llvm.x86.avx512.rsqrt28.ps(<16 x float> %a0, <16 x float> zeroinitializer, i16 6, i32 4)
|
|
|
|
ret <16 x float> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <16 x float> @test4_rsqrt28_ps(<16 x float> %a0) {
|
2017-02-26 03:18:04 +08:00
|
|
|
; CHECK-LABEL: test4_rsqrt28_ps:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-02-26 03:18:04 +08:00
|
|
|
; CHECK-NEXT: movw $6, %ax # encoding: [0x66,0xb8,0x06,0x00]
|
|
|
|
; CHECK-NEXT: kmovw %eax, %k1 # encoding: [0xc5,0xf8,0x92,0xc8]
|
|
|
|
; CHECK-NEXT: vrsqrt28ps {sae}, %zmm0, %zmm0 {%k1} {z} # encoding: [0x62,0xf2,0x7d,0x99,0xcc,0xc0]
|
2018-06-03 22:56:04 +08:00
|
|
|
; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
|
2017-02-26 03:18:04 +08:00
|
|
|
%res = call <16 x float> @llvm.x86.avx512.rsqrt28.ps(<16 x float> %a0, <16 x float> undef, i16 6, i32 8)
|
2014-11-12 15:31:03 +08:00
|
|
|
ret <16 x float> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <16 x float> @llvm.x86.avx512.rsqrt28.ps(<16 x float>, <16 x float>, i16, i32) nounwind readnone
|
|
|
|
|
|
|
|
define <16 x float> @test_rcp28_ps_512(<16 x float> %a0) {
|
2017-02-26 03:18:04 +08:00
|
|
|
; CHECK-LABEL: test_rcp28_ps_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-02-26 03:18:04 +08:00
|
|
|
; CHECK-NEXT: vrcp28ps {sae}, %zmm0, %zmm0 # encoding: [0x62,0xf2,0x7d,0x18,0xca,0xc0]
|
2018-06-03 22:56:04 +08:00
|
|
|
; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
|
2014-11-12 15:31:03 +08:00
|
|
|
%res = call <16 x float> @llvm.x86.avx512.rcp28.ps(<16 x float> %a0, <16 x float> zeroinitializer, i16 -1, i32 8)
|
|
|
|
ret <16 x float> %res
|
|
|
|
}
|
|
|
|
declare <16 x float> @llvm.x86.avx512.rcp28.ps(<16 x float>, <16 x float>, i16, i32) nounwind readnone
|
|
|
|
|
|
|
|
define <8 x double> @test_rcp28_pd_512(<8 x double> %a0) {
|
2017-02-26 03:18:04 +08:00
|
|
|
; CHECK-LABEL: test_rcp28_pd_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-02-26 03:18:04 +08:00
|
|
|
; CHECK-NEXT: vrcp28pd {sae}, %zmm0, %zmm0 # encoding: [0x62,0xf2,0xfd,0x18,0xca,0xc0]
|
2018-06-03 22:56:04 +08:00
|
|
|
; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
|
2017-02-26 03:18:04 +08:00
|
|
|
%res = call <8 x double> @llvm.x86.avx512.rcp28.pd(<8 x double> %a0, <8 x double> zeroinitializer, i8 -1, i32 8)
|
2014-11-12 15:31:03 +08:00
|
|
|
ret <8 x double> %res
|
|
|
|
}
|
|
|
|
declare <8 x double> @llvm.x86.avx512.rcp28.pd(<8 x double>, <8 x double>, i8, i32) nounwind readnone
|
|
|
|
|
|
|
|
define <16 x float> @test_exp2_ps_512(<16 x float> %a0) {
|
2017-02-26 03:18:04 +08:00
|
|
|
; CHECK-LABEL: test_exp2_ps_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-02-26 03:18:04 +08:00
|
|
|
; CHECK-NEXT: vexp2ps {sae}, %zmm0, %zmm0 # encoding: [0x62,0xf2,0x7d,0x18,0xc8,0xc0]
|
2018-06-03 22:56:04 +08:00
|
|
|
; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
|
2014-11-12 15:31:03 +08:00
|
|
|
%res = call <16 x float> @llvm.x86.avx512.exp2.ps(<16 x float> %a0, <16 x float> zeroinitializer, i16 -1, i32 8)
|
|
|
|
ret <16 x float> %res
|
|
|
|
}
|
|
|
|
declare <16 x float> @llvm.x86.avx512.exp2.ps(<16 x float>, <16 x float>, i16, i32) nounwind readnone
|
|
|
|
|
|
|
|
define <8 x double> @test_exp2_pd_512(<8 x double> %a0) {
|
2017-02-26 03:18:04 +08:00
|
|
|
; CHECK-LABEL: test_exp2_pd_512:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-02-26 03:18:04 +08:00
|
|
|
; CHECK-NEXT: vexp2pd {sae}, %zmm0, %zmm0 # encoding: [0x62,0xf2,0xfd,0x18,0xc8,0xc0]
|
2018-06-03 22:56:04 +08:00
|
|
|
; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
|
2014-11-12 15:31:03 +08:00
|
|
|
%res = call <8 x double> @llvm.x86.avx512.exp2.pd(<8 x double> %a0, <8 x double> zeroinitializer, i8 -1, i32 8)
|
|
|
|
ret <8 x double> %res
|
|
|
|
}
|
|
|
|
declare <8 x double> @llvm.x86.avx512.exp2.pd(<8 x double>, <8 x double>, i8, i32) nounwind readnone
|
|
|
|
|
|
|
|
define <4 x float> @test_rsqrt28_ss(<4 x float> %a0) {
|
2017-02-26 03:18:04 +08:00
|
|
|
; CHECK-LABEL: test_rsqrt28_ss:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-02-26 03:18:04 +08:00
|
|
|
; CHECK-NEXT: vrsqrt28ss {sae}, %xmm0, %xmm0, %xmm0 # encoding: [0x62,0xf2,0x7d,0x18,0xcd,0xc0]
|
2018-06-03 22:56:04 +08:00
|
|
|
; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
|
2014-11-12 15:31:03 +08:00
|
|
|
%res = call <4 x float> @llvm.x86.avx512.rsqrt28.ss(<4 x float> %a0, <4 x float> %a0, <4 x float> zeroinitializer, i8 -1, i32 8) ; <<4 x float>> [#uses=1]
|
|
|
|
ret <4 x float> %res
|
|
|
|
}
|
|
|
|
declare <4 x float> @llvm.x86.avx512.rsqrt28.ss(<4 x float>, <4 x float>, <4 x float>, i8, i32) nounwind readnone
|
|
|
|
|
|
|
|
define <4 x float> @test_rcp28_ss(<4 x float> %a0) {
|
2017-02-26 03:18:04 +08:00
|
|
|
; CHECK-LABEL: test_rcp28_ss:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-02-26 03:18:04 +08:00
|
|
|
; CHECK-NEXT: vrcp28ss {sae}, %xmm0, %xmm0, %xmm0 # encoding: [0x62,0xf2,0x7d,0x18,0xcb,0xc0]
|
2018-06-03 22:56:04 +08:00
|
|
|
; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
|
2014-11-12 15:31:03 +08:00
|
|
|
%res = call <4 x float> @llvm.x86.avx512.rcp28.ss(<4 x float> %a0, <4 x float> %a0, <4 x float> zeroinitializer, i8 -1, i32 8) ; <<4 x float>> [#uses=1]
|
|
|
|
ret <4 x float> %res
|
|
|
|
}
|
|
|
|
declare <4 x float> @llvm.x86.avx512.rcp28.ss(<4 x float>, <4 x float>, <4 x float>, i8, i32) nounwind readnone
|
|
|
|
|
2017-11-19 13:42:54 +08:00
|
|
|
define <4 x float> @test_rcp28_ss_load(<4 x float> %a0, <4 x float>* %a1ptr) {
|
2018-06-03 22:56:04 +08:00
|
|
|
; X86-LABEL: test_rcp28_ss_load:
|
|
|
|
; X86: # %bb.0:
|
|
|
|
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
|
|
|
|
; X86-NEXT: vrcp28ss (%eax), %xmm0, %xmm0 # encoding: [0x62,0xf2,0x7d,0x08,0xcb,0x00]
|
|
|
|
; X86-NEXT: retl # encoding: [0xc3]
|
|
|
|
;
|
|
|
|
; X64-LABEL: test_rcp28_ss_load:
|
|
|
|
; X64: # %bb.0:
|
|
|
|
; X64-NEXT: vrcp28ss (%rdi), %xmm0, %xmm0 # encoding: [0x62,0xf2,0x7d,0x08,0xcb,0x07]
|
|
|
|
; X64-NEXT: retq # encoding: [0xc3]
|
2017-11-19 13:42:54 +08:00
|
|
|
%a1 = load <4 x float>, <4 x float>* %a1ptr
|
|
|
|
%res = call <4 x float> @llvm.x86.avx512.rcp28.ss(<4 x float> %a0, <4 x float> %a1, <4 x float> undef, i8 -1, i32 4) ; <<4 x float>> [#uses=1]
|
|
|
|
ret <4 x float> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x float> @test_rsqrt28_ss_load(<4 x float> %a0, <4 x float>* %a1ptr) {
|
2018-06-03 22:56:04 +08:00
|
|
|
; X86-LABEL: test_rsqrt28_ss_load:
|
|
|
|
; X86: # %bb.0:
|
|
|
|
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
|
|
|
|
; X86-NEXT: vrsqrt28ss (%eax), %xmm0, %xmm0 # encoding: [0x62,0xf2,0x7d,0x08,0xcd,0x00]
|
|
|
|
; X86-NEXT: retl # encoding: [0xc3]
|
|
|
|
;
|
|
|
|
; X64-LABEL: test_rsqrt28_ss_load:
|
|
|
|
; X64: # %bb.0:
|
|
|
|
; X64-NEXT: vrsqrt28ss (%rdi), %xmm0, %xmm0 # encoding: [0x62,0xf2,0x7d,0x08,0xcd,0x07]
|
|
|
|
; X64-NEXT: retq # encoding: [0xc3]
|
2017-11-19 13:42:54 +08:00
|
|
|
%a1 = load <4 x float>, <4 x float>* %a1ptr
|
|
|
|
%res = call <4 x float> @llvm.x86.avx512.rsqrt28.ss(<4 x float> %a0, <4 x float> %a1, <4 x float> undef, i8 -1, i32 4) ; <<4 x float>> [#uses=1]
|
|
|
|
ret <4 x float> %res
|
|
|
|
}
|
|
|
|
|
2017-05-09 22:03:51 +08:00
|
|
|
define <4 x float> @test_rsqrt28_ss_maskz(<4 x float> %a0, i8 %mask) {
|
2018-06-03 22:56:04 +08:00
|
|
|
; X86-LABEL: test_rsqrt28_ss_maskz:
|
|
|
|
; X86: # %bb.0:
|
2018-11-21 15:01:22 +08:00
|
|
|
; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax # encoding: [0x0f,0xb6,0x44,0x24,0x04]
|
2018-06-03 22:56:04 +08:00
|
|
|
; X86-NEXT: kmovw %eax, %k1 # encoding: [0xc5,0xf8,0x92,0xc8]
|
|
|
|
; X86-NEXT: vrsqrt28ss {sae}, %xmm0, %xmm0, %xmm0 {%k1} {z} # encoding: [0x62,0xf2,0x7d,0x99,0xcd,0xc0]
|
|
|
|
; X86-NEXT: retl # encoding: [0xc3]
|
|
|
|
;
|
|
|
|
; X64-LABEL: test_rsqrt28_ss_maskz:
|
|
|
|
; X64: # %bb.0:
|
|
|
|
; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
|
|
|
|
; X64-NEXT: vrsqrt28ss {sae}, %xmm0, %xmm0, %xmm0 {%k1} {z} # encoding: [0x62,0xf2,0x7d,0x99,0xcd,0xc0]
|
|
|
|
; X64-NEXT: retq # encoding: [0xc3]
|
2017-05-09 22:03:51 +08:00
|
|
|
%res = call <4 x float> @llvm.x86.avx512.rsqrt28.ss(<4 x float> %a0, <4 x float> %a0, <4 x float> zeroinitializer, i8 %mask, i32 8) ;
|
2014-11-26 18:46:49 +08:00
|
|
|
ret <4 x float> %res
|
|
|
|
}
|
|
|
|
|
2017-05-09 22:03:51 +08:00
|
|
|
define <4 x float> @test_rsqrt28_ss_mask(<4 x float> %a0, <4 x float> %b0, <4 x float> %c0, i8 %mask) {
|
2018-06-03 22:56:04 +08:00
|
|
|
; X86-LABEL: test_rsqrt28_ss_mask:
|
|
|
|
; X86: # %bb.0:
|
2018-11-21 15:01:22 +08:00
|
|
|
; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax # encoding: [0x0f,0xb6,0x44,0x24,0x04]
|
2018-06-03 22:56:04 +08:00
|
|
|
; X86-NEXT: kmovw %eax, %k1 # encoding: [0xc5,0xf8,0x92,0xc8]
|
|
|
|
; X86-NEXT: vrsqrt28ss {sae}, %xmm1, %xmm0, %xmm2 {%k1} # encoding: [0x62,0xf2,0x7d,0x19,0xcd,0xd1]
|
|
|
|
; X86-NEXT: vmovaps %xmm2, %xmm0 # encoding: [0xc5,0xf8,0x28,0xc2]
|
|
|
|
; X86-NEXT: retl # encoding: [0xc3]
|
|
|
|
;
|
|
|
|
; X64-LABEL: test_rsqrt28_ss_mask:
|
|
|
|
; X64: # %bb.0:
|
|
|
|
; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
|
|
|
|
; X64-NEXT: vrsqrt28ss {sae}, %xmm1, %xmm0, %xmm2 {%k1} # encoding: [0x62,0xf2,0x7d,0x19,0xcd,0xd1]
|
|
|
|
; X64-NEXT: vmovaps %xmm2, %xmm0 # encoding: [0xc5,0xf8,0x28,0xc2]
|
|
|
|
; X64-NEXT: retq # encoding: [0xc3]
|
2017-05-09 22:03:51 +08:00
|
|
|
%res = call <4 x float> @llvm.x86.avx512.rsqrt28.ss(<4 x float> %a0, <4 x float> %b0, <4 x float> %c0, i8 %mask, i32 8) ;
|
2014-11-26 18:46:49 +08:00
|
|
|
ret <4 x float> %res
|
|
|
|
}
|
|
|
|
|
2017-11-19 13:42:54 +08:00
|
|
|
define <2 x double> @test_rcp28_sd_mask_load(<2 x double> %a0, <2 x double>* %a1ptr, <2 x double> %a2, i8 %mask) {
|
2018-06-03 22:56:04 +08:00
|
|
|
; X86-LABEL: test_rcp28_sd_mask_load:
|
|
|
|
; X86: # %bb.0:
|
2018-11-21 15:01:22 +08:00
|
|
|
; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax # encoding: [0x0f,0xb6,0x44,0x24,0x08]
|
2018-06-03 22:56:04 +08:00
|
|
|
; X86-NEXT: kmovw %eax, %k1 # encoding: [0xc5,0xf8,0x92,0xc8]
|
|
|
|
; X86-NEXT: vrcp28sd %xmm0, %xmm0, %xmm1 {%k1} # encoding: [0x62,0xf2,0xfd,0x09,0xcb,0xc8]
|
|
|
|
; X86-NEXT: vmovapd %xmm1, %xmm0 # encoding: [0xc5,0xf9,0x28,0xc1]
|
|
|
|
; X86-NEXT: retl # encoding: [0xc3]
|
|
|
|
;
|
|
|
|
; X64-LABEL: test_rcp28_sd_mask_load:
|
|
|
|
; X64: # %bb.0:
|
|
|
|
; X64-NEXT: kmovw %esi, %k1 # encoding: [0xc5,0xf8,0x92,0xce]
|
|
|
|
; X64-NEXT: vrcp28sd %xmm0, %xmm0, %xmm1 {%k1} # encoding: [0x62,0xf2,0xfd,0x09,0xcb,0xc8]
|
|
|
|
; X64-NEXT: vmovapd %xmm1, %xmm0 # encoding: [0xc5,0xf9,0x28,0xc1]
|
|
|
|
; X64-NEXT: retq # encoding: [0xc3]
|
2017-11-19 13:42:54 +08:00
|
|
|
%a1 = load <2 x double>, <2 x double>* %a1ptr
|
|
|
|
%res = call <2 x double> @llvm.x86.avx512.rcp28.sd(<2 x double> %a0, <2 x double> %a0, <2 x double> %a2, i8 %mask, i32 4) ;
|
|
|
|
ret <2 x double> %res
|
|
|
|
}
|
|
|
|
declare <2 x double> @llvm.x86.avx512.rcp28.sd(<2 x double>, <2 x double>, <2 x double>, i8, i32) nounwind readnone
|
|
|
|
|
|
|
|
define <2 x double> @test_rsqrt28_sd_maskz_load(<2 x double> %a0, <2 x double>* %a1ptr, i8 %mask) {
|
2018-06-03 22:56:04 +08:00
|
|
|
; X86-LABEL: test_rsqrt28_sd_maskz_load:
|
|
|
|
; X86: # %bb.0:
|
2018-11-21 15:01:22 +08:00
|
|
|
; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax # encoding: [0x0f,0xb6,0x44,0x24,0x08]
|
2018-06-03 22:56:04 +08:00
|
|
|
; X86-NEXT: kmovw %eax, %k1 # encoding: [0xc5,0xf8,0x92,0xc8]
|
|
|
|
; X86-NEXT: vrsqrt28sd %xmm0, %xmm0, %xmm0 {%k1} {z} # encoding: [0x62,0xf2,0xfd,0x89,0xcd,0xc0]
|
|
|
|
; X86-NEXT: retl # encoding: [0xc3]
|
|
|
|
;
|
|
|
|
; X64-LABEL: test_rsqrt28_sd_maskz_load:
|
|
|
|
; X64: # %bb.0:
|
|
|
|
; X64-NEXT: kmovw %esi, %k1 # encoding: [0xc5,0xf8,0x92,0xce]
|
|
|
|
; X64-NEXT: vrsqrt28sd %xmm0, %xmm0, %xmm0 {%k1} {z} # encoding: [0x62,0xf2,0xfd,0x89,0xcd,0xc0]
|
|
|
|
; X64-NEXT: retq # encoding: [0xc3]
|
2017-11-19 13:42:54 +08:00
|
|
|
%a1 = load <2 x double>, <2 x double>* %a1ptr
|
|
|
|
%res = call <2 x double> @llvm.x86.avx512.rsqrt28.sd(<2 x double> %a0, <2 x double> %a0, <2 x double> zeroinitializer, i8 %mask, i32 4) ;
|
|
|
|
ret <2 x double> %res
|
|
|
|
}
|
|
|
|
|
2017-05-09 22:03:51 +08:00
|
|
|
define <2 x double> @test_rsqrt28_sd_maskz(<2 x double> %a0, i8 %mask) {
|
2018-06-03 22:56:04 +08:00
|
|
|
; X86-LABEL: test_rsqrt28_sd_maskz:
|
|
|
|
; X86: # %bb.0:
|
2018-11-21 15:01:22 +08:00
|
|
|
; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax # encoding: [0x0f,0xb6,0x44,0x24,0x04]
|
2018-06-03 22:56:04 +08:00
|
|
|
; X86-NEXT: kmovw %eax, %k1 # encoding: [0xc5,0xf8,0x92,0xc8]
|
|
|
|
; X86-NEXT: vrsqrt28sd {sae}, %xmm0, %xmm0, %xmm0 {%k1} {z} # encoding: [0x62,0xf2,0xfd,0x99,0xcd,0xc0]
|
|
|
|
; X86-NEXT: retl # encoding: [0xc3]
|
|
|
|
;
|
|
|
|
; X64-LABEL: test_rsqrt28_sd_maskz:
|
|
|
|
; X64: # %bb.0:
|
|
|
|
; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
|
|
|
|
; X64-NEXT: vrsqrt28sd {sae}, %xmm0, %xmm0, %xmm0 {%k1} {z} # encoding: [0x62,0xf2,0xfd,0x99,0xcd,0xc0]
|
|
|
|
; X64-NEXT: retq # encoding: [0xc3]
|
2017-05-09 22:03:51 +08:00
|
|
|
%res = call <2 x double> @llvm.x86.avx512.rsqrt28.sd(<2 x double> %a0, <2 x double> %a0, <2 x double> zeroinitializer, i8 %mask, i32 8) ;
|
2014-11-26 18:46:49 +08:00
|
|
|
ret <2 x double> %res
|
|
|
|
}
|
|
|
|
|
2017-05-09 22:03:51 +08:00
|
|
|
define <2 x double> @test_rsqrt28_sd_mask(<2 x double> %a0, <2 x double> %b0, <2 x double> %c0, i8 %mask) {
|
2018-06-03 22:56:04 +08:00
|
|
|
; X86-LABEL: test_rsqrt28_sd_mask:
|
|
|
|
; X86: # %bb.0:
|
2018-11-21 15:01:22 +08:00
|
|
|
; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax # encoding: [0x0f,0xb6,0x44,0x24,0x04]
|
2018-06-03 22:56:04 +08:00
|
|
|
; X86-NEXT: kmovw %eax, %k1 # encoding: [0xc5,0xf8,0x92,0xc8]
|
|
|
|
; X86-NEXT: vrsqrt28sd {sae}, %xmm1, %xmm0, %xmm2 {%k1} # encoding: [0x62,0xf2,0xfd,0x19,0xcd,0xd1]
|
|
|
|
; X86-NEXT: vmovapd %xmm2, %xmm0 # encoding: [0xc5,0xf9,0x28,0xc2]
|
|
|
|
; X86-NEXT: retl # encoding: [0xc3]
|
|
|
|
;
|
|
|
|
; X64-LABEL: test_rsqrt28_sd_mask:
|
|
|
|
; X64: # %bb.0:
|
|
|
|
; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
|
|
|
|
; X64-NEXT: vrsqrt28sd {sae}, %xmm1, %xmm0, %xmm2 {%k1} # encoding: [0x62,0xf2,0xfd,0x19,0xcd,0xd1]
|
|
|
|
; X64-NEXT: vmovapd %xmm2, %xmm0 # encoding: [0xc5,0xf9,0x28,0xc2]
|
|
|
|
; X64-NEXT: retq # encoding: [0xc3]
|
2017-05-09 22:03:51 +08:00
|
|
|
%res = call <2 x double> @llvm.x86.avx512.rsqrt28.sd(<2 x double> %a0, <2 x double> %b0, <2 x double> %c0, i8 %mask, i32 8) ;
|
2017-02-26 03:18:08 +08:00
|
|
|
ret <2 x double> %res
|
|
|
|
}
|
|
|
|
|
2014-11-26 18:46:49 +08:00
|
|
|
declare <2 x double> @llvm.x86.avx512.rsqrt28.sd(<2 x double>, <2 x double>, <2 x double>, i8, i32) nounwind readnone
|
|
|
|
|
2017-05-09 22:03:51 +08:00
|
|
|
define <2 x double> @test_rsqrt28_sd_maskz_mem(<2 x double> %a0, double* %ptr, i8 %mask) {
|
2018-06-03 22:56:04 +08:00
|
|
|
; X86-LABEL: test_rsqrt28_sd_maskz_mem:
|
|
|
|
; X86: # %bb.0:
|
2018-11-21 15:01:22 +08:00
|
|
|
; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax # encoding: [0x0f,0xb6,0x44,0x24,0x08]
|
|
|
|
; X86-NEXT: kmovw %eax, %k1 # encoding: [0xc5,0xf8,0x92,0xc8]
|
2018-06-03 22:56:04 +08:00
|
|
|
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
|
|
|
|
; X86-NEXT: vrsqrt28sd (%eax), %xmm0, %xmm0 {%k1} {z} # encoding: [0x62,0xf2,0xfd,0x89,0xcd,0x00]
|
|
|
|
; X86-NEXT: retl # encoding: [0xc3]
|
|
|
|
;
|
|
|
|
; X64-LABEL: test_rsqrt28_sd_maskz_mem:
|
|
|
|
; X64: # %bb.0:
|
|
|
|
; X64-NEXT: kmovw %esi, %k1 # encoding: [0xc5,0xf8,0x92,0xce]
|
|
|
|
; X64-NEXT: vrsqrt28sd (%rdi), %xmm0, %xmm0 {%k1} {z} # encoding: [0x62,0xf2,0xfd,0x89,0xcd,0x07]
|
|
|
|
; X64-NEXT: retq # encoding: [0xc3]
|
2015-02-28 05:17:42 +08:00
|
|
|
%mem = load double , double * %ptr, align 8
|
2014-11-26 18:46:49 +08:00
|
|
|
%mem_v = insertelement <2 x double> undef, double %mem, i32 0
|
2017-05-09 22:03:51 +08:00
|
|
|
%res = call <2 x double> @llvm.x86.avx512.rsqrt28.sd(<2 x double> %a0, <2 x double> %mem_v, <2 x double> zeroinitializer, i8 %mask, i32 4) ;
|
2014-11-26 18:46:49 +08:00
|
|
|
ret <2 x double> %res
|
|
|
|
}
|
|
|
|
|
2017-05-09 22:03:51 +08:00
|
|
|
define <2 x double> @test_rsqrt28_sd_maskz_mem_offset(<2 x double> %a0, double* %ptr, i8 %mask) {
|
2018-06-03 22:56:04 +08:00
|
|
|
; X86-LABEL: test_rsqrt28_sd_maskz_mem_offset:
|
|
|
|
; X86: # %bb.0:
|
2018-11-21 15:01:22 +08:00
|
|
|
; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax # encoding: [0x0f,0xb6,0x44,0x24,0x08]
|
|
|
|
; X86-NEXT: kmovw %eax, %k1 # encoding: [0xc5,0xf8,0x92,0xc8]
|
2018-06-03 22:56:04 +08:00
|
|
|
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
|
|
|
|
; X86-NEXT: vrsqrt28sd 144(%eax), %xmm0, %xmm0 {%k1} {z} # encoding: [0x62,0xf2,0xfd,0x89,0xcd,0x40,0x12]
|
|
|
|
; X86-NEXT: retl # encoding: [0xc3]
|
|
|
|
;
|
|
|
|
; X64-LABEL: test_rsqrt28_sd_maskz_mem_offset:
|
|
|
|
; X64: # %bb.0:
|
|
|
|
; X64-NEXT: kmovw %esi, %k1 # encoding: [0xc5,0xf8,0x92,0xce]
|
|
|
|
; X64-NEXT: vrsqrt28sd 144(%rdi), %xmm0, %xmm0 {%k1} {z} # encoding: [0x62,0xf2,0xfd,0x89,0xcd,0x47,0x12]
|
|
|
|
; X64-NEXT: retq # encoding: [0xc3]
|
[opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction
One of several parallel first steps to remove the target type of pointers,
replacing them with a single opaque pointer type.
This adds an explicit type parameter to the gep instruction so that when the
first parameter becomes an opaque pointer type, the type to gep through is
still available to the instructions.
* This doesn't modify gep operators, only instructions (operators will be
handled separately)
* Textual IR changes only. Bitcode (including upgrade) and changing the
in-memory representation will be in separate changes.
* geps of vectors are transformed as:
getelementptr <4 x float*> %x, ...
->getelementptr float, <4 x float*> %x, ...
Then, once the opaque pointer type is introduced, this will ultimately look
like:
getelementptr float, <4 x ptr> %x
with the unambiguous interpretation that it is a vector of pointers to float.
* address spaces remain on the pointer, not the type:
getelementptr float addrspace(1)* %x
->getelementptr float, float addrspace(1)* %x
Then, eventually:
getelementptr float, ptr addrspace(1) %x
Importantly, the massive amount of test case churn has been automated by
same crappy python code. I had to manually update a few test cases that
wouldn't fit the script's model (r228970,r229196,r229197,r229198). The
python script just massages stdin and writes the result to stdout, I
then wrapped that in a shell script to handle replacing files, then
using the usual find+xargs to migrate all the files.
update.py:
import fileinput
import sys
import re
ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
normrep = re.compile( r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
def conv(match, line):
if not match:
return line
line = match.groups()[0]
if len(match.groups()[5]) == 0:
line += match.groups()[2]
line += match.groups()[3]
line += ", "
line += match.groups()[1]
line += "\n"
return line
for line in sys.stdin:
if line.find("getelementptr ") == line.find("getelementptr inbounds"):
if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("):
line = conv(re.match(ibrep, line), line)
elif line.find("getelementptr ") != line.find("getelementptr ("):
line = conv(re.match(normrep, line), line)
sys.stdout.write(line)
apply.sh:
for name in "$@"
do
python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
rm -f "$name.tmp"
done
The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh
After that, check-all (with llvm, clang, clang-tools-extra, lld,
compiler-rt, and polly all checked out).
The extra 'rm' in the apply.sh script is due to a few files in clang's test
suite using interesting unicode stuff that my python script was throwing
exceptions on. None of those files needed to be migrated, so it seemed
sufficient to ignore those cases.
Reviewers: rafael, dexonsmith, grosser
Differential Revision: http://reviews.llvm.org/D7636
llvm-svn: 230786
2015-02-28 03:29:02 +08:00
|
|
|
%ptr1 = getelementptr double, double* %ptr, i32 18
|
2015-02-28 05:17:42 +08:00
|
|
|
%mem = load double , double * %ptr1, align 8
|
2014-11-26 18:46:49 +08:00
|
|
|
%mem_v = insertelement <2 x double> undef, double %mem, i32 0
|
2017-05-09 22:03:51 +08:00
|
|
|
%res = call <2 x double> @llvm.x86.avx512.rsqrt28.sd(<2 x double> %a0, <2 x double> %mem_v, <2 x double> zeroinitializer, i8 %mask, i32 4) ;
|
2014-11-26 18:46:49 +08:00
|
|
|
ret <2 x double> %res
|
|
|
|
}
|
|
|
|
|