mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-10 02:36:06 +00:00
[X86][SSE] Added scalar conversion stack folding tests. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226404 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
341223ee0a
commit
2793dd7a29
@ -449,10 +449,26 @@ declare <8 x i16> @llvm.x86.vcvtps2ph.128(<4 x float>, i32) nounwind readonly
|
||||
; TODO stack_fold_cvtps2ph_ymm
|
||||
declare <8 x i16> @llvm.x86.vcvtps2ph.256(<8 x float>, i32) nounwind readonly
|
||||
|
||||
; TODO stack_fold_cvtsd2si (+ int)
|
||||
; TODO stack_fold_cvtsd2si
|
||||
|
||||
define i32 @stack_fold_cvtsd2si_int(<2 x double> %a0) {
|
||||
;CHECK-LABEL: stack_fold_cvtsd2si_int
|
||||
;CHECK: cvtsd2si {{-?[0-9]*}}(%rsp), %eax {{.*#+}} 16-byte Folded Reload
|
||||
%1 = tail call <4 x i64> asm sideeffect "nop", "=x,~{xmm1},~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{xmm12},~{xmm13},~{xmm14},~{xmm15},~{flags}"()
|
||||
%2 = call i32 @llvm.x86.sse2.cvtsd2si(<2 x double> %a0)
|
||||
ret i32 %2
|
||||
}
|
||||
declare i32 @llvm.x86.sse2.cvtsd2si(<2 x double>) nounwind readnone
|
||||
|
||||
; TODO stack_fold_cvtsd2si64 (+ int)
|
||||
; TODO stack_fold_cvtsd2si64
|
||||
|
||||
define i64 @stack_fold_cvtsd2si64_int(<2 x double> %a0) {
|
||||
;CHECK-LABEL: stack_fold_cvtsd2si64_int
|
||||
;CHECK: cvtsd2si {{-?[0-9]*}}(%rsp), %rax {{.*#+}} 16-byte Folded Reload
|
||||
%1 = tail call <4 x i64> asm sideeffect "nop", "=x,~{xmm1},~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{xmm12},~{xmm13},~{xmm14},~{xmm15},~{flags}"()
|
||||
%2 = call i64 @llvm.x86.sse2.cvtsd2si64(<2 x double> %a0)
|
||||
ret i64 %2
|
||||
}
|
||||
declare i64 @llvm.x86.sse2.cvtsd2si64(<2 x double>) nounwind readnone
|
||||
|
||||
; TODO stack_fold_cvtsd2ss
|
||||
@ -466,16 +482,72 @@ define <4 x float> @stack_fold_cvtsd2ss_int(<2 x double> %a0) {
|
||||
}
|
||||
declare <4 x float> @llvm.x86.sse2.cvtsd2ss(<4 x float>, <2 x double>) nounwind readnone
|
||||
|
||||
; TODO stack_fold_cvtsi2sd (+ int)
|
||||
define double @stack_fold_cvtsi2sd(i32 %a0) {
|
||||
;CHECK-LABEL: stack_fold_cvtsi2sd
|
||||
;CHECK: cvtsi2sdl {{-?[0-9]*}}(%rsp), {{%xmm[0-9][0-9]*}}, {{%xmm[0-9][0-9]*}} {{.*#+}} 4-byte Folded Reload
|
||||
%1 = tail call <4 x i64> asm sideeffect "nop", "=x,~{rax},~{rbx},~{rcx},~{rdx},~{rsi},~{rdi},~{rbp},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15}"()
|
||||
%2 = sitofp i32 %a0 to double
|
||||
ret double %2
|
||||
}
|
||||
|
||||
define <2 x double> @stack_fold_cvtsi2sd_int(i32 %a0) {
|
||||
;CHECK-LABEL: stack_fold_cvtsi2sd_int
|
||||
;CHECK: cvtsi2sdl {{-?[0-9]*}}(%rsp), {{%xmm[0-9][0-9]*}}, {{%xmm[0-9][0-9]*}} {{.*#+}} 4-byte Folded Reload
|
||||
%1 = tail call <4 x i64> asm sideeffect "nop", "=x,~{rax},~{rbx},~{rcx},~{rdx},~{rsi},~{rdi},~{rbp},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15}"()
|
||||
%2 = call <2 x double> @llvm.x86.sse2.cvtsi2sd(<2 x double> <double 0x0, double 0x0>, i32 %a0)
|
||||
ret <2 x double> %2
|
||||
}
|
||||
declare <2 x double> @llvm.x86.sse2.cvtsi2sd(<2 x double>, i32) nounwind readnone
|
||||
|
||||
; TODO stack_fold_cvtsi642sd (+ int)
|
||||
define double @stack_fold_cvtsi642sd(i64 %a0) {
|
||||
;CHECK-LABEL: stack_fold_cvtsi642sd
|
||||
;CHECK: cvtsi2sdq {{-?[0-9]*}}(%rsp), {{%xmm[0-9][0-9]*}}, {{%xmm[0-9][0-9]*}} {{.*#+}} 8-byte Folded Reload
|
||||
%1 = tail call <4 x i64> asm sideeffect "nop", "=x,~{rax},~{rbx},~{rcx},~{rdx},~{rsi},~{rdi},~{rbp},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15}"()
|
||||
%2 = sitofp i64 %a0 to double
|
||||
ret double %2
|
||||
}
|
||||
|
||||
define <2 x double> @stack_fold_cvtsi642sd_int(i64 %a0) {
|
||||
;CHECK-LABEL: stack_fold_cvtsi642sd_int
|
||||
;CHECK: cvtsi2sdq {{-?[0-9]*}}(%rsp), {{%xmm[0-9][0-9]*}}, {{%xmm[0-9][0-9]*}} {{.*#+}} 8-byte Folded Reload
|
||||
%1 = tail call <4 x i64> asm sideeffect "nop", "=x,~{rax},~{rbx},~{rcx},~{rdx},~{rsi},~{rdi},~{rbp},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15}"()
|
||||
%2 = call <2 x double> @llvm.x86.sse2.cvtsi642sd(<2 x double> <double 0x0, double 0x0>, i64 %a0)
|
||||
ret <2 x double> %2
|
||||
}
|
||||
declare <2 x double> @llvm.x86.sse2.cvtsi642sd(<2 x double>, i64) nounwind readnone
|
||||
|
||||
; TODO stack_fold_cvtsi2ss (+ int)
|
||||
define float @stack_fold_cvtsi2ss(i32 %a0) {
|
||||
;CHECK-LABEL: stack_fold_cvtsi2ss
|
||||
;CHECK: cvtsi2ssl {{-?[0-9]*}}(%rsp), {{%xmm[0-9][0-9]*}}, {{%xmm[0-9][0-9]*}} {{.*#+}} 4-byte Folded Reload
|
||||
%1 = tail call <4 x i64> asm sideeffect "nop", "=x,~{rax},~{rbx},~{rcx},~{rdx},~{rsi},~{rdi},~{rbp},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15}"()
|
||||
%2 = sitofp i32 %a0 to float
|
||||
ret float %2
|
||||
}
|
||||
|
||||
define <4 x float> @stack_fold_cvtsi2ss_int(i32 %a0) {
|
||||
;CHECK-LABEL: stack_fold_cvtsi2ss_int
|
||||
;CHECK: cvtsi2ssl {{-?[0-9]*}}(%rsp), {{%xmm[0-9][0-9]*}}, {{%xmm[0-9][0-9]*}} {{.*#+}} 4-byte Folded Reload
|
||||
%1 = tail call <4 x i64> asm sideeffect "nop", "=x,~{rax},~{rbx},~{rcx},~{rdx},~{rsi},~{rdi},~{rbp},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15}"()
|
||||
%2 = call <4 x float> @llvm.x86.sse.cvtsi2ss(<4 x float> <float 0x0, float 0x0, float 0x0, float 0x0>, i32 %a0)
|
||||
ret <4 x float> %2
|
||||
}
|
||||
declare <4 x float> @llvm.x86.sse.cvtsi2ss(<4 x float>, i32) nounwind readnone
|
||||
|
||||
; TODO stack_fold_cvtsi642ss (+ int)
|
||||
define float @stack_fold_cvtsi642ss(i64 %a0) {
|
||||
;CHECK-LABEL: stack_fold_cvtsi642ss
|
||||
;CHECK: cvtsi2ssq {{-?[0-9]*}}(%rsp), {{%xmm[0-9][0-9]*}}, {{%xmm[0-9][0-9]*}} {{.*#+}} 8-byte Folded Reload
|
||||
%1 = tail call <4 x i64> asm sideeffect "nop", "=x,~{rax},~{rbx},~{rcx},~{rdx},~{rsi},~{rdi},~{rbp},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15}"()
|
||||
%2 = sitofp i64 %a0 to float
|
||||
ret float %2
|
||||
}
|
||||
|
||||
define <4 x float> @stack_fold_cvtsi642ss_int(i64 %a0) {
|
||||
;CHECK-LABEL: stack_fold_cvtsi642ss_int
|
||||
;CHECK: cvtsi2ssq {{-?[0-9]*}}(%rsp), {{%xmm[0-9][0-9]*}}, {{%xmm[0-9][0-9]*}} {{.*#+}} 8-byte Folded Reload
|
||||
%1 = tail call <4 x i64> asm sideeffect "nop", "=x,~{rax},~{rbx},~{rcx},~{rdx},~{rsi},~{rdi},~{rbp},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15}"()
|
||||
%2 = call <4 x float> @llvm.x86.sse.cvtsi642ss(<4 x float> <float 0x0, float 0x0, float 0x0, float 0x0>, i64 %a0)
|
||||
ret <4 x float> %2
|
||||
}
|
||||
declare <4 x float> @llvm.x86.sse.cvtsi642ss(<4 x float>, i64) nounwind readnone
|
||||
|
||||
; TODO stack_fold_cvtss2sd
|
||||
@ -489,10 +561,26 @@ define <2 x double> @stack_fold_cvtss2sd_int(<4 x float> %a0) {
|
||||
}
|
||||
declare <2 x double> @llvm.x86.sse2.cvtss2sd(<2 x double>, <4 x float>) nounwind readnone
|
||||
|
||||
; TODO stack_fold_cvtss2si (+ int)
|
||||
; TODO stack_fold_cvtss2si
|
||||
|
||||
define i32 @stack_fold_cvtss2si_int(<4 x float> %a0) {
|
||||
;CHECK-LABEL: stack_fold_cvtss2si_int
|
||||
;CHECK: vcvtss2si {{-?[0-9]*}}(%rsp), %eax {{.*#+}} 16-byte Folded Reload
|
||||
%1 = tail call <4 x i64> asm sideeffect "nop", "=x,~{xmm1},~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{xmm12},~{xmm13},~{xmm14},~{xmm15},~{flags}"()
|
||||
%2 = call i32 @llvm.x86.sse.cvtss2si(<4 x float> %a0)
|
||||
ret i32 %2
|
||||
}
|
||||
declare i32 @llvm.x86.sse.cvtss2si(<4 x float>) nounwind readnone
|
||||
|
||||
; TODO stack_fold_cvtss2si64 (+ int)
|
||||
; TODO stack_fold_cvtss2si64
|
||||
|
||||
define i64 @stack_fold_cvtss2si64_int(<4 x float> %a0) {
|
||||
;CHECK-LABEL: stack_fold_cvtss2si64_int
|
||||
;CHECK: vcvtss2si {{-?[0-9]*}}(%rsp), %rax {{.*#+}} 16-byte Folded Reload
|
||||
%1 = tail call <4 x i64> asm sideeffect "nop", "=x,~{xmm1},~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{xmm12},~{xmm13},~{xmm14},~{xmm15},~{flags}"()
|
||||
%2 = call i64 @llvm.x86.sse.cvtss2si64(<4 x float> %a0)
|
||||
ret i64 %2
|
||||
}
|
||||
declare i64 @llvm.x86.sse.cvtss2si64(<4 x float>) nounwind readnone
|
||||
|
||||
; TODO stack_fold_cvttpd2dq
|
||||
@ -521,16 +609,72 @@ define <8 x i32> @stack_fold_cvttps2dq_ymm(<8 x float> %a0) {
|
||||
ret <8 x i32> %2
|
||||
}
|
||||
|
||||
; TODO stack_fold_cvttsd2si (+ int)
|
||||
define i32 @stack_fold_cvttsd2si(double %a0) {
|
||||
;CHECK-LABEL: stack_fold_cvttsd2si
|
||||
;CHECK: vcvttsd2si {{-?[0-9]*}}(%rsp), %eax {{.*#+}} 8-byte Folded Reload
|
||||
%1 = tail call <4 x i64> asm sideeffect "nop", "=x,~{xmm1},~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{xmm12},~{xmm13},~{xmm14},~{xmm15},~{flags}"()
|
||||
%2 = fptosi double %a0 to i32
|
||||
ret i32 %2
|
||||
}
|
||||
|
||||
define i32 @stack_fold_cvttsd2si_int(<2 x double> %a0) {
|
||||
;CHECK-LABEL: stack_fold_cvttsd2si_int
|
||||
;CHECK: vcvttsd2si {{-?[0-9]*}}(%rsp), %eax {{.*#+}} 16-byte Folded Reload
|
||||
%1 = tail call <4 x i64> asm sideeffect "nop", "=x,~{xmm1},~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{xmm12},~{xmm13},~{xmm14},~{xmm15},~{flags}"()
|
||||
%2 = call i32 @llvm.x86.sse2.cvttsd2si(<2 x double> %a0)
|
||||
ret i32 %2
|
||||
}
|
||||
declare i32 @llvm.x86.sse2.cvttsd2si(<2 x double>) nounwind readnone
|
||||
|
||||
; TODO stack_fold_cvttsd2si64 (+ int)
|
||||
define i64 @stack_fold_cvttsd2si64(double %a0) {
|
||||
;CHECK-LABEL: stack_fold_cvttsd2si64
|
||||
;CHECK: vcvttsd2si {{-?[0-9]*}}(%rsp), %rax {{.*#+}} 8-byte Folded Reload
|
||||
%1 = tail call <4 x i64> asm sideeffect "nop", "=x,~{xmm1},~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{xmm12},~{xmm13},~{xmm14},~{xmm15},~{flags}"()
|
||||
%2 = fptosi double %a0 to i64
|
||||
ret i64 %2
|
||||
}
|
||||
|
||||
define i64 @stack_fold_cvttsd2si64_int(<2 x double> %a0) {
|
||||
;CHECK-LABEL: stack_fold_cvttsd2si64_int
|
||||
;CHECK: vcvttsd2si {{-?[0-9]*}}(%rsp), %rax {{.*#+}} 16-byte Folded Reload
|
||||
%1 = tail call <4 x i64> asm sideeffect "nop", "=x,~{xmm1},~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{xmm12},~{xmm13},~{xmm14},~{xmm15},~{flags}"()
|
||||
%2 = call i64 @llvm.x86.sse2.cvttsd2si64(<2 x double> %a0)
|
||||
ret i64 %2
|
||||
}
|
||||
declare i64 @llvm.x86.sse2.cvttsd2si64(<2 x double>) nounwind readnone
|
||||
|
||||
; TODO stack_fold_cvttss2si (+ int)
|
||||
define i32 @stack_fold_cvttss2si(float %a0) {
|
||||
;CHECK-LABEL: stack_fold_cvttss2si
|
||||
;CHECK: vcvttss2si {{-?[0-9]*}}(%rsp), %eax {{.*#+}} 4-byte Folded Reload
|
||||
%1 = tail call <4 x i64> asm sideeffect "nop", "=x,~{xmm1},~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{xmm12},~{xmm13},~{xmm14},~{xmm15},~{flags}"()
|
||||
%2 = fptosi float %a0 to i32
|
||||
ret i32 %2
|
||||
}
|
||||
|
||||
define i32 @stack_fold_cvttss2si_int(<4 x float> %a0) {
|
||||
;CHECK-LABEL: stack_fold_cvttss2si_int
|
||||
;CHECK: vcvttss2si {{-?[0-9]*}}(%rsp), %eax {{.*#+}} 16-byte Folded Reload
|
||||
%1 = tail call <4 x i64> asm sideeffect "nop", "=x,~{xmm1},~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{xmm12},~{xmm13},~{xmm14},~{xmm15},~{flags}"()
|
||||
%2 = call i32 @llvm.x86.sse.cvttss2si(<4 x float> %a0)
|
||||
ret i32 %2
|
||||
}
|
||||
declare i32 @llvm.x86.sse.cvttss2si(<4 x float>) nounwind readnone
|
||||
|
||||
; TODO stack_fold_cvttss2si64 (+ int)
|
||||
define i64 @stack_fold_cvttss2si64(float %a0) {
|
||||
;CHECK-LABEL: stack_fold_cvttss2si64
|
||||
;CHECK: vcvttss2si {{-?[0-9]*}}(%rsp), %rax {{.*#+}} 4-byte Folded Reload
|
||||
%1 = tail call <4 x i64> asm sideeffect "nop", "=x,~{xmm1},~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{xmm12},~{xmm13},~{xmm14},~{xmm15},~{flags}"()
|
||||
%2 = fptosi float %a0 to i64
|
||||
ret i64 %2
|
||||
}
|
||||
|
||||
define i64 @stack_fold_cvttss2si64_int(<4 x float> %a0) {
|
||||
;CHECK-LABEL: stack_fold_cvttss2si64_int
|
||||
;CHECK: cvttss2si {{-?[0-9]*}}(%rsp), %rax {{.*#+}} 16-byte Folded Reload
|
||||
%1 = tail call <4 x i64> asm sideeffect "nop", "=x,~{xmm1},~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{xmm12},~{xmm13},~{xmm14},~{xmm15},~{flags}"()
|
||||
%2 = call i64 @llvm.x86.sse.cvttss2si64(<4 x float> %a0)
|
||||
ret i64 %2
|
||||
}
|
||||
declare i64 @llvm.x86.sse.cvttss2si64(<4 x float>) nounwind readnone
|
||||
|
||||
define <2 x double> @stack_fold_divpd(<2 x double> %a0, <2 x double> %a1) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user