Commit 40fc8193 by Srdjan Obucina Committed by Jim Stichnoth

Subzero, MIPS32: nacl-other-intrinsics-mips merged to original file

With fix related to stack alignment bytes increasing, it is possible to return mips tests from nacl-other-intrinsics-mips to its original place. However, with existing vector test, O2 test had to be turned off. This does not affect anything imortant, because it only tested one case (test_sqrt_ignored). R=stichnot@chromium.org Review URL: https://codereview.chromium.org/2342083003 . Patch from Srdjan Obucina <Srdjan.Obucina@imgtec.com>.
parent 3e376471
; RUN: %if --need=target_MIPS32 --need=allow_dump \
; RUN: --command %p2i --filetype=asm --assemble --disassemble --target mips32\
; RUN: -i %s --args -Om1 --skip-unimplemented \
; RUN: -allow-externally-defined-symbols \
; RUN: | %if --need=target_MIPS32 --need=allow_dump \
; RUN: --command FileCheck --check-prefix MIPS32 %s
; RUN: %if --need=target_MIPS32 --need=allow_dump \
; RUN: --command %p2i --filetype=asm --assemble --disassemble --target mips32\
; RUN: -i %s --args -O2 --skip-unimplemented \
; RUN: -allow-externally-defined-symbols \
; RUN: | %if --need=target_MIPS32 --need=allow_dump \
; RUN: --command FileCheck --check-prefix MIPS32-O2 %s
declare float @llvm.sqrt.f32(float)
declare double @llvm.sqrt.f64(double)
declare float @llvm.fabs.f32(float)
declare double @llvm.fabs.f64(double)
define internal float @test_sqrt_float(float %x, i32 %iptr) {
entry:
%r = call float @llvm.sqrt.f32(float %x)
%r2 = call float @llvm.sqrt.f32(float %r)
%r3 = call float @llvm.sqrt.f32(float -0.0)
%r4 = fadd float %r2, %r3
ret float %r4
}
; MIPS32-LABEL: test_sqrt_float
; MIPS32: sqrt.s
; MIPS32: sqrt.s
; MIPS32: sqrt.s
; MIPS32: add.s
; MIPS32-O2-LABEL: test_sqrt_float
; MIPS32-O2: sqrt.s
; MIPS32-O2: sqrt.s
; MIPS32-O2: sqrt.s
; MIPS32-O2: add.s
define internal double @test_sqrt_double(double %x, i32 %iptr) {
entry:
%r = call double @llvm.sqrt.f64(double %x)
%r2 = call double @llvm.sqrt.f64(double %r)
%r3 = call double @llvm.sqrt.f64(double -0.0)
%r4 = fadd double %r2, %r3
ret double %r4
}
; MIPS32-LABEL: test_sqrt_double
; MIPS32: sqrt.d
; MIPS32: sqrt.d
; MIPS32: sqrt.d
; MIPS32: add.d
; MIPS32-O2-LABEL: test_sqrt_double
; MIPS32-O2: sqrt.d
; MIPS32-O2: sqrt.d
; MIPS32-O2: sqrt.d
; MIPS32-O2: add.d
define internal float @test_sqrt_ignored(float %x, double %y) {
entry:
%ignored1 = call float @llvm.sqrt.f32(float %x)
%ignored2 = call double @llvm.sqrt.f64(double %y)
ret float 0.0
}
; MIPS32-LABEL: test_sqrt_ignored
; MIPS32: sqrt.s
; MIPS32: sqrt.d
; MIPS32-O2-LABEL: test_sqrt_ignored
define internal float @test_fabs_float(float %x) {
entry:
%r = call float @llvm.fabs.f32(float %x)
%r2 = call float @llvm.fabs.f32(float %r)
%r3 = call float @llvm.fabs.f32(float -0.0)
%r4 = fadd float %r2, %r3
ret float %r4
}
; MIPS32-LABEL: test_fabs_float
; MIPS32: abs.s
; MIPS32: abs.s
; MIPS32: abs.s
; MIPS32: add.s
; MIPS32-O2-LABEL: test_fabs_float
; MIPS32-O2: abs.s
; MIPS32-O2: abs.s
; MIPS32-O2: abs.s
; MIPS32-O2: add.s
define internal double @test_fabs_double(double %x) {
entry:
%r = call double @llvm.fabs.f64(double %x)
%r2 = call double @llvm.fabs.f64(double %r)
%r3 = call double @llvm.fabs.f64(double -0.0)
%r4 = fadd double %r2, %r3
ret double %r4
}
; MIPS32-LABEL: test_fabs_double
; MIPS32: abs.d
; MIPS32: abs.d
; MIPS32: abs.d
; MIPS32: add.d
; MIPS32-O2-LABEL: test_fabs_double
; MIPS32-O2: abs.d
; MIPS32-O2: abs.d
; MIPS32-O2: abs.d
; MIPS32-O2: add.d
...@@ -144,6 +144,9 @@ NonZero: ...@@ -144,6 +144,9 @@ NonZero:
; ARM32-LABEL: test_setjmplongjmp ; ARM32-LABEL: test_setjmplongjmp
; ARM32: bl {{.*}} setjmp ; ARM32: bl {{.*}} setjmp
; ARM32: bl {{.*}} longjmp ; ARM32: bl {{.*}} longjmp
; MIPS32-LABEL: test_setjmplongjmp
; MIPS32: jal {{.*}} setjmp
; MIPS32: jal {{.*}} longjmp
define internal i32 @test_setjmp_unused(i32 %iptr_env, i32 %i_other) { define internal i32 @test_setjmp_unused(i32 %iptr_env, i32 %i_other) {
entry: entry:
...@@ -155,6 +158,8 @@ entry: ...@@ -155,6 +158,8 @@ entry:
; result unused. ; result unused.
; CHECKO2REM-LABEL: test_setjmp_unused ; CHECKO2REM-LABEL: test_setjmp_unused
; CHECKO2REM: call {{.*}} R_{{.*}} setjmp ; CHECKO2REM: call {{.*}} R_{{.*}} setjmp
; MIPS32-LABEL: test_setjmp_unused
; MIPS32: jal {{.*}} setjmp
define internal float @test_sqrt_float(float %x, i32 %iptr) { define internal float @test_sqrt_float(float %x, i32 %iptr) {
entry: entry:
...@@ -173,6 +178,11 @@ entry: ...@@ -173,6 +178,11 @@ entry:
; ARM32: vsqrt.f32 ; ARM32: vsqrt.f32
; ARM32: vsqrt.f32 ; ARM32: vsqrt.f32
; ARM32: vadd.f32 ; ARM32: vadd.f32
; MIPS32-LABEL: test_sqrt_float
; MIPS32: sqrt.s
; MIPS32: sqrt.s
; MIPS32: sqrt.s
; MIPS32: add.s
define internal float @test_sqrt_float_mergeable_load(float %x, i32 %iptr) { define internal float @test_sqrt_float_mergeable_load(float %x, i32 %iptr) {
entry: entry:
...@@ -208,6 +218,11 @@ entry: ...@@ -208,6 +218,11 @@ entry:
; ARM32: vsqrt.f64 ; ARM32: vsqrt.f64
; ARM32: vsqrt.f64 ; ARM32: vsqrt.f64
; ARM32: vadd.f64 ; ARM32: vadd.f64
; MIPS32-LABEL: test_sqrt_double
; MIPS32: sqrt.d
; MIPS32: sqrt.d
; MIPS32: sqrt.d
; MIPS32: add.d
define internal double @test_sqrt_double_mergeable_load(double %x, i32 %iptr) { define internal double @test_sqrt_double_mergeable_load(double %x, i32 %iptr) {
entry: entry:
...@@ -232,6 +247,9 @@ entry: ...@@ -232,6 +247,9 @@ entry:
; CHECKO2REM-LABEL: test_sqrt_ignored ; CHECKO2REM-LABEL: test_sqrt_ignored
; CHECKO2REM-NOT: sqrtss ; CHECKO2REM-NOT: sqrtss
; CHECKO2REM-NOT: sqrtsd ; CHECKO2REM-NOT: sqrtsd
; MIPS32-LABEL: test_sqrt_ignored
; MIPS32: sqrt.s
; MIPS32: sqrt.d
define internal float @test_fabs_float(float %x) { define internal float @test_fabs_float(float %x) {
entry: entry:
...@@ -253,6 +271,11 @@ entry: ...@@ -253,6 +271,11 @@ entry:
; CHECK: pcmpeqd ; CHECK: pcmpeqd
; CHECK: psrld ; CHECK: psrld
; CHECK: pand {{.*}}xmm{{.*}}xmm ; CHECK: pand {{.*}}xmm{{.*}}xmm
; MIPS32-LABEL: test_fabs_float
; MIPS32: abs.s
; MIPS32: abs.s
; MIPS32: abs.s
; MIPS32: add.s
define internal double @test_fabs_double(double %x) { define internal double @test_fabs_double(double %x) {
entry: entry:
...@@ -274,6 +297,11 @@ entry: ...@@ -274,6 +297,11 @@ entry:
; CHECK: pcmpeqd ; CHECK: pcmpeqd
; CHECK: psrlq ; CHECK: psrlq
; CHECK: pand {{.*}}xmm{{.*}}xmm ; CHECK: pand {{.*}}xmm{{.*}}xmm
; MIPS32-LABEL: test_fabs_double
; MIPS32: abs.d
; MIPS32: abs.d
; MIPS32: abs.d
; MIPS32: add.d
define internal <4 x float> @test_fabs_v4f32(<4 x float> %x) { define internal <4 x float> @test_fabs_v4f32(<4 x float> %x) {
entry: entry:
...@@ -485,6 +513,8 @@ entry: ...@@ -485,6 +513,8 @@ entry:
; CHECK: call {{.*}} R_{{.*}} __popcountsi2 ; CHECK: call {{.*}} R_{{.*}} __popcountsi2
; ARM32-LABEL: test_popcount_32 ; ARM32-LABEL: test_popcount_32
; ARM32: bl {{.*}} __popcountsi2 ; ARM32: bl {{.*}} __popcountsi2
; MIPS32-LABEL: test_popcount_32
; MIPS32: jal {{.*}} __popcountsi2
define internal i64 @test_popcount_64(i64 %x) { define internal i64 @test_popcount_64(i64 %x) {
entry: entry:
...@@ -499,6 +529,8 @@ entry: ...@@ -499,6 +529,8 @@ entry:
; ARM32-LABEL: test_popcount_64 ; ARM32-LABEL: test_popcount_64
; ARM32: bl {{.*}} __popcountdi2 ; ARM32: bl {{.*}} __popcountdi2
; ARM32: mov {{.*}}, #0 ; ARM32: mov {{.*}}, #0
; MIPS32-LABEL: test_popcount_64
; MIPS32: jal {{.*}} __popcountdi2
define internal i32 @test_popcount_64_ret_i32(i64 %x) { define internal i32 @test_popcount_64_ret_i32(i64 %x) {
entry: entry:
...@@ -510,6 +542,12 @@ entry: ...@@ -510,6 +542,12 @@ entry:
; CHECKO2REM-LABEL: test_popcount_64_ret_i32 ; CHECKO2REM-LABEL: test_popcount_64_ret_i32
; CHECKO2REM: call {{.*}} R_{{.*}} __popcountdi2 ; CHECKO2REM: call {{.*}} R_{{.*}} __popcountdi2
; CHECKO2REM-NOT: mov {{.*}}, 0 ; CHECKO2REM-NOT: mov {{.*}}, 0
; MIPS32-LABEL: test_popcount_64_ret_i32
; MIPS32: jal {{.*}} __popcountdi2
; MIPS32: sw v0,{{.*}}
; MIPS32: sw v1,{{.*}}
; MIPS32: lw v0,{{.*}}
; MIPS32: lw ra,{{.*}}
define internal void @test_stacksave_noalloca() { define internal void @test_stacksave_noalloca() {
entry: entry:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment