Skip to content

Commit d4ea992

Browse files
JamesbarfordAmanieu
authored andcommitted
fix - aarch64_be tests
1 parent b2fae58 commit d4ea992

File tree

9 files changed

+19
-10
lines changed

9 files changed

+19
-10
lines changed

ci/docker/aarch64_be-unknown-linux-gnu/Dockerfile

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,8 @@ ENV AARCH64_BE_LIBC="${AARCH64_BE_TOOLCHAIN}/aarch64_be-none-linux-gnu/libc"
2626

2727
ENV CARGO_TARGET_AARCH64_BE_UNKNOWN_LINUX_GNU_LINKER="${AARCH64_BE_TOOLCHAIN}/bin/aarch64_be-none-linux-gnu-gcc"
2828
ENV CARGO_TARGET_AARCH64_BE_UNKNOWN_LINUX_GNU_RUNNER="qemu-aarch64_be -cpu max -L ${AARCH64_BE_LIBC}"
29-
ENV OBJDUMP="${AARCH64_BE_TOOLCHAIN}/bin/bin/aarch64-none-linux-gnu-objdump"
29+
ENV OBJDUMP="${AARCH64_BE_TOOLCHAIN}/bin/aarch64_be-none-linux-gnu-objdump"
3030
ENV STDARCH_TEST_SKIP_FEATURE=tme
31+
# The table instructions, while correct, generate some rev64 instructions which
32+
# increases the number of instructions generated
33+
ENV STDARCH_ASSERT_INSTR_LIMIT=32

ci/run-docker.sh

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ run() {
3636
--env NOSTD \
3737
--env NORUN \
3838
--env RUSTFLAGS \
39+
--env CARGO_UNSTABLE_BUILD_STD \
3940
--volume "${HOME}/.cargo":/cargo \
4041
--volume "$(rustc --print sysroot)":/rust:ro \
4142
--volume "$(pwd)":/checkout:ro \

ci/run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ case "${TARGET}" in
187187
--cppcompiler "${TEST_CXX_COMPILER}" \
188188
--skip "${TEST_SKIP_INTRINSICS}" \
189189
--target "${TARGET}" \
190-
--linker "${CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER}" \
190+
--linker "${CARGO_TARGET_AARCH64_BE_UNKNOWN_LINUX_GNU_LINKER}" \
191191
--cxx-toolchain-dir "${AARCH64_BE_TOOLCHAIN}"
192192
;;
193193
*)

