forked from CyanogenMod/android_frameworks_compile_slang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrslib.ll
56 lines (48 loc) · 2.58 KB
/
rslib.ll
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
define <3 x float> @convert1_float3(<3 x i8> %u3) nounwind readnone {
%conv = uitofp <3 x i8> %u3 to <3 x float>
ret <3 x float> %conv
}
define <3 x i8> @convert1_uchar3(<3 x float> %f3) nounwind readnone {
%conv = fptoui <3 x float> %f3 to <3 x i8>
ret <3 x i8> %conv
}
declare float @llvm.powi.f32(float, i32) nounwind readonly
define <3 x float> @_Z4powiDv3_fi(<3 x float> %f3, i32 %exp) nounwind readnone {
%x = extractelement <3 x float> %f3, i32 0 ; <float> [#uses=1]
%y = extractelement <3 x float> %f3, i32 1 ; <float> [#uses=1]
%z = extractelement <3 x float> %f3, i32 2 ; <float> [#uses=1]
%retx = tail call float @llvm.powi.f32(float %x, i32 %exp) ; <float> [#uses=1]
%rety = tail call float @llvm.powi.f32(float %y, i32 %exp) ; <float> [#uses=1]
%retz = tail call float @llvm.powi.f32(float %z, i32 %exp) ; <float> [#uses=1]
%tmp1 = insertelement <3 x float> %f3, float %retx, i32 0 ; <<3 x float>> [#uses=1]
%tmp2 = insertelement <3 x float> %tmp1, float %rety, i32 1 ; <<3 x float>> [#uses=1]
%ret = insertelement <3 x float> %tmp2, float %retz, i32 2 ; <<3 x float>> [#uses=1]
ret <3 x float> %ret
}
declare float @llvm.pow.f32(float, float) nounwind readonly
define <3 x float> @_Z4pow3Dv3_ff(<3 x float> %f3, float %exp) nounwind readnone {
%x = extractelement <3 x float> %f3, i32 0 ; <float> [#uses=1]
%y = extractelement <3 x float> %f3, i32 1 ; <float> [#uses=1]
%z = extractelement <3 x float> %f3, i32 2 ; <float> [#uses=1]
%retx = tail call float @llvm.pow.f32(float %x, float %exp) ; <float> [#uses=1]
%rety = tail call float @llvm.pow.f32(float %y, float %exp) ; <float> [#uses=1]
%retz = tail call float @llvm.pow.f32(float %z, float %exp) ; <float> [#uses=1]
%tmp1 = insertelement <3 x float> %f3, float %retx, i32 0 ; <<3 x float>> [#uses=1]
%tmp2 = insertelement <3 x float> %tmp1, float %rety, i32 1 ; <<3 x float>> [#uses=1]
%ret = insertelement <3 x float> %tmp2, float %retz, i32 2 ; <<3 x float>> [#uses=1]
ret <3 x float> %ret
}
declare <4 x i32> @llvm.arm.neon.vmlals.v4i32(<4 x i32>, <4 x i16>, <4 x i16>)
define <4 x i32> @foo(<4 x i32> %a, <4 x i16> %b, <4 x i16> %c) {
%A = tail call <4 x i32> @llvm.arm.neon.vmlals.v4i32(<4 x i32> %a, <4 x i16> %b, <4 x i16> %c)
ret <4 x i32> %A
}
define i32 @test4() {
%ret4 = call <4 x i32> @foo(<4 x i32> undef, <4 x i16> undef, <4 x i16> undef)
%retx = extractelement <4 x i32> %ret4, i32 0
%rety = extractelement <4 x i32> %ret4, i32 1
%retz = extractelement <4 x i32> %ret4, i32 2
%ret1 = add i32 %retx, %rety
%ret2 = add i32 %ret1, %retz
ret i32 %ret2
}