AArch64/ARM64: port more AArch64 tests to ARM64.
[oota-llvm.git] / test / CodeGen / AArch64 / neon-frsqrt-frecp.ll
1 ; RUN: llc < %s -verify-machineinstrs -mtriple=aarch64-none-linux-gnu -mattr=+neon  | FileCheck %s
2 ; arm64 has a duplicate for all these tests in vsqrt.ll
3
4 ; Set of tests for when the intrinsic is used.
5
6 declare <2 x float> @llvm.arm.neon.vrsqrts.v2f32(<2 x float>, <2 x float>)
7 declare <4 x float> @llvm.arm.neon.vrsqrts.v4f32(<4 x float>, <4 x float>)
8 declare <2 x double> @llvm.arm.neon.vrsqrts.v2f64(<2 x double>, <2 x double>)
9
10 define <2 x float> @frsqrts_from_intr_v2f32(<2 x float> %lhs, <2 x float> %rhs) {
11 ; Using registers other than v0, v1 are possible, but would be odd.
12 ; CHECK: frsqrts v0.2s, v0.2s, v1.2s
13         %val = call <2 x float> @llvm.arm.neon.vrsqrts.v2f32(<2 x float> %lhs, <2 x float> %rhs)
14         ret <2 x float> %val
15 }
16
17 define <4 x float> @frsqrts_from_intr_v4f32(<4 x float> %lhs, <4 x float> %rhs) {
18 ; Using registers other than v0, v1 are possible, but would be odd.
19 ; CHECK: frsqrts v0.4s, v0.4s, v1.4s
20         %val = call <4 x float> @llvm.arm.neon.vrsqrts.v4f32(<4 x float> %lhs, <4 x float> %rhs)
21         ret <4 x float> %val
22 }
23
24 define <2 x double> @frsqrts_from_intr_v2f64(<2 x double> %lhs, <2 x double> %rhs) {
25 ; Using registers other than v0, v1 are possible, but would be odd.
26 ; CHECK: frsqrts v0.2d, v0.2d, v1.2d
27         %val = call <2 x double> @llvm.arm.neon.vrsqrts.v2f64(<2 x double> %lhs, <2 x double> %rhs)
28         ret <2 x double> %val
29 }
30
31 declare <2 x float> @llvm.arm.neon.vrecps.v2f32(<2 x float>, <2 x float>)
32 declare <4 x float> @llvm.arm.neon.vrecps.v4f32(<4 x float>, <4 x float>)
33 declare <2 x double> @llvm.arm.neon.vrecps.v2f64(<2 x double>, <2 x double>)
34
35 define <2 x float> @frecps_from_intr_v2f32(<2 x float> %lhs, <2 x float> %rhs) {
36 ; Using registers other than v0, v1 are possible, but would be odd.
37 ; CHECK: frecps v0.2s, v0.2s, v1.2s
38         %val = call <2 x float> @llvm.arm.neon.vrecps.v2f32(<2 x float> %lhs, <2 x float> %rhs)
39         ret <2 x float> %val
40 }
41
42 define <4 x float> @frecps_from_intr_v4f32(<4 x float> %lhs, <4 x float> %rhs) {
43 ; Using registers other than v0, v1 are possible, but would be odd.
44 ; CHECK: frecps v0.4s, v0.4s, v1.4s
45         %val = call <4 x float> @llvm.arm.neon.vrecps.v4f32(<4 x float> %lhs, <4 x float> %rhs)
46         ret <4 x float> %val
47 }
48
49 define <2 x double> @frecps_from_intr_v2f64(<2 x double> %lhs, <2 x double> %rhs) {
50 ; Using registers other than v0, v1 are possible, but would be odd.
51 ; CHECK: frecps v0.2d, v0.2d, v1.2d
52         %val = call <2 x double> @llvm.arm.neon.vrecps.v2f64(<2 x double> %lhs, <2 x double> %rhs)
53         ret <2 x double> %val
54 }
55