diff options
Diffstat (limited to 'llvm/test/CodeGen')
-rwxr-xr-x | llvm/test/CodeGen/SPARC/LeonFillDataCachePassUT.ll | 27 | ||||
-rw-r--r-- | llvm/test/CodeGen/SPARC/LeonFixCALLPassUT.ll | 20 | ||||
-rwxr-xr-x | llvm/test/CodeGen/SPARC/LeonFixFSMULDPassUT.ll | 36 | ||||
-rwxr-xr-x | llvm/test/CodeGen/SPARC/LeonInsertNOPLoadPassUT.ll | 22 | ||||
-rwxr-xr-x | llvm/test/CodeGen/SPARC/LeonReplaceFMULSPassUT.ll | 24 |
5 files changed, 47 insertions, 82 deletions
diff --git a/llvm/test/CodeGen/SPARC/LeonFillDataCachePassUT.ll b/llvm/test/CodeGen/SPARC/LeonFillDataCachePassUT.ll new file mode 100755 index 00000000000..5461642110d --- /dev/null +++ b/llvm/test/CodeGen/SPARC/LeonFillDataCachePassUT.ll @@ -0,0 +1,27 @@ +; RUN: llc %s -O0 -march=sparc -mcpu=leon2 -mattr=+filldatacache -o - | FileCheck %s +; RUN: llc %s -O0 -march=sparc -mcpu=at697e -o - | FileCheck %s +; RUN: llc %s -O0 -march=sparc -mcpu=at697f -mattr=+filldatacache -o - | FileCheck %s + +; CHECK-LABEL: test_filldatacache_1 +; CHECK: or %g0, 1, %g1 +; CHECK: nop +; CHECK-NEXT: add %g1, 1, %g1 +; CHECK-NEXT: cmp %g1, 4096 +; CHECK-NEXT: ble {{.+}} +define zeroext i1@test_filldatacache_1(i1 zeroext %a, i1 zeroext %b) { + %1 = tail call zeroext i1 asm sideeffect "udivcc $0, $1, $2", "=r,r,r"(i1 zeroext %a, i1 zeroext %b) + + ret i1 %1 +} + + +; CHECK-LABEL: test_filldatacache_2 +; CHECK-NOT: or %g0, 1, %g1 +; CHECK-NOT: add %g1, 1, %g1 +; CHECK-NOT: cmp %g1, 4096 +; CHECK-NOT: ble {{.+}} +define zeroext i1@test_filldatacache_2(i1 zeroext %a, i1 zeroext %b) { + %1 = tail call zeroext i1 asm sideeffect "sdivcc $0, $1, $2", "=r,r,r"(i1 zeroext %a, i1 zeroext %b) + + ret i1 %1 +} diff --git a/llvm/test/CodeGen/SPARC/LeonFixCALLPassUT.ll b/llvm/test/CodeGen/SPARC/LeonFixCALLPassUT.ll deleted file mode 100644 index 697590be406..00000000000 --- a/llvm/test/CodeGen/SPARC/LeonFixCALLPassUT.ll +++ /dev/null @@ -1,20 +0,0 @@ -; RUN: llc %s -O0 -march=sparc -mcpu=at697e -o - | FileCheck %s -check-prefix=FIXCALL -; RUN: llc %s -O0 -march=sparc -mcpu=leon2 -mattr=+fixcall -o - | FileCheck %s -check-prefix=FIXCALL - -; RUN: llc %s -O0 -march=sparc -mcpu=at697e -mattr=-fixcall -o - | FileCheck %s -check-prefix=NO_FIXCALL -; RUN: llc %s -O0 -march=sparc -mcpu=leon2 -o - | FileCheck %s -check-prefix=NO_FIXCALL - - -; FIXCALL-LABEL: immediate_call_test -; FIXCALL: call 763288 - -; NO_FIXCALL-LABEL: immediate_call_test -; NO_FIXCALL: call 2047583640 -define void @immediate_call_test() nounwind { -entry: - call void asm sideeffect "call $0", "i"(i32 2047583640) nounwind - ret void -} - - - diff --git a/llvm/test/CodeGen/SPARC/LeonFixFSMULDPassUT.ll b/llvm/test/CodeGen/SPARC/LeonFixFSMULDPassUT.ll index e2f2323a049..a9fae8e50fc 100755 --- a/llvm/test/CodeGen/SPARC/LeonFixFSMULDPassUT.ll +++ b/llvm/test/CodeGen/SPARC/LeonFixFSMULDPassUT.ll @@ -1,31 +1,17 @@ -; RUN: llc %s -O0 -march=sparc -mcpu=ut699 -o - | FileCheck %s
+; RUN: llc %s -O0 -march=sparc -mattr=fixfsmuld -o - | FileCheck %s
+; RUN: llc %s -O0 -march=sparc -o - | FileCheck %s --check-prefix=NOFIX
; CHECK-LABEL: test_fix_fsmuld_1
-; CHECK: fstod %f20, %f2
-; CHECK: fstod %f21, %f3
-; CHECK: fmuld %f2, %f3, %f8
-; CHECK: fstod %f20, %f0
-define double @test_fix_fsmuld_1() {
+; CHECK: fstod %f1, %f2
+; CHECK: fstod %f0, %f4
+; CHECK: fmuld %f2, %f4, %f0
+; NOFIX-LABEL: test_fix_fsmuld_1
+; NOFIX: fsmuld %f1, %f0, %f0
+define double @test_fix_fsmuld_1(float %a, float %b) {
entry:
- %a = alloca float, align 4
- %b = alloca float, align 4
- store float 0x402ECCCCC0000000, float* %a, align 4
- store float 0x4022333340000000, float* %b, align 4
- %0 = load float, float* %b, align 4
- %1 = load float, float* %a, align 4
- %mul = tail call double asm sideeffect "fsmuld $0, $1, $2", "={f20},{f21},{f8}"(float* %a, float* %b)
-
- ret double %mul
-}
-
-; CHECK-LABEL: test_fix_fsmuld_2
-; CHECK: fstod %f20, %f2
-; CHECK: fstod %f21, %f3
-; CHECK: fmuld %f2, %f3, %f8
-; CHECK: fstod %f20, %f0
-define double @test_fix_fsmuld_2(float* %a, float* %b) {
-entry:
- %mul = tail call double asm sideeffect "fsmuld $0, $1, $2", "={f20},{f21},{f8}"(float* %a, float* %b)
+ %0 = fpext float %a to double
+ %1 = fpext float %b to double
+ %mul = fmul double %0, %1
ret double %mul
}
diff --git a/llvm/test/CodeGen/SPARC/LeonInsertNOPLoadPassUT.ll b/llvm/test/CodeGen/SPARC/LeonInsertNOPLoadPassUT.ll index 57ae16227e7..9b4ceb7ea6a 100755 --- a/llvm/test/CodeGen/SPARC/LeonInsertNOPLoadPassUT.ll +++ b/llvm/test/CodeGen/SPARC/LeonInsertNOPLoadPassUT.ll @@ -19,25 +19,3 @@ define i32 @ld_i32_test(i32 *%p) { %res = load i32, i32* %p ret i32 %res } - -; CHECK-LABEL: ld_inlineasm_test_1 -; CHECK: ld [%o0], %o0 -; CHECK-NEXT: !NO_APP -; CHECK-NEXT: nop -define float @ld_inlineasm_test_1(float* %a) { -entry: - %res = tail call float asm sideeffect "ld [$1], $0", "=r,r"(float* %a) - - ret float %res -} - -; CHECK-LABEL: ld_inlineasm_test_2 -; CHECK: ld [%o0], %o0 -; CHECK-NEXT: !NO_APP -; CHECK-NEXT: nop -define i32 @ld_inlineasm_test_2(i32* %a) { -entry: - %res = tail call i32 asm sideeffect "ld [$1], $0", "=r,r"(i32* %a) - - ret i32 %res -}
\ No newline at end of file diff --git a/llvm/test/CodeGen/SPARC/LeonReplaceFMULSPassUT.ll b/llvm/test/CodeGen/SPARC/LeonReplaceFMULSPassUT.ll index 7d0950cb1c8..e9ea7c6c999 100755 --- a/llvm/test/CodeGen/SPARC/LeonReplaceFMULSPassUT.ll +++ b/llvm/test/CodeGen/SPARC/LeonReplaceFMULSPassUT.ll @@ -1,19 +1,13 @@ -; RUN: llc %s -O0 -march=sparc -mcpu=ut699 -o - | FileCheck %s
+; RUN: llc %s -O0 -march=sparc -mattr=replacefmuls -o - | FileCheck %s
-; CHECK-LABEL: fmuls_fix_test
-; CHECK: fstod %f20, %f2
-; CHECK: fstod %f21, %f3
-; CHECK: fmuld %f2, %f3, %f8
-; CHECK: fstod %f20, %f0
-define double @fmuls_fix_test() {
+; CHECK-LABEL: test_replace_fmuls
+; CHECK: fsmuld %f1, %f0, %f2
+; CHECK: fdtos %f2, %f0
+; NOFIX-LABEL: test_replace_fmuls
+; NOFIX: fmuls %f1, %f0, %f0
+define float @test_replace_fmuls(float %a, float %b) {
entry:
- %a = alloca float, align 4
- %b = alloca float, align 4
- store float 0x402ECCCCC0000000, float* %a, align 4
- store float 0x4022333340000000, float* %b, align 4
- %0 = load float, float* %b, align 4
- %1 = load float, float* %a, align 4
- %mul = tail call double asm sideeffect "fmuls $0, $1, $2", "={f20},{f21},{f8}"(float* %a, float* %b)
+ %mul = fmul float %a, %b
- ret double %mul
+ ret float %mul
}
|