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

Side by Side Diff: tests_lit/reader_tests/nacl-other-intrinsics.ll

Issue 1022573004: Subzero: Add fabs intrinsic support. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 9 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 tests parsing NaCl intrinsics not related to atomic operations. 1 ; This tests parsing NaCl intrinsics not related to atomic operations.
2 2
3 ; RUN: %p2i -i %s --insts | FileCheck %s 3 ; RUN: %p2i -i %s --insts | FileCheck %s
4 ; RUN: %if --need=allow_disable_ir_gen --command \ 4 ; RUN: %if --need=allow_disable_ir_gen --command \
5 ; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \ 5 ; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
6 ; RUN: | %if --need=allow_disable_ir_gen --command \ 6 ; RUN: | %if --need=allow_disable_ir_gen --command \
7 ; RUN: FileCheck --check-prefix=NOIR %s 7 ; RUN: FileCheck --check-prefix=NOIR %s
8 8
9 declare i8* @llvm.nacl.read.tp() 9 declare i8* @llvm.nacl.read.tp()
10 declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) 10 declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)
11 declare void @llvm.memmove.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) 11 declare void @llvm.memmove.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)
12 declare void @llvm.memset.p0i8.i32(i8*, i8, i32, i32, i1) 12 declare void @llvm.memset.p0i8.i32(i8*, i8, i32, i32, i1)
13 declare void @llvm.nacl.longjmp(i8*, i32) 13 declare void @llvm.nacl.longjmp(i8*, i32)
14 declare i32 @llvm.nacl.setjmp(i8*) 14 declare i32 @llvm.nacl.setjmp(i8*)
15 declare float @llvm.sqrt.f32(float) 15 declare float @llvm.sqrt.f32(float)
16 declare double @llvm.sqrt.f64(double) 16 declare double @llvm.sqrt.f64(double)
17 declare float @llvm.fabs.f32(float)
18 declare double @llvm.fabs.f64(double)
19 declare <4 x float> @llvm.fabs.v4f32(<4 x float>)
17 declare void @llvm.trap() 20 declare void @llvm.trap()
18 declare i16 @llvm.bswap.i16(i16) 21 declare i16 @llvm.bswap.i16(i16)
19 declare i32 @llvm.bswap.i32(i32) 22 declare i32 @llvm.bswap.i32(i32)
20 declare i64 @llvm.bswap.i64(i64) 23 declare i64 @llvm.bswap.i64(i64)
21 declare i32 @llvm.ctlz.i32(i32, i1) 24 declare i32 @llvm.ctlz.i32(i32, i1)
22 declare i64 @llvm.ctlz.i64(i64, i1) 25 declare i64 @llvm.ctlz.i64(i64, i1)
23 declare i32 @llvm.cttz.i32(i32, i1) 26 declare i32 @llvm.cttz.i32(i32, i1)
24 declare i64 @llvm.cttz.i64(i64, i1) 27 declare i64 @llvm.cttz.i64(i64, i1)
25 declare i32 @llvm.ctpop.i32(i32) 28 declare i32 @llvm.ctpop.i32(i32)
26 declare i64 @llvm.ctpop.i64(i64) 29 declare i64 @llvm.ctpop.i64(i64)
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 145
143 ; CHECK-NEXT: define double @test_sqrt_double(double %x, i32 %iptr) { 146 ; CHECK-NEXT: define double @test_sqrt_double(double %x, i32 %iptr) {
144 ; CHECK-NEXT: entry: 147 ; CHECK-NEXT: entry:
145 ; CHECK-NEXT: %r = call double @llvm.sqrt.f64(double %x) 148 ; CHECK-NEXT: %r = call double @llvm.sqrt.f64(double %x)
146 ; CHECK-NEXT: %r2 = call double @llvm.sqrt.f64(double %r) 149 ; CHECK-NEXT: %r2 = call double @llvm.sqrt.f64(double %r)
147 ; CHECK-NEXT: %r3 = call double @llvm.sqrt.f64(double -0.000000e+00) 150 ; CHECK-NEXT: %r3 = call double @llvm.sqrt.f64(double -0.000000e+00)
148 ; CHECK-NEXT: %r4 = fadd double %r2, %r3 151 ; CHECK-NEXT: %r4 = fadd double %r2, %r3
149 ; CHECK-NEXT: ret double %r4 152 ; CHECK-NEXT: ret double %r4
150 ; CHECK-NEXT: } 153 ; CHECK-NEXT: }
151 154
155 define float @test_fabs_float(float %x, i32 %iptr) {
jvoung (off chromium) 2015/03/19 16:37:53 similar -- iptr not needed?
Jim Stichnoth 2015/03/19 18:35:15 Done.
156 entry:
157 %r = call float @llvm.fabs.f32(float %x)
158 %r2 = call float @llvm.fabs.f32(float %r)
159 %r3 = call float @llvm.fabs.f32(float -0.0)
160 %r4 = fadd float %r2, %r3
161 ret float %r4
162 }
163
164 ; CHECK-NEXT: define float @test_fabs_float(float %x, i32 %iptr) {
165 ; CHECK-NEXT: entry:
166 ; CHECK-NEXT: %r = call float @llvm.fabs.f32(float %x)
167 ; CHECK-NEXT: %r2 = call float @llvm.fabs.f32(float %r)
168 ; CHECK-NEXT: %r3 = call float @llvm.fabs.f32(float -0.000000e+00)
169 ; CHECK-NEXT: %r4 = fadd float %r2, %r3
170 ; CHECK-NEXT: ret float %r4
171 ; CHECK-NEXT: }
172
173 define double @test_fabs_double(double %x, i32 %iptr) {
174 entry:
175 %r = call double @llvm.fabs.f64(double %x)
176 %r2 = call double @llvm.fabs.f64(double %r)
177 %r3 = call double @llvm.fabs.f64(double -0.0)
178 %r4 = fadd double %r2, %r3
179 ret double %r4
180 }
181
182 ; CHECK-NEXT: define double @test_fabs_double(double %x, i32 %iptr) {
183 ; CHECK-NEXT: entry:
184 ; CHECK-NEXT: %r = call double @llvm.fabs.f64(double %x)
185 ; CHECK-NEXT: %r2 = call double @llvm.fabs.f64(double %r)
186 ; CHECK-NEXT: %r3 = call double @llvm.fabs.f64(double -0.000000e+00)
187 ; CHECK-NEXT: %r4 = fadd double %r2, %r3
188 ; CHECK-NEXT: ret double %r4
189 ; CHECK-NEXT: }
190
191 define <4 x float> @test_fabs_v4f32(<4 x float> %x, i32 %iptr) {
192 entry:
193 %r = call <4 x float> @llvm.fabs.v4f32(<4 x float> %x)
194 %r2 = call <4 x float> @llvm.fabs.v4f32(<4 x float> %r)
195 %r3 = call <4 x float> @llvm.fabs.v4f32(<4 x float> undef)
196 %r4 = fadd <4 x float> %r2, %r3
197 ret <4 x float> %r4
198 }
199
200 ; CHECK-NEXT: define <4 x float> @test_fabs_v4f32(<4 x float> %x, i32 %iptr) {
201 ; CHECK-NEXT: entry:
202 ; CHECK-NEXT: %r = call <4 x float> @llvm.fabs.v4f32(<4 x float> %x)
203 ; CHECK-NEXT: %r2 = call <4 x float> @llvm.fabs.v4f32(<4 x float> %r)
204 ; CHECK-NEXT: %r3 = call <4 x float> @llvm.fabs.v4f32(<4 x float> undef)
205 ; CHECK-NEXT: %r4 = fadd <4 x float> %r2, %r3
206 ; CHECK-NEXT: ret <4 x float> %r4
207 ; CHECK-NEXT: }
208
152 define i32 @test_trap(i32 %br) { 209 define i32 @test_trap(i32 %br) {
153 entry: 210 entry:
154 %r1 = icmp eq i32 %br, 0 211 %r1 = icmp eq i32 %br, 0
155 br i1 %r1, label %Zero, label %NonZero 212 br i1 %r1, label %Zero, label %NonZero
156 Zero: 213 Zero:
157 call void @llvm.trap() 214 call void @llvm.trap()
158 unreachable 215 unreachable
159 NonZero: 216 NonZero:
160 ret i32 1 217 ret i32 1
161 } 218 }
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 ; CHECK-NEXT: %sp3 = call i32 @llvm.stacksave() 394 ; CHECK-NEXT: %sp3 = call i32 @llvm.stacksave()
338 ; CHECK-NEXT: %tmp3 = alloca i8, i32 %x_4, align 4 395 ; CHECK-NEXT: %tmp3 = alloca i8, i32 %x_4, align 4
339 ; CHECK-NEXT: store i32 %y, i32* %tmp1, align 1 396 ; CHECK-NEXT: store i32 %y, i32* %tmp1, align 1
340 ; CHECK-NEXT: store i32 %x, i32* %tmp2, align 1 397 ; CHECK-NEXT: store i32 %x, i32* %tmp2, align 1
341 ; CHECK-NEXT: store i32 %x, i32* %tmp3, align 1 398 ; CHECK-NEXT: store i32 %x, i32* %tmp3, align 1
342 ; CHECK-NEXT: call void @llvm.stackrestore(i32 %sp1) 399 ; CHECK-NEXT: call void @llvm.stackrestore(i32 %sp1)
343 ; CHECK-NEXT: ret void 400 ; CHECK-NEXT: ret void
344 ; CHECK-NEXT: } 401 ; CHECK-NEXT: }
345 402
346 ; NOIR: Total across all functions 403 ; NOIR: Total across all functions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698