Tim Northover | 3b0846e | 2014-05-24 12:50:23 +0000 | [diff] [blame] | 1 | ; RUN: llc -verify-machineinstrs -o - %s -mtriple=aarch64-linux-gnu -mcpu=cyclone | FileCheck %s |
Tim Northover | e0e3aef | 2013-01-31 12:12:40 +0000 | [diff] [blame] | 2 | |
| 3 | @varfloat = global float 0.0 |
| 4 | @vardouble = global double 0.0 |
| 5 | |
| 6 | define void @testfloat() { |
Stephen Lin | f799e3f | 2013-07-13 20:38:47 +0000 | [diff] [blame] | 7 | ; CHECK-LABEL: testfloat: |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 8 | %val1 = load float, float* @varfloat |
Tim Northover | e0e3aef | 2013-01-31 12:12:40 +0000 | [diff] [blame] | 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() { |
Stephen Lin | f799e3f | 2013-07-13 20:38:47 +0000 | [diff] [blame] | 35 | ; CHECK-LABEL: testdouble: |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 36 | %val1 = load double, double* @vardouble |
Tim Northover | e0e3aef | 2013-01-31 12:12:40 +0000 | [diff] [blame] | 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 | } |