<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 --- - Worse diagnostics for NEON instructions"
   href="https://llvm.org/bugs/show_bug.cgi?id=24498">24498</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Worse diagnostics for NEON instructions
          </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>All
          </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: AArch64
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>petr.pavlu@arm.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>Commit r244955 [1] introduced worse error reporting in some cases.

New behaviour (using r245428):
$ echo "fabs.4s v0, v0" | llvm-mc -triple=aarch64 -mattr=-neon -show-encoding
        .text
<stdin>:1:1: error: too few operands for instruction
fabs.4s v0, v0
^

Previous behaviour (using r245428 but reverting r244955):
$ echo "fabs.4s v0, v0" | llvm-mc -triple=aarch64 -mattr=-neon -show-encoding
        .text
<stdin>:1:6: error: invalid type suffix for instruction
fabs.4s v0, v0
     ^

What happens is that the short-form NEON matching gives
`MatchResult = Match_MissingFeature' and `ErrorInfo = 0x8' (identifier of the
missing NEON feature). Then the long-form NEON matching gives
`MatchResult = Match_InvalidOperand' and `ErrorInfo = 1' (number of an invalid
operand). However, the new code in r244955 incorrectly mixes these two together
and creates `Match_InvalidOperand' and `ErrorInfo = 0x8'.

I think LLVM should report the 'instruction requires: ...' error for this
example. This could be achieved by moving the newly introduced rewrite code
before the `switch (MatchResult) {...}' code and fixing the rewrite so it also
uses `MatchResult' from the short-form matching.

[1]
<a href="http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150810/293460.html">http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150810/293460.html</a></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>