<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 - MOVS with shifted register incorrectly rejected for armv6-m"
   href="https://bugs.llvm.org/show_bug.cgi?id=44583">44583</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>MOVS with shifted register incorrectly rejected for armv6-m
          </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>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>john.brawn@arm.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>Doing

   echo "movs r0, r1, lsl #1" | llvm-mc --triple=armv6m-arm-none-eabi
--show-encoding

gets the error

  <stdin>:1:1: error: invalid instruction, any one of the following would fix
this:
  movs r0, r1, lsl #1
  ^
  <stdin>:1:14: note: operand must be an immediate in the range [0,255]
  movs r0, r1, lsl #1
             ^
  <stdin>:1:14: note: operand must be a register in range [r0, r7]
  movs r0, r1, lsl #1
             ^
The armv6-m armarm defines this instruction as an alias of lsls (in section
A6.7.41 MOV shifted register). When assembling for 7-M we do get the correct
encoding:

  echo "movs r0, r1, lsl #1" | llvm-mc --triple=armv7m-arm-none-eabi
--show-encoding

gives

        .text
        lsls    r0, r1, #1              @ encoding: [0x48,0x00]</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>