xref: /aosp_15_r20/external/llvm/test/CodeGen/ARM/neon-spfp.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple armv7a-none-linux-gnueabihf -mcpu=cortex-a5 | FileCheck %s -check-prefix=CHECK-LINUXA5
2*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple armv7a-none-linux-gnueabihf -mcpu=cortex-a8 | FileCheck %s -check-prefix=CHECK-LINUXA8
3*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple armv7a-none-linux-gnueabihf -mcpu=cortex-a9 | FileCheck %s -check-prefix=CHECK-LINUXA9
4*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple armv7a-none-linux-gnueabihf -mcpu=cortex-a15 | FileCheck %s -check-prefix=CHECK-LINUXA15
5*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple armv7a-none-linux-gnueabihf -mcpu=swift | FileCheck %s -check-prefix=CHECK-LINUXSWIFT
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple armv7a-none-linux-gnueabihf -mcpu=cortex-a5 --enable-unsafe-fp-math | FileCheck %s -check-prefix=CHECK-UNSAFEA5
8*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple armv7a-none-linux-gnueabihf -mcpu=cortex-a8 --enable-unsafe-fp-math | FileCheck %s -check-prefix=CHECK-UNSAFEA8
9*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple armv7a-none-linux-gnueabihf -mcpu=cortex-a9 --enable-unsafe-fp-math | FileCheck %s -check-prefix=CHECK-UNSAFEA9
10*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple armv7a-none-linux-gnueabihf -mcpu=cortex-a15 --enable-unsafe-fp-math | FileCheck %s -check-prefix=CHECK-UNSAFEA15
11*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple armv7a-none-linux-gnueabihf -mcpu=swift --enable-unsafe-fp-math | FileCheck %s -check-prefix=CHECK-UNSAFESWIFT
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple armv7a-none-darwin -mcpu=cortex-a5 | FileCheck %s -check-prefix=CHECK-DARWINA5
14*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple armv7a-none-darwin -mcpu=cortex-a8 | FileCheck %s -check-prefix=CHECK-DARWINA8
15*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple armv7a-none-darwin -mcpu=cortex-a9 | FileCheck %s -check-prefix=CHECK-DARWINA9
16*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple armv7a-none-darwin -mcpu=cortex-a15 | FileCheck %s -check-prefix=CHECK-DARWINA15
17*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple armv7a-none-darwin -mcpu=swift | FileCheck %s -check-prefix=CHECK-DARWINSWIFT
18*9880d681SAndroid Build Coastguard Worker
19*9880d681SAndroid Build Coastguard Worker; This test makes sure we're not lowering VMUL.f32 D* (aka. NEON) for single-prec. FP ops, since
20*9880d681SAndroid Build Coastguard Worker; NEON is not fully IEEE 754 compliant, unless unsafe-math is selected.
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Worker@.str = private unnamed_addr constant [12 x i8] c"S317\09%.5g \0A\00", align 1
23*9880d681SAndroid Build Coastguard Worker
24*9880d681SAndroid Build Coastguard Worker; CHECK-LINUXA5-LABEL: main:
25*9880d681SAndroid Build Coastguard Worker; CHECK-LINUXA8-LABEL: main:
26*9880d681SAndroid Build Coastguard Worker; CHECK-LINUXA9-LABEL: main:
27*9880d681SAndroid Build Coastguard Worker; CHECK-LINUXA15-LABEL: main:
28*9880d681SAndroid Build Coastguard Worker; CHECK-LINUXSWIFT-LABEL: main:
29*9880d681SAndroid Build Coastguard Worker; CHECK-UNSAFEA5-LABEL: main:
30*9880d681SAndroid Build Coastguard Worker; CHECK-UNSAFEA8-LABEL: main:
31*9880d681SAndroid Build Coastguard Worker; CHECK-UNSAFEA9-LABEL: main:
32*9880d681SAndroid Build Coastguard Worker; CHECK-UNSAFEA15-LABEL: main:
33*9880d681SAndroid Build Coastguard Worker; CHECK-UNSAFESWIFT-LABEL: main:
34*9880d681SAndroid Build Coastguard Worker; CHECK-DARWINA5-LABEL: main:
35*9880d681SAndroid Build Coastguard Worker; CHECK-DARWINA8-LABEL: main:
36*9880d681SAndroid Build Coastguard Worker; CHECK-DARWINA9-LABEL: main:
37*9880d681SAndroid Build Coastguard Worker; CHECK-DARWINA15-LABEL: main:
38*9880d681SAndroid Build Coastguard Worker; CHECK-DARWINSWIFT-LABEL: main:
39*9880d681SAndroid Build Coastguard Workerdefine i32 @main() {
40*9880d681SAndroid Build Coastguard Workerentry:
41*9880d681SAndroid Build Coastguard Worker  br label %for.body
42*9880d681SAndroid Build Coastguard Worker
43*9880d681SAndroid Build Coastguard Workerfor.body:                                         ; preds = %for.body, %entry
44*9880d681SAndroid Build Coastguard Worker  %i.04 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
45*9880d681SAndroid Build Coastguard Worker  %q.03 = phi float [ 1.000000e+00, %entry ], [ %mul, %for.body ]
46*9880d681SAndroid Build Coastguard Worker  %mul = fmul float %q.03, 0x3FEFAE1480000000
47*9880d681SAndroid Build Coastguard Worker; CHECK-LINUXA5: vmul.f32 s{{[0-9]*}}
48*9880d681SAndroid Build Coastguard Worker; CHECK-LINUXA8: vmul.f32 s{{[0-9]*}}
49*9880d681SAndroid Build Coastguard Worker; CHECK-LINUXA9: vmul.f32 s{{[0-9]*}}
50*9880d681SAndroid Build Coastguard Worker; CHECK-LINUXA15: vmul.f32 s{{[0-9]*}}
51*9880d681SAndroid Build Coastguard Worker; Swift is *always* unsafe
52*9880d681SAndroid Build Coastguard Worker; CHECK-LINUXSWIFT: vmul.f32 d{{[0-9]*}}
53*9880d681SAndroid Build Coastguard Worker
54*9880d681SAndroid Build Coastguard Worker; CHECK-UNSAFEA5: vmul.f32 d{{[0-9]*}}
55*9880d681SAndroid Build Coastguard Worker; CHECK-UNSAFEA8: vmul.f32 d{{[0-9]*}}
56*9880d681SAndroid Build Coastguard Worker; A9 and A15 don't need this
57*9880d681SAndroid Build Coastguard Worker; CHECK-UNSAFEA9: vmul.f32 s{{[0-9]*}}
58*9880d681SAndroid Build Coastguard Worker; CHECK-UNSAFEA15: vmul.f32 s{{[0-9]*}}
59*9880d681SAndroid Build Coastguard Worker; CHECK-UNSAFESWIFT: vmul.f32 d{{[0-9]*}}
60*9880d681SAndroid Build Coastguard Worker
61*9880d681SAndroid Build Coastguard Worker; CHECK-DARWINA5: vmul.f32 d{{[0-9]*}}
62*9880d681SAndroid Build Coastguard Worker; CHECK-DARWINA8: vmul.f32 d{{[0-9]*}}
63*9880d681SAndroid Build Coastguard Worker; CHECK-DARWINA9: vmul.f32 s{{[0-9]*}}
64*9880d681SAndroid Build Coastguard Worker; CHECK-DARWINA15: vmul.f32 s{{[0-9]*}}
65*9880d681SAndroid Build Coastguard Worker; CHECK-DARWINSWIFT: vmul.f32 d{{[0-9]*}}
66*9880d681SAndroid Build Coastguard Worker  %conv = fpext float %mul to double
67*9880d681SAndroid Build Coastguard Worker  %call = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i32 0), double %conv) #1
68*9880d681SAndroid Build Coastguard Worker  %inc = add nsw i32 %i.04, 1
69*9880d681SAndroid Build Coastguard Worker  %exitcond = icmp eq i32 %inc, 16000
70*9880d681SAndroid Build Coastguard Worker  br i1 %exitcond, label %for.end, label %for.body
71*9880d681SAndroid Build Coastguard Worker
72*9880d681SAndroid Build Coastguard Workerfor.end:                                          ; preds = %for.body
73*9880d681SAndroid Build Coastguard Worker  ret i32 0
74*9880d681SAndroid Build Coastguard Worker}
75*9880d681SAndroid Build Coastguard Worker
76*9880d681SAndroid Build Coastguard Workerdeclare i32 @printf(i8* nocapture, ...)
77