<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - [ARM] llvm-objdump can't disassemble multiply instructions on pre-armv6"
   href="https://bugs.llvm.org/show_bug.cgi?id=43274">43274</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[ARM] llvm-objdump can't disassemble multiply instructions on pre-armv6
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>8.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

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

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </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>husseydevin@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, peter.smith@linaro.org, Ties.Stuij@arm.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Apparently, LLVM attempts to put an <unknown> if there is an illegal register
layout for the mul family of instructions on pre-ARMv6.

However, for whatever reason, instead, ALL mul instructions (even valid ones)
are disassembled as an <unknown>:

clang -O3 -c --target=arm-none-eabi -march=armv4t -fomit-frame-pointer mul.c

#include <stdint.h>

uint64_t mul(uint64_t a, uint64_t b)
{
    return a * b;
}

llvm-objdump -d mul.o

mul.o: file format ELF32-arm-little

Disassembly of section .text:
0000000000000000 mul:
       0:       10 40 2d e9     push    {r4, lr}
       4:       92 c0 8e e0  <unknown>
       8:       92 e1 24 e0  <unknown>
       c:       93 40 21 e0  <unknown>
      10:       0c 00 a0 e1     mov     r0, r12
      14:       10 40 bd e8     pop     {r4, lr}
      18:       1e ff 2f e1     bx      lr

arm-none-eabi-objdump -d mul.o

mul.o:     file format elf32-littlearm


Disassembly of section .text:

00000000 <mul>:
   0:   e92d4010        push    {r4, lr}
   4:   e08ec092        umull   ip, lr, r2, r0
   8:   e024e192        mla     r4, r2, r1, lr
   c:   e0214093        mla     r1, r3, r0, r4
  10:   e1a0000c        mov     r0, ip
  14:   e8bd4010        pop     {r4, lr}
  18:   e12fff1e        bx      lr

I can confirm that this occurs on MUL, UMULL, MLA, and UMLAL. I haven't tested
other variants. 

This does not occur if the binary targets ARMv6+. 

This was tested on Clang 8.0.1, but I presume it also affects trunk.</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>