<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - 4.0 Regression in llvm.powi.f64 lowering on ARM"
   href="https://llvm.org/bugs/show_bug.cgi?id=30543">30543</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>4.0 Regression in llvm.powi.f64 lowering on ARM
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: ARM
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>yyc1992@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Compiling the following IR on arm

```
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
target triple = "armv7l-unknown-linux-gnueabihf"

@.str = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1

; Function Attrs: noinline norecurse nounwind readnone
define double @f(double, i32) #0 {
top:
  %2 = tail call double @llvm.powi.f64(double %0, i32 %1)
  ret double %2
}

; Function Attrs: nounwind readnone
declare double @llvm.powi.f64(double, i32)

; Function Attrs: nounwind
define i32 @main() {
  %1 = tail call double @f(double 2.000000e+00, i32 62)
  %2 = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8],
[4 x i8]* @.str, i32 0, i32 0), double %1)
  ret i32 0
}

; Function Attrs: nounwind
declare i32 @printf(i8* nocapture readonly, ...)

attributes #0 = { noinline }
```

prints 2.0 instead of what 2^62 should be.

This is a regression in llvm 4.0 and is causing a lot of test failures in
julia.

Difference in the assembly

```
-       .save   {r11, lr}
-       push    {r11, lr}
-       mov     r2, r0
-       vmov    r0, r1, d0
-       bl      __powidf2
-       vmov    d0, r0, r1
-       pop     {r11, pc}
+       b       __powidf2
```

GDB confirmed that the input value to `__powidf2` is wrong.

Currently bisecting.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>