crates/core_arch/src/aarch64/neon/generated.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -24470,7 +24470,7 @@ pub fn vrsrad_n_u64<const N: i32>(a: u64, b: u64) -> u64 {
2447024470
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrsubhn_high_s16)"]
2447124471
#[inline]
2447224472
#[target_feature(enable = "neon")]
24473-
#[cfg_attr(test, assert_instr(rsubhn2))]
24473+
#[cfg_attr(test, assert_instr(rsubhn))]
2447424474
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
2447524475
pub fn vrsubhn_high_s16(a: int8x8_t, b: int16x8_t, c: int16x8_t) -> int8x16_t {
2447624476
let x: int8x8_t = vrsubhn_s16(b, c);
@@ -24480,7 +24480,7 @@ pub fn vrsubhn_high_s16(a: int8x8_t, b: int16x8_t, c: int16x8_t) -> int8x16_t {
2448024480
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrsubhn_high_s32)"]
2448124481
#[inline]
2448224482
#[target_feature(enable = "neon")]
24483-
#[cfg_attr(test, assert_instr(rsubhn2))]
24483+
#[cfg_attr(test, assert_instr(rsubhn))]
2448424484
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
2448524485
pub fn vrsubhn_high_s32(a: int16x4_t, b: int32x4_t, c: int32x4_t) -> int16x8_t {
2448624486
let x: int16x4_t = vrsubhn_s32(b, c);
@@ -24490,7 +24490,7 @@ pub fn vrsubhn_high_s32(a: int16x4_t, b: int32x4_t, c: int32x4_t) -> int16x8_t {
2449024490
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrsubhn_high_s64)"]
2449124491
#[inline]
2449224492
#[target_feature(enable = "neon")]
24493-
#[cfg_attr(test, assert_instr(rsubhn2))]
24493+
#[cfg_attr(test, assert_instr(rsubhn))]
2449424494
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
2449524495
pub fn vrsubhn_high_s64(a: int32x2_t, b: int64x2_t, c: int64x2_t) -> int32x4_t {
2449624496
let x: int32x2_t = vrsubhn_s64(b, c);
@@ -24500,7 +24500,7 @@ pub fn vrsubhn_high_s64(a: int32x2_t, b: int64x2_t, c: int64x2_t) -> int32x4_t {
2450024500
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrsubhn_high_u16)"]
2450124501
#[inline]
2450224502
#[target_feature(enable = "neon")]
24503-
#[cfg_attr(test, assert_instr(rsubhn2))]
24503+
#[cfg_attr(test, assert_instr(rsubhn))]
2450424504
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
2450524505
pub fn vrsubhn_high_u16(a: uint8x8_t, b: uint16x8_t, c: uint16x8_t) -> uint8x16_t {
2450624506
let x: uint8x8_t = vrsubhn_u16(b, c);
@@ -24510,7 +24510,7 @@ pub fn vrsubhn_high_u16(a: uint8x8_t, b: uint16x8_t, c: uint16x8_t) -> uint8x16_
2451024510
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrsubhn_high_u32)"]
2451124511
#[inline]
2451224512
#[target_feature(enable = "neon")]
24513-
#[cfg_attr(test, assert_instr(rsubhn2))]
24513+
#[cfg_attr(test, assert_instr(rsubhn))]
2451424514
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
2451524515
pub fn vrsubhn_high_u32(a: uint16x4_t, b: uint32x4_t, c: uint32x4_t) -> uint16x8_t {
2451624516
let x: uint16x4_t = vrsubhn_u32(b, c);
@@ -24520,7 +24520,7 @@ pub fn vrsubhn_high_u32(a: uint16x4_t, b: uint32x4_t, c: uint32x4_t) -> uint16x8
2452024520
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrsubhn_high_u64)"]
2452124521
#[inline]
2452224522
#[target_feature(enable = "neon")]
24523-
#[cfg_attr(test, assert_instr(rsubhn2))]
24523+
#[cfg_attr(test, assert_instr(rsubhn))]
2452424524
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
2452524525
pub fn vrsubhn_high_u64(a: uint32x2_t, b: uint64x2_t, c: uint64x2_t) -> uint32x4_t {
2452624526
let x: uint32x2_t = vrsubhn_u64(b, c);

crates/core_arch/src/arm_shared/neon/table_lookup_tests.rs

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ macro_rules! test_vtbl {
1919
- table[$table_t:ident]: [$($table_v:expr),*] |
2020
$(- ctrl[$ctrl_t:ident]: [$($ctrl_v:expr),*] => [$($exp_v:expr),*])|*
2121
) => {
22+
#[cfg(target_endian = "little")]
2223
#[simd_test(enable = "neon")]
2324
unsafe fn $test_name() {
2425
// create table as array, and transmute it to
@@ -168,6 +169,7 @@ macro_rules! test_vtbx {
168169
- ext[$ext_t:ident]: [$($ext_v:expr),*] |
169170
$(- ctrl[$ctrl_t:ident]: [$($ctrl_v:expr),*] => [$($exp_v:expr),*])|*
170171
) => {
172+
#[cfg(target_endian = "little")]
171173
#[simd_test(enable = "neon")]
172174
unsafe fn $test_name() {
173175
// create table as array, and transmute it to

crates/simd-test-macro/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub fn simd_test(
5858
{
5959
"i686" | "x86_64" | "i586" => "is_x86_feature_detected",
6060
"arm" | "armv7" => "is_arm_feature_detected",
61-
"aarch64" | "arm64ec" => "is_aarch64_feature_detected",
61+
"aarch64" | "arm64ec" | "aarch64_be" => "is_aarch64_feature_detected",
6262
maybe_riscv if maybe_riscv.starts_with("riscv") => "is_riscv_feature_detected",
6363
"powerpc" | "powerpcle" => "is_powerpc_feature_detected",
6464
"powerpc64" | "powerpc64le" => "is_powerpc64_feature_detected",

crates/std_detect/src/detect/os/linux/aarch64.rs

+1
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@ impl AtHwcap {
399399
}
400400
}
401401

402+
#[cfg(target_endian = "little")]
402403
#[cfg(test)]
403404
mod tests {
404405
use super::*;

crates/std_detect/src/detect/os/linux/auxvec.rs

+2
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ mod tests {
290290
assert_eq!(v.hwcap2, 0);
291291
}
292292
} else if #[cfg(target_arch = "aarch64")] {
293+
#[cfg(target_endian = "little")]
293294
#[test]
294295
fn linux_artificial_aarch64() {
295296
let file = concat!(env!("CARGO_MANIFEST_DIR"), "/src/detect/test_data/linux-artificial-aarch64.auxv");
@@ -298,6 +299,7 @@ mod tests {
298299
assert_eq!(v.hwcap, 0x0123456789abcdef);
299300
assert_eq!(v.hwcap2, 0x02468ace13579bdf);
300301
}
302+
#[cfg(target_endian = "little")]
301303
#[test]
302304
fn linux_no_hwcap2_aarch64() {
303305
let file = concat!(env!("CARGO_MANIFEST_DIR"), "/src/detect/test_data/linux-no-hwcap2-aarch64.auxv");

crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8906,7 +8906,7 @@ intrinsics:
89068906
arguments: ["a: {neon_type[0]}", "b: {neon_type[1]}", "c: {neon_type[1]}"]
89078907
return_type: "{neon_type[3]}"
89088908
attr:
8909-
- FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [rsubhn2]]}]]
8909+
- FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [rsubhn]]}]]
89108910
- FnCall: [stable, ['feature = "neon_intrinsics"', 'since = "1.59.0"']]
89118911
safety: safe
89128912
types:

0 commit comments

Comments
 (0)