<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 - LLVM 13 Regression: AArch64 llvm.bswap.v2i16 incorrect code"
   href="https://bugs.llvm.org/show_bug.cgi?id=51707">51707</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLVM 13 Regression: AArch64 llvm.bswap.v2i16 incorrect code
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

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

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>release blocker
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>andrew@ziglang.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=25216" name="attach_25216" title="test.ll">attachment 25216</a> <a href="attachment.cgi?id=25216&action=edit" title="test.ll">[details]</a></span>
test.ll

To reproduce:

$HOME/local/llvm13-release/bin/clang-13 -static -o test test.ll  -target
aarch64-linux-musl -fuse-ld=$HOME/local/llvm13-release/bin/ld.lld -nostdlib
memcpy.c
qemu-aarch64 ./test
echo $? # prints 69, but 0 is expected


memcpy.c is produced here for convenience:
==============================
void *memcpy(void *restrict dest, const void *restrict src, unsigned long n) {
        unsigned char *d = dest;
        const unsigned char *s = src;
        for (; n; n--) *d++ = *s++;
        return dest;
}
==============================

This .ll file is derived from a failing zig behavior test case. Here is the
test case extracted for use with llvm-reduce, which produced test.ll in the
above reduction:
==============================
const std = @import("std");

pub fn main() noreturn {
    t(u16, 2, [_]u16{ 0x1234, 0x2345 }, [_]u16{ 0x3412, 0x4523 });
}

fn t(
    comptime I: type,
    comptime n: comptime_int,
    input: std.meta.Vector(n, I),
    expected_vector: std.meta.Vector(n, I),
) noreturn {
    const actual_output: [n]I = @byteSwap(I, input);
    const expected_output: [n]I = expected_vector;
    if (std.mem.eql(I, &actual_output, &expected_output)) {
        std.os.exit(0); // test passes
    }
    std.os.exit(69); // test failure
}
==============================

This is a regression from LLVM 12, where the above test case was passing.</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>