1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

[x86] add tests for undef + partial undef constant folding; NFC

Keep this file sync'd with the instsimplify version (rL348045).

llvm-svn: 348047
This commit is contained in:
Sanjay Patel 2018-11-30 22:54:33 +00:00
parent 587e1894ae
commit 7dd0124529

View File

@ -505,3 +505,93 @@ define double @frem_undef_op1_fast_constant_inf(double %x) {
ret double %r
}
define <2 x double> @fadd_undef_op1_constant_vec(<2 x double> %x) {
; ANY-LABEL: fadd_undef_op1_constant_vec:
; ANY: # %bb.0:
; ANY-NEXT: movaps {{.*#+}} xmm0 = [NaN,NaN]
; ANY-NEXT: retq
%r = fadd <2 x double> <double 42.0, double undef>, undef
ret <2 x double> %r
}
define <2 x double> @fadd_undef_op0_constant_vec(<2 x double> %x) {
; ANY-LABEL: fadd_undef_op0_constant_vec:
; ANY: # %bb.0:
; ANY-NEXT: movaps {{.*#+}} xmm0 = [NaN,NaN]
; ANY-NEXT: retq
%r = fadd <2 x double> undef, <double undef, double 42.0>
ret <2 x double> %r
}
define <2 x double> @fsub_undef_op1_constant_vec(<2 x double> %x) {
; ANY-LABEL: fsub_undef_op1_constant_vec:
; ANY: # %bb.0:
; ANY-NEXT: movaps {{.*#+}} xmm0 = [NaN,NaN]
; ANY-NEXT: retq
%r = fsub <2 x double> <double undef, double 42.0>, undef
ret <2 x double> %r
}
define <2 x double> @fsub_undef_op0_constant_vec(<2 x double> %x) {
; ANY-LABEL: fsub_undef_op0_constant_vec:
; ANY: # %bb.0:
; ANY-NEXT: movaps {{.*#+}} xmm0 = [NaN,NaN]
; ANY-NEXT: retq
%r = fsub <2 x double> undef, <double 42.0, double undef>
ret <2 x double> %r
}
define <2 x double> @fmul_undef_op1_constant_vec(<2 x double> %x) {
; ANY-LABEL: fmul_undef_op1_constant_vec:
; ANY: # %bb.0:
; ANY-NEXT: movaps {{.*#+}} xmm0 = [NaN,NaN]
; ANY-NEXT: retq
%r = fmul <2 x double> <double 42.0, double undef>, undef
ret <2 x double> %r
}
define <2 x double> @fmul_undef_op0_constant_vec(<2 x double> %x) {
; ANY-LABEL: fmul_undef_op0_constant_vec:
; ANY: # %bb.0:
; ANY-NEXT: movaps {{.*#+}} xmm0 = [NaN,NaN]
; ANY-NEXT: retq
%r = fmul <2 x double> undef, <double undef, double 42.0>
ret <2 x double> %r
}
define <2 x double> @fdiv_undef_op1_constant_vec(<2 x double> %x) {
; ANY-LABEL: fdiv_undef_op1_constant_vec:
; ANY: # %bb.0:
; ANY-NEXT: movaps {{.*#+}} xmm0 = [NaN,NaN]
; ANY-NEXT: retq
%r = fdiv <2 x double> <double 42.0, double undef>, undef
ret <2 x double> %r
}
define <2 x double> @fdiv_undef_op0_constant_vec(<2 x double> %x) {
; ANY-LABEL: fdiv_undef_op0_constant_vec:
; ANY: # %bb.0:
; ANY-NEXT: movaps {{.*#+}} xmm0 = [NaN,NaN]
; ANY-NEXT: retq
%r = fdiv <2 x double> undef, <double undef, double 42.0>
ret <2 x double> %r
}
define <2 x double> @frem_undef_op1_constant_vec(<2 x double> %x) {
; ANY-LABEL: frem_undef_op1_constant_vec:
; ANY: # %bb.0:
; ANY-NEXT: movaps {{.*#+}} xmm0 = [NaN,NaN]
; ANY-NEXT: retq
%r = frem <2 x double> <double undef, double 42.0>, undef
ret <2 x double> %r
}
define <2 x double> @frem_undef_op0_constant_vec(<2 x double> %x) {
; ANY-LABEL: frem_undef_op0_constant_vec:
; ANY: # %bb.0:
; ANY-NEXT: movaps {{.*#+}} xmm0 = [NaN,NaN]
; ANY-NEXT: retq
%r = frem <2 x double> undef, <double 42.0, double undef>
ret <2 x double> %r
}