Skip to content

LLVM ERROR when test shift and insert methods in aarch64 #1017

Closed
@SparrowLii

Description

@SparrowLii

When I do the following test in crates/core_arch/src/arm/neon/shift_and_insert_tests.rs#L33 on my aarch64:

macro_rules! test_vsli {
    ($test_id:ident, $t:ty => $fn_id:ident ([$($a:expr),*], [$($b:expr),*], $n:expr)) => {
        #[simd_test(enable = "neon")]
        #[allow(unused_assignments)]
        unsafe fn $test_id() {
            let a = [$($a as $t),*];
            let b = [$($b as $t),*];
            let n_bit_mask: $t = (1 << $n) - 1;
            let e = [$(($a as $t & n_bit_mask) | ($b as $t << $n)),*];
            let r = $fn_id(transmute(a), transmute(b), $n);
            let mut d = e;
            d = transmute(r);
            assert_eq!(d, e);
        }
    }
}
test_vsli!(test_vsli_n_s8, i8 => vsli_n_s8([3, -44, 127, -56, 0, 24, -97, 10], [-128, -14, 125, -77, 27, 8, -1, 110], 5));

It has the following error:

LLVM ERROR: Cannot select: 0xffff800fb768: v8i8 = AArch64ISD::VSLI 0xffff800fb698, 0xffff80100118, 0xffff800fb5c8, crates/core_arch/src/aarch64/neon/mod.rs:2324:5
0xffff800fb698: v8i8,ch = load<(dereferenceable load 8 from %ir.1)> 0xffff80008188, 0xffff80100458, undef:i64, crates/core_arch/src/aarch64/neon/mod.rs:2324:16
0xffff80100458: i64,ch = CopyFromReg 0xffff80008188, Register:i64 %3, crates/core_arch/src/aarch64/neon/mod.rs:2324:16
0xffff800fff78: i64 = Register %3
0xffff801001e8: i64 = undef
0xffff80100118: v8i8,ch = load<(dereferenceable load 8 from %ir.2)> 0xffff80008188, 0xffff80100798, undef:i64, crates/core_arch/src/aarch64/neon/mod.rs:2324:19
0xffff80100798: i64,ch = CopyFromReg 0xffff80008188, Register:i64 %4, crates/core_arch/src/aarch64/neon/mod.rs:2324:19
0xffff80100180: i64 = Register %4
0xffff801001e8: i64 = undef
0xffff800fb5c8: i32,ch = load<(dereferenceable load 4 from %ir.10)> 0xffff80008188, FrameIndex:i64<5>, undef:i64, crates/core_arch/src/aarch64/neon/mod.rs:2324:22
0xffff800fb838: i64 = FrameIndex<5>
0xffff801001e8: i64 = undef
In function: _ZN9core_arch9core_arch7aarch644neon9vsli_n_s817ha2edb5572e851af2E
error: could not compile `core_arch`

The other methods in the test file will also have the same error. I am not sure if this is caused by llvm or something went wrong elsewhere

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions