blob: c6c0e2caee420f59f9324df2a4fe60bb625c5ecc [file] [log] [blame]
Saleem Abdulrasool72587352014-04-03 16:01:44 +00001; RUN: llc -mtriple=arm-eabi -mcpu=cortex-a8 %s -o - | FileCheck %s
Bob Wilson91fdf682010-05-22 00:23:12 +00002; Radar 7872877
3
Rafael Espindola29dda212010-06-17 15:18:27 +00004define void @test(float* %fltp, i32 %packedValue, float* %table) nounwind {
Bob Wilson91fdf682010-05-22 00:23:12 +00005entry:
David Blaikiea79ac142015-02-27 21:17:42 +00006 %0 = load float, float* %fltp
Bob Wilson91fdf682010-05-22 00:23:12 +00007 %1 = insertelement <4 x float> undef, float %0, i32 0
8 %2 = shufflevector <4 x float> %1, <4 x float> undef, <4 x i32> zeroinitializer
9 %3 = shl i32 %packedValue, 16
10 %4 = ashr i32 %3, 30
11 %.sum = add i32 %4, 4
David Blaikie79e6c742015-02-27 19:29:02 +000012 %5 = getelementptr inbounds float, float* %table, i32 %.sum
Jim Grosbach3e2c6f32011-11-14 23:03:21 +000013;CHECK: vldr s
David Blaikiea79ac142015-02-27 21:17:42 +000014 %6 = load float, float* %5, align 4
Bob Wilson91fdf682010-05-22 00:23:12 +000015 %tmp11 = insertelement <4 x float> undef, float %6, i32 0
16 %7 = shl i32 %packedValue, 18
17 %8 = ashr i32 %7, 30
18 %.sum12 = add i32 %8, 4
David Blaikie79e6c742015-02-27 19:29:02 +000019 %9 = getelementptr inbounds float, float* %table, i32 %.sum12
Jim Grosbach3e2c6f32011-11-14 23:03:21 +000020;CHECK: vldr s
David Blaikiea79ac142015-02-27 21:17:42 +000021 %10 = load float, float* %9, align 4
Bob Wilson91fdf682010-05-22 00:23:12 +000022 %tmp9 = insertelement <4 x float> %tmp11, float %10, i32 1
23 %11 = shl i32 %packedValue, 20
24 %12 = ashr i32 %11, 30
25 %.sum13 = add i32 %12, 4
David Blaikie79e6c742015-02-27 19:29:02 +000026 %13 = getelementptr inbounds float, float* %table, i32 %.sum13
Jim Grosbach3e2c6f32011-11-14 23:03:21 +000027;CHECK: vldr s
David Blaikiea79ac142015-02-27 21:17:42 +000028 %14 = load float, float* %13, align 4
Bob Wilson91fdf682010-05-22 00:23:12 +000029 %tmp7 = insertelement <4 x float> %tmp9, float %14, i32 2
30 %15 = shl i32 %packedValue, 22
31 %16 = ashr i32 %15, 30
32 %.sum14 = add i32 %16, 4
David Blaikie79e6c742015-02-27 19:29:02 +000033 %17 = getelementptr inbounds float, float* %table, i32 %.sum14
Jim Grosbach3e2c6f32011-11-14 23:03:21 +000034;CHECK: vldr s
David Blaikiea79ac142015-02-27 21:17:42 +000035 %18 = load float, float* %17, align 4
Bob Wilson91fdf682010-05-22 00:23:12 +000036 %tmp5 = insertelement <4 x float> %tmp7, float %18, i32 3
37 %19 = fmul <4 x float> %tmp5, %2
38 %20 = bitcast float* %fltp to i8*
Jeroen Ketemaab99b592015-09-30 10:56:37 +000039 tail call void @llvm.arm.neon.vst1.p0i8.v4f32(i8* %20, <4 x float> %19, i32 1)
Bob Wilson91fdf682010-05-22 00:23:12 +000040 ret void
41}
42
Jeroen Ketemaab99b592015-09-30 10:56:37 +000043declare void @llvm.arm.neon.vst1.p0i8.v4f32(i8*, <4 x float>, i32) nounwind