Sirish Pande | 7517bbc | 2012-05-10 20:20:25 +0000 | [diff] [blame] | 1 | ; RUN: llc -march=hexagon -mcpu=hexagonv5 < %s | FileCheck %s |
| 2 | ; Optimize fneg to togglebit in V5. |
| 3 | |
| 4 | define float @foo(float %x) nounwind { |
| 5 | entry: |
| 6 | ; CHECK: r{{[0-9]+}} = togglebit(r{{[0-9]+}}, #31) |
| 7 | %x.addr = alloca float, align 4 |
| 8 | store float %x, float* %x.addr, align 4 |
| 9 | %0 = load float* %x.addr, align 4 |
| 10 | %sub = fsub float -0.000000e+00, %0 |
| 11 | ret float %sub |
| 12 | } |
| 13 | |
| 14 | define float @bar(float %x) nounwind { |
| 15 | entry: |
| 16 | ; CHECK: r{{[0-9]+}} = togglebit(r{{[0-9]+}}, #31) |
| 17 | %sub = fsub float -0.000000e+00, %x |
| 18 | ret float %sub |
| 19 | } |
| 20 | |
| 21 | define float @baz(float %x) nounwind { |
| 22 | entry: |
| 23 | ; CHECK: r{{[0-9]+}} = togglebit(r{{[0-9]+}}, #31) |
| 24 | %conv1 = fmul float %x, -1.000000e+00 |
| 25 | ret float %conv1 |
| 26 | } |