[AArch64] Fix bug in prolog clobbering live reg when shrink wrapping.
[oota-llvm.git] / test / CodeGen / AArch64 / floatdp_2source.ll
1 ; RUN: llc -verify-machineinstrs -o - %s -mtriple=aarch64-linux-gnu -mcpu=cyclone | FileCheck %s
2
3 @varfloat = global float 0.0
4 @vardouble = global double 0.0
5
6 define void @testfloat() {
7 ; CHECK-LABEL: testfloat:
8   %val1 = load float, float* @varfloat
9
10   %val2 = fadd float %val1, %val1
11 ; CHECK: fadd {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
12
13   %val3 = fmul float %val2, %val1
14 ; CHECK: fmul {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
15
16   %val4 = fdiv float %val3, %val1
17 ; CHECK: fdiv {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
18
19   %val5 = fsub float %val4, %val2
20 ; CHECK: fsub {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
21
22   store volatile float %val5, float* @varfloat
23
24 ; These will be enabled with the implementation of floating-point litpool entries.
25   %val6 = fmul float %val1, %val2
26   %val7 = fsub float -0.0, %val6
27 ; CHECK: fnmul {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
28
29   store volatile float %val7, float* @varfloat
30
31   ret void
32 }
33
34 define void @testdouble() {
35 ; CHECK-LABEL: testdouble:
36   %val1 = load double, double* @vardouble
37
38   %val2 = fadd double %val1, %val1
39 ; CHECK: fadd {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
40
41   %val3 = fmul double %val2, %val1
42 ; CHECK: fmul {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
43
44   %val4 = fdiv double %val3, %val1
45 ; CHECK: fdiv {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
46
47   %val5 = fsub double %val4, %val2
48 ; CHECK: fsub {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
49
50   store volatile double %val5, double* @vardouble
51
52 ; These will be enabled with the implementation of doubleing-point litpool entries.
53    %val6 = fmul double %val1, %val2
54    %val7 = fsub double -0.0, %val6
55 ; CHECK: fnmul {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
56
57    store volatile double %val7, double* @vardouble
58
59   ret void
60 }