Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(503)

Side by Side Diff: tests_lit/llvm2ice_tests/fp.load_store.ll

Issue 2301303003: [SubZero] Implement load and store for MIPS (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addressed review comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 ; This tries to be a comprehensive test of f32 and f64 compare operations. 1 ; This tries to be a comprehensive test of f32 and f64 compare operations.
2 ; The CHECK lines are only checking for basic instruction patterns 2 ; The CHECK lines are only checking for basic instruction patterns
3 ; that should be present regardless of the optimization level, so 3 ; that should be present regardless of the optimization level, so
4 ; there are no special OPTM1 match lines. 4 ; there are no special OPTM1 match lines.
5 5
6 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 | FileCheck %s 6 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 | FileCheck %s
7 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -Om1 | FileCheck %s 7 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -Om1 | FileCheck %s
8 8
9 ; RUN: %if --need=target_MIPS32 --need=allow_dump \
10 ; RUN: --command %p2i --filetype=asm --assemble \
11 ; RUN: --disassemble --target mips32 -i %s --args -Om1 --skip-unimplemented \
12 ; RUN: -allow-externally-defined-symbols \
13 ; RUN: | %if --need=target_MIPS32 --need=allow_dump \
14 ; RUN: --command FileCheck --check-prefix MIPS32 %s
15
9 define internal float @loadFloat(i32 %a) { 16 define internal float @loadFloat(i32 %a) {
10 entry: 17 entry:
11 %__1 = inttoptr i32 %a to float* 18 %__1 = inttoptr i32 %a to float*
12 %v0 = load float, float* %__1, align 4 19 %v0 = load float, float* %__1, align 4
13 ret float %v0 20 ret float %v0
14 } 21 }
15 ; CHECK-LABEL: loadFloat 22 ; CHECK-LABEL: loadFloat
16 ; CHECK: movss 23 ; CHECK: movss
17 ; CHECK: fld 24 ; CHECK: fld
18 25
26 ; MIPS32-LABEL: loadFloat
27 ; MIPS32: lwc1 $f{{.*}},0{{.*}}
28
19 define internal double @loadDouble(i32 %a) { 29 define internal double @loadDouble(i32 %a) {
20 entry: 30 entry:
21 %__1 = inttoptr i32 %a to double* 31 %__1 = inttoptr i32 %a to double*
22 %v0 = load double, double* %__1, align 8 32 %v0 = load double, double* %__1, align 8
23 ret double %v0 33 ret double %v0
24 } 34 }
25 ; CHECK-LABEL: loadDouble 35 ; CHECK-LABEL: loadDouble
26 ; CHECK: movsd 36 ; CHECK: movsd
27 ; CHECK: fld 37 ; CHECK: fld
28 38
39 ; MIPS32-LABEL: loadDouble
40 ; MIPS32: ldc1 $f{{.*}},0{{.*}}
41
29 define internal void @storeFloat(i32 %a, float %value) { 42 define internal void @storeFloat(i32 %a, float %value) {
30 entry: 43 entry:
31 %__2 = inttoptr i32 %a to float* 44 %__2 = inttoptr i32 %a to float*
32 store float %value, float* %__2, align 4 45 store float %value, float* %__2, align 4
33 ret void 46 ret void
34 } 47 }
35 ; CHECK-LABEL: storeFloat 48 ; CHECK-LABEL: storeFloat
36 ; CHECK: movss 49 ; CHECK: movss
37 ; CHECK: movss 50 ; CHECK: movss
38 51
52 ; MIPS32-LABEL: storeFloat
53 ; MIPS32: swc1 $f{{.*}},0{{.*}}
54
39 define internal void @storeDouble(i32 %a, double %value) { 55 define internal void @storeDouble(i32 %a, double %value) {
40 entry: 56 entry:
41 %__2 = inttoptr i32 %a to double* 57 %__2 = inttoptr i32 %a to double*
42 store double %value, double* %__2, align 8 58 store double %value, double* %__2, align 8
43 ret void 59 ret void
44 } 60 }
45 ; CHECK-LABEL: storeDouble 61 ; CHECK-LABEL: storeDouble
46 ; CHECK: movsd 62 ; CHECK: movsd
47 ; CHECK: movsd 63 ; CHECK: movsd
48 64
65 ; MIPS32-LABEL: storeDouble
66 ; MIPS32: ldc1 $f{{.*}},4{{.*}}
67 ; MIPS32: sdc1 $f{{.*}},0{{.*}}
68
49 define internal void @storeFloatConst(i32 %a) { 69 define internal void @storeFloatConst(i32 %a) {
50 entry: 70 entry:
51 %a.asptr = inttoptr i32 %a to float* 71 %a.asptr = inttoptr i32 %a to float*
52 store float 0x3FF3AE1480000000, float* %a.asptr, align 4 72 store float 0x3FF3AE1480000000, float* %a.asptr, align 4
53 ret void 73 ret void
54 } 74 }
55 ; CHECK-LABEL: storeFloatConst 75 ; CHECK-LABEL: storeFloatConst
56 ; CHECK: movss 76 ; CHECK: movss
57 ; CHECK: movss 77 ; CHECK: movss
58 78
79 ; MIPS32-LABEL: storeFloatConst
80 ; MIPS32: lui {{.*}},{{.*}}
81 ; MIPS32: lwc1 $f{{.*}},{{.*}}
82 ; MIPS32: swc1 $f{{.*}},0{{.*}}
83
59 define internal void @storeDoubleConst(i32 %a) { 84 define internal void @storeDoubleConst(i32 %a) {
60 entry: 85 entry:
61 %a.asptr = inttoptr i32 %a to double* 86 %a.asptr = inttoptr i32 %a to double*
62 store double 1.230000e+00, double* %a.asptr, align 8 87 store double 1.230000e+00, double* %a.asptr, align 8
63 ret void 88 ret void
64 } 89 }
65 ; CHECK-LABEL: storeDoubleConst 90 ; CHECK-LABEL: storeDoubleConst
66 ; CHECK: movsd 91 ; CHECK: movsd
67 ; CHECK: movsd 92 ; CHECK: movsd
93
94 ; MIPS32-LABEL: storeDoubleConst
95 ; MIPS32: lui {{.*}},{{.*}}
96 ; MIPS32: ldc1 $f{{.*}},{{.*}}
97 ; MIPS32: sdc1 $f{{.*}},0{{.*}}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698