2013-12-18 17:58:06 +08:00
|
|
|
; RUN: llc < %s -march=arm -float-abi=soft -mcpu=cortex-a9 | FileCheck %s
|
2011-12-11 22:35:48 +08:00
|
|
|
|
|
|
|
@A = global <4 x float> <float 0., float 1., float 2., float 3.>
|
|
|
|
|
|
|
|
define void @test_sqrt(<4 x float>* %X) nounwind {
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; CHECK-LABEL: test_sqrt:
|
2011-12-11 22:35:48 +08:00
|
|
|
|
|
|
|
; CHECK: movw r1, :lower16:{{.*}}
|
|
|
|
; CHECK: movt r1, :upper16:{{.*}}
|
2013-02-22 18:01:33 +08:00
|
|
|
; CHECK: vld1.64 {{.*}}, [r1:128]
|
2011-12-27 06:49:32 +08:00
|
|
|
; CHECK: vsqrt.f32 {{s[0-9]+}}, {{s[0-9]+}}
|
|
|
|
; CHECK: vsqrt.f32 {{s[0-9]+}}, {{s[0-9]+}}
|
|
|
|
; CHECK: vsqrt.f32 {{s[0-9]+}}, {{s[0-9]+}}
|
|
|
|
; CHECK: vsqrt.f32 {{s[0-9]+}}, {{s[0-9]+}}
|
2012-09-18 09:42:45 +08:00
|
|
|
; CHECK: vst1.64 {{.*}}
|
2011-12-11 22:35:48 +08:00
|
|
|
|
|
|
|
L.entry:
|
|
|
|
%0 = load <4 x float>* @A, align 16
|
|
|
|
%1 = call <4 x float> @llvm.sqrt.v4f32(<4 x float> %0)
|
|
|
|
store <4 x float> %1, <4 x float>* %X, align 16
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <4 x float> @llvm.sqrt.v4f32(<4 x float>) nounwind readonly
|
|
|
|
|
|
|
|
|
|
|
|
define void @test_cos(<4 x float>* %X) nounwind {
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; CHECK-LABEL: test_cos:
|
2011-12-11 22:35:48 +08:00
|
|
|
|
|
|
|
; CHECK: movw [[reg0:r[0-9]+]], :lower16:{{.*}}
|
|
|
|
; CHECK: movt [[reg0]], :upper16:{{.*}}
|
2012-09-18 09:42:45 +08:00
|
|
|
; CHECK: vld1.64
|
2011-12-11 22:35:48 +08:00
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}cosf
|
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}cosf
|
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}cosf
|
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}cosf
|
|
|
|
|
2012-09-18 09:42:45 +08:00
|
|
|
; CHECK: vst1.64
|
2011-12-11 22:35:48 +08:00
|
|
|
|
|
|
|
L.entry:
|
|
|
|
%0 = load <4 x float>* @A, align 16
|
|
|
|
%1 = call <4 x float> @llvm.cos.v4f32(<4 x float> %0)
|
|
|
|
store <4 x float> %1, <4 x float>* %X, align 16
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <4 x float> @llvm.cos.v4f32(<4 x float>) nounwind readonly
|
|
|
|
|
|
|
|
define void @test_exp(<4 x float>* %X) nounwind {
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; CHECK-LABEL: test_exp:
|
2011-12-11 22:35:48 +08:00
|
|
|
|
|
|
|
; CHECK: movw [[reg0:r[0-9]+]], :lower16:{{.*}}
|
|
|
|
; CHECK: movt [[reg0]], :upper16:{{.*}}
|
2012-09-18 09:42:45 +08:00
|
|
|
; CHECK: vld1.64
|
2011-12-11 22:35:48 +08:00
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}expf
|
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}expf
|
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}expf
|
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}expf
|
|
|
|
|
2012-09-18 09:42:45 +08:00
|
|
|
; CHECK: vst1.64
|
2011-12-11 22:35:48 +08:00
|
|
|
|
|
|
|
L.entry:
|
|
|
|
%0 = load <4 x float>* @A, align 16
|
|
|
|
%1 = call <4 x float> @llvm.exp.v4f32(<4 x float> %0)
|
|
|
|
store <4 x float> %1, <4 x float>* %X, align 16
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <4 x float> @llvm.exp.v4f32(<4 x float>) nounwind readonly
|
|
|
|
|
|
|
|
define void @test_exp2(<4 x float>* %X) nounwind {
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; CHECK-LABEL: test_exp2:
|
2011-12-11 22:35:48 +08:00
|
|
|
|
|
|
|
; CHECK: movw [[reg0:r[0-9]+]], :lower16:{{.*}}
|
|
|
|
; CHECK: movt [[reg0]], :upper16:{{.*}}
|
2012-09-18 09:42:45 +08:00
|
|
|
; CHECK: vld1.64
|
2011-12-11 22:35:48 +08:00
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}exp2f
|
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}exp2f
|
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}exp2f
|
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}exp2f
|
|
|
|
|
2012-09-18 09:42:45 +08:00
|
|
|
; CHECK: vst1.64
|
2011-12-11 22:35:48 +08:00
|
|
|
|
|
|
|
L.entry:
|
|
|
|
%0 = load <4 x float>* @A, align 16
|
|
|
|
%1 = call <4 x float> @llvm.exp2.v4f32(<4 x float> %0)
|
|
|
|
store <4 x float> %1, <4 x float>* %X, align 16
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <4 x float> @llvm.exp2.v4f32(<4 x float>) nounwind readonly
|
|
|
|
|
|
|
|
define void @test_log10(<4 x float>* %X) nounwind {
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; CHECK-LABEL: test_log10:
|
2011-12-11 22:35:48 +08:00
|
|
|
|
|
|
|
; CHECK: movw [[reg0:r[0-9]+]], :lower16:{{.*}}
|
|
|
|
; CHECK: movt [[reg0]], :upper16:{{.*}}
|
2012-09-18 09:42:45 +08:00
|
|
|
; CHECK: vld1.64
|
2011-12-11 22:35:48 +08:00
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}log10f
|
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}log10f
|
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}log10f
|
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}log10f
|
|
|
|
|
2012-09-18 09:42:45 +08:00
|
|
|
; CHECK: vst1.64
|
2011-12-11 22:35:48 +08:00
|
|
|
|
|
|
|
L.entry:
|
|
|
|
%0 = load <4 x float>* @A, align 16
|
|
|
|
%1 = call <4 x float> @llvm.log10.v4f32(<4 x float> %0)
|
|
|
|
store <4 x float> %1, <4 x float>* %X, align 16
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <4 x float> @llvm.log10.v4f32(<4 x float>) nounwind readonly
|
|
|
|
|
|
|
|
define void @test_log(<4 x float>* %X) nounwind {
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; CHECK-LABEL: test_log:
|
2011-12-11 22:35:48 +08:00
|
|
|
|
|
|
|
; CHECK: movw [[reg0:r[0-9]+]], :lower16:{{.*}}
|
|
|
|
; CHECK: movt [[reg0]], :upper16:{{.*}}
|
2012-09-18 09:42:45 +08:00
|
|
|
; CHECK: vld1.64
|
2011-12-11 22:35:48 +08:00
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}logf
|
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}logf
|
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}logf
|
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}logf
|
|
|
|
|
2012-09-18 09:42:45 +08:00
|
|
|
; CHECK: vst1.64
|
2011-12-11 22:35:48 +08:00
|
|
|
|
|
|
|
L.entry:
|
|
|
|
%0 = load <4 x float>* @A, align 16
|
|
|
|
%1 = call <4 x float> @llvm.log.v4f32(<4 x float> %0)
|
|
|
|
store <4 x float> %1, <4 x float>* %X, align 16
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <4 x float> @llvm.log.v4f32(<4 x float>) nounwind readonly
|
|
|
|
|
|
|
|
define void @test_log2(<4 x float>* %X) nounwind {
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; CHECK-LABEL: test_log2:
|
2011-12-11 22:35:48 +08:00
|
|
|
|
|
|
|
; CHECK: movw [[reg0:r[0-9]+]], :lower16:{{.*}}
|
|
|
|
; CHECK: movt [[reg0]], :upper16:{{.*}}
|
2012-09-18 09:42:45 +08:00
|
|
|
; CHECK: vld1.64
|
2011-12-11 22:35:48 +08:00
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}log2f
|
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}log2f
|
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}log2f
|
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}log2f
|
|
|
|
|
2012-09-18 09:42:45 +08:00
|
|
|
; CHECK: vst1.64
|
2011-12-11 22:35:48 +08:00
|
|
|
|
|
|
|
L.entry:
|
|
|
|
%0 = load <4 x float>* @A, align 16
|
|
|
|
%1 = call <4 x float> @llvm.log2.v4f32(<4 x float> %0)
|
|
|
|
store <4 x float> %1, <4 x float>* %X, align 16
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <4 x float> @llvm.log2.v4f32(<4 x float>) nounwind readonly
|
|
|
|
|
|
|
|
|
|
|
|
define void @test_pow(<4 x float>* %X) nounwind {
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; CHECK-LABEL: test_pow:
|
2011-12-11 22:35:48 +08:00
|
|
|
|
|
|
|
; CHECK: movw [[reg0:r[0-9]+]], :lower16:{{.*}}
|
|
|
|
; CHECK: movt [[reg0]], :upper16:{{.*}}
|
2012-09-18 09:42:45 +08:00
|
|
|
; CHECK: vld1.64
|
2011-12-11 22:35:48 +08:00
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}powf
|
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}powf
|
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}powf
|
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}powf
|
|
|
|
|
2012-09-18 09:42:45 +08:00
|
|
|
; CHECK: vst1.64
|
2011-12-11 22:35:48 +08:00
|
|
|
|
|
|
|
L.entry:
|
|
|
|
|
|
|
|
%0 = load <4 x float>* @A, align 16
|
|
|
|
%1 = call <4 x float> @llvm.pow.v4f32(<4 x float> %0, <4 x float> <float 2., float 2., float 2., float 2.>)
|
|
|
|
|
|
|
|
store <4 x float> %1, <4 x float>* %X, align 16
|
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <4 x float> @llvm.pow.v4f32(<4 x float>, <4 x float>) nounwind readonly
|
|
|
|
|
|
|
|
define void @test_powi(<4 x float>* %X) nounwind {
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; CHECK-LABEL: test_powi:
|
2011-12-11 22:35:48 +08:00
|
|
|
|
|
|
|
; CHECK: movw [[reg0:r[0-9]+]], :lower16:{{.*}}
|
|
|
|
; CHECK: movt [[reg0]], :upper16:{{.*}}
|
2013-02-22 18:01:33 +08:00
|
|
|
; CHECK: vld1.64 {{.*}}:128
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: vmul.f32 {{.*}}
|
|
|
|
|
2012-09-18 09:42:45 +08:00
|
|
|
; CHECK: vst1.64
|
2011-12-11 22:35:48 +08:00
|
|
|
|
|
|
|
L.entry:
|
|
|
|
|
|
|
|
%0 = load <4 x float>* @A, align 16
|
|
|
|
%1 = call <4 x float> @llvm.powi.v4f32(<4 x float> %0, i32 2)
|
|
|
|
|
|
|
|
store <4 x float> %1, <4 x float>* %X, align 16
|
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <4 x float> @llvm.powi.v4f32(<4 x float>, i32) nounwind readonly
|
|
|
|
|
|
|
|
define void @test_sin(<4 x float>* %X) nounwind {
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; CHECK-LABEL: test_sin:
|
2011-12-11 22:35:48 +08:00
|
|
|
|
|
|
|
; CHECK: movw [[reg0:r[0-9]+]], :lower16:{{.*}}
|
|
|
|
; CHECK: movt [[reg0]], :upper16:{{.*}}
|
2012-09-18 09:42:45 +08:00
|
|
|
; CHECK: vld1.64
|
2011-12-11 22:35:48 +08:00
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}sinf
|
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}sinf
|
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}sinf
|
|
|
|
|
2012-08-21 20:43:03 +08:00
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
2011-12-11 22:35:48 +08:00
|
|
|
; CHECK: bl {{.*}}sinf
|
|
|
|
|
2012-09-18 09:42:45 +08:00
|
|
|
; CHECK: vst1.64
|
2011-12-11 22:35:48 +08:00
|
|
|
|
|
|
|
L.entry:
|
|
|
|
%0 = load <4 x float>* @A, align 16
|
|
|
|
%1 = call <4 x float> @llvm.sin.v4f32(<4 x float> %0)
|
|
|
|
store <4 x float> %1, <4 x float>* %X, align 16
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <4 x float> @llvm.sin.v4f32(<4 x float>) nounwind readonly
|
|
|
|
|
2012-09-08 12:58:43 +08:00
|
|
|
define void @test_floor(<4 x float>* %X) nounwind {
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; CHECK-LABEL: test_floor:
|
2012-09-08 12:58:43 +08:00
|
|
|
|
|
|
|
; CHECK: movw [[reg0:r[0-9]+]], :lower16:{{.*}}
|
|
|
|
; CHECK: movt [[reg0]], :upper16:{{.*}}
|
2012-09-18 09:42:45 +08:00
|
|
|
; CHECK: vld1.64
|
2012-09-08 12:58:43 +08:00
|
|
|
|
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
|
|
|
; CHECK: bl {{.*}}floorf
|
|
|
|
|
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
|
|
|
; CHECK: bl {{.*}}floorf
|
|
|
|
|
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
|
|
|
; CHECK: bl {{.*}}floorf
|
|
|
|
|
|
|
|
; CHECK: {{v?mov(.32)?}} r0,
|
|
|
|
; CHECK: bl {{.*}}floorf
|
|
|
|
|
2012-09-18 09:42:45 +08:00
|
|
|
; CHECK: vst1.64
|
2012-09-08 12:58:43 +08:00
|
|
|
|
|
|
|
L.entry:
|
|
|
|
%0 = load <4 x float>* @A, align 16
|
|
|
|
%1 = call <4 x float> @llvm.floor.v4f32(<4 x float> %0)
|
|
|
|
store <4 x float> %1, <4 x float>* %X, align 16
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <4 x float> @llvm.floor.v4f32(<4 x float>) nounwind readonly
|
|
|
|
|