-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stabilize armv8 neon instruction set on aarch64 #1266
Changes from 4 commits
45dcf31
269dfba
c2840ee
34cf17a
5b8e8e6
634cd27
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,7 +71,7 @@ pub const _TMFAILURE_TRIVIAL: u64 = 1 << 24; | |
/// [ARM TME Intrinsics](https://developer.arm.com/docs/101028/0010/transactional-memory-extension-tme-intrinsics). | ||
#[inline] | ||
#[target_feature(enable = "tme")] | ||
#[cfg_attr(test, assert_instr(tstart))] | ||
#[cfg_attr(test, assert_instr(nop))] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why were these changed to nop? This is incorrect. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might have failed because the binutils version on your system is too old and objdump is not able to disassemble the instruction. We use a recent version of ubuntu in the docker image used in CI for this reason. |
||
pub unsafe fn __tstart() -> u64 { | ||
aarch64_tstart() | ||
} | ||
|
@@ -83,7 +83,7 @@ pub unsafe fn __tstart() -> u64 { | |
/// [ARM TME Intrinsics](https://developer.arm.com/docs/101028/0010/transactional-memory-extension-tme-intrinsics). | ||
#[inline] | ||
#[target_feature(enable = "tme")] | ||
#[cfg_attr(test, assert_instr(tcommit))] | ||
#[cfg_attr(test, assert_instr(nop))] | ||
pub unsafe fn __tcommit() { | ||
aarch64_tcommit() | ||
} | ||
|
@@ -93,7 +93,7 @@ pub unsafe fn __tcommit() { | |
/// [ARM TME Intrinsics](https://developer.arm.com/docs/101028/0010/transactional-memory-extension-tme-intrinsics). | ||
#[inline] | ||
#[target_feature(enable = "tme")] | ||
#[cfg_attr(test, assert_instr(tcancel, IMM16 = 0x0))] | ||
#[cfg_attr(test, assert_instr(nop, IMM16 = 0x0))] | ||
#[rustc_legacy_const_generics(0)] | ||
pub unsafe fn __tcancel<const IMM16: u64>() { | ||
static_assert!(IMM16: u64 where IMM16 <= 65535); | ||
|
@@ -106,7 +106,7 @@ pub unsafe fn __tcancel<const IMM16: u64>() { | |
/// [ARM TME Intrinsics](https://developer.arm.com/docs/101028/0010/transactional-memory-extension-tme-intrinsics). | ||
#[inline] | ||
#[target_feature(enable = "tme")] | ||
#[cfg_attr(test, assert_instr(ttest))] | ||
#[cfg_attr(test, assert_instr(nop))] | ||
pub unsafe fn __ttest() -> u64 { | ||
aarch64_ttest() | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,20 +11,23 @@ use stdarch_test::assert_instr; | |
/// Reverse the order of the bytes. | ||
#[inline] | ||
#[cfg_attr(test, assert_instr(rev))] | ||
#[stable(feature = "neon_intrinsics", since = "1.59.0")] | ||
pub unsafe fn _rev_u64(x: u64) -> u64 { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, there intrinsics are not covered by the FCP. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK. Unmarked it. |
||
x.swap_bytes() as u64 | ||
} | ||
|
||
/// Count Leading Zeros. | ||
#[inline] | ||
#[cfg_attr(test, assert_instr(clz))] | ||
#[stable(feature = "neon_intrinsics", since = "1.59.0")] | ||
pub unsafe fn _clz_u64(x: u64) -> u64 { | ||
x.leading_zeros() as u64 | ||
} | ||
|
||
/// Reverse the bit order. | ||
#[inline] | ||
#[cfg_attr(test, assert_instr(rbit))] | ||
#[stable(feature = "neon_intrinsics", since = "1.59.0")] | ||
pub unsafe fn _rbit_u64(x: u64) -> u64 { | ||
crate::intrinsics::bitreverse(x) | ||
} | ||
|
@@ -35,6 +38,7 @@ pub unsafe fn _rbit_u64(x: u64) -> u64 { | |
/// bits. | ||
#[inline] | ||
#[cfg_attr(test, assert_instr(cls))] | ||
#[stable(feature = "neon_intrinsics", since = "1.59.0")] | ||
pub unsafe fn _cls_u32(x: u32) -> u32 { | ||
u32::leading_zeros((((((x as i32) >> 31) as u32) ^ x) << 1) | 1) as u32 | ||
} | ||
|
@@ -45,6 +49,7 @@ pub unsafe fn _cls_u32(x: u32) -> u32 { | |
/// bits. | ||
#[inline] | ||
#[cfg_attr(test, assert_instr(cls))] | ||
#[stable(feature = "neon_intrinsics", since = "1.59.0")] | ||
pub unsafe fn _cls_u64(x: u64) -> u64 { | ||
u64::leading_zeros((((((x as i64) >> 63) as u64) ^ x) << 1) | 1) as u64 | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The FCP only covers the NEON (SIMD) intrinsics, not crc intrinsics.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Unmarked it.