Venkatraman Govindaraju | 1799921 | 2013-06-08 15:32:59 +0000 | [diff] [blame] | 1 | ; RUN: llc -march=sparc < %s | FileCheck %s -check-prefix=V8 |
| 2 | ; RUN: llc -march=sparc -O0 < %s | FileCheck %s -check-prefix=V8-UNOPT |
| 3 | ; RUN: llc -march=sparc -mattr=v9 < %s | FileCheck %s -check-prefix=V9 |
| 4 | |
| 5 | |
Stephen Lin | b4dc023 | 2013-07-13 20:38:47 +0000 | [diff] [blame^] | 6 | ; V8-LABEL: test_neg: |
Venkatraman Govindaraju | 1799921 | 2013-06-08 15:32:59 +0000 | [diff] [blame] | 7 | ; V8: call get_double |
| 8 | ; V8: fnegs %f0, %f0 |
| 9 | |
| 10 | ; V8-UNOPT: test_neg: |
| 11 | ; V8-UNOPT: fnegs |
| 12 | ; V8-UNOPT: ! implicit-def |
| 13 | ; V8-UNOPT: fmovs {{.+}}, %f0 |
| 14 | ; V8-UNOPT: fmovs {{.+}}, %f1 |
| 15 | |
Stephen Lin | b4dc023 | 2013-07-13 20:38:47 +0000 | [diff] [blame^] | 16 | ; V9-LABEL: test_neg: |
Venkatraman Govindaraju | 1799921 | 2013-06-08 15:32:59 +0000 | [diff] [blame] | 17 | ; V9: fnegd %f0, %f0 |
| 18 | |
| 19 | define double @test_neg() { |
| 20 | entry: |
| 21 | %0 = tail call double @get_double() |
| 22 | %1 = fsub double -0.000000e+00, %0 |
| 23 | ret double %1 |
| 24 | } |
| 25 | |
Stephen Lin | b4dc023 | 2013-07-13 20:38:47 +0000 | [diff] [blame^] | 26 | ; V8-LABEL: test_abs: |
Venkatraman Govindaraju | 1799921 | 2013-06-08 15:32:59 +0000 | [diff] [blame] | 27 | ; V8: fabss %f0, %f0 |
| 28 | |
| 29 | ; V8-UNOPT: test_abs: |
| 30 | ; V8-UNOPT: fabss |
| 31 | ; V8-UNOPT: ! implicit-def |
| 32 | ; V8-UNOPT: fmovs {{.+}}, %f0 |
| 33 | ; V8-UNOPT: fmovs {{.+}}, %f1 |
| 34 | |
Stephen Lin | b4dc023 | 2013-07-13 20:38:47 +0000 | [diff] [blame^] | 35 | ; V9-LABEL: test_abs: |
Venkatraman Govindaraju | 1799921 | 2013-06-08 15:32:59 +0000 | [diff] [blame] | 36 | ; V9: fabsd %f0, %f0 |
| 37 | |
| 38 | define double @test_abs() { |
| 39 | entry: |
| 40 | %0 = tail call double @get_double() |
| 41 | %1 = tail call double @llvm.fabs.f64(double %0) |
| 42 | ret double %1 |
| 43 | } |
| 44 | |
| 45 | declare double @get_double() |
| 46 | declare double @llvm.fabs.f64(double) nounwind readonly |
| 47 | |