Skip to content

Commit 4ca0638

Browse files
authored
Merge pull request #2144 from sayantn/llvm-intrinsics
Correct some wrong uses of LLVM intrinsics
2 parents afc40bb + 5f21f96 commit 4ca0638

56 files changed

Lines changed: 315 additions & 254 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11903,7 +11903,7 @@ pub unsafe fn vluti4q_lane_s8<const LANE: i32>(a: int8x16_t, b: uint8x8_t) -> in
1190311903
unsafe extern "unadjusted" {
1190411904
#[cfg_attr(
1190511905
any(target_arch = "aarch64", target_arch = "arm64ec"),
11906-
link_name = "llvm.aarch64.neon.vluti4q.lane.v8i8"
11906+
link_name = "llvm.aarch64.neon.vluti4q.lane.v16i8"
1190711907
)]
1190811908
fn _vluti4q_lane_s8(a: int8x16_t, b: uint8x8_t, n: i32) -> int8x16_t;
1190911909
}

crates/core_arch/src/aarch64/prefetch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
use stdarch_test::assert_instr;
33

44
unsafe extern "unadjusted" {
5-
#[link_name = "llvm.prefetch"]
5+
#[link_name = "llvm.prefetch.p0"]
66
fn prefetch(p: *const i8, rw: i32, loc: i32, ty: i32);
77
}
88

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

Lines changed: 205 additions & 181 deletions
Large diffs are not rendered by default.

crates/core_arch/src/aarch64/sve/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ macro_rules! impl_internal_sve_predicate {
130130
#[target_feature(enable = "sve")]
131131
unsafe fn sve_into(self) -> svbool_t {
132132
#[allow(improper_ctypes)]
133-
unsafe extern "C" {
133+
unsafe extern "unadjusted" {
134134
#[cfg_attr(
135135
target_arch = "aarch64",
136136
link_name = concat!("llvm.aarch64.sve.convert.to.svbool.nxv", $elt, "i1")
@@ -147,7 +147,7 @@ macro_rules! impl_internal_sve_predicate {
147147
#[target_feature(enable = "sve")]
148148
unsafe fn sve_into(self) -> $name {
149149
#[allow(improper_ctypes)]
150-
unsafe extern "C" {
150+
unsafe extern "unadjusted" {
151151
#[cfg_attr(
152152
target_arch = "aarch64",
153153
link_name = concat!("llvm.aarch64.sve.convert.from.svbool.nxv", $elt, "i1")

crates/core_arch/src/mips/msa.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ types! {
4545
}
4646

4747
#[allow(improper_ctypes)]
48-
unsafe extern "C" {
48+
unsafe extern "unadjusted" {
4949
#[link_name = "llvm.mips.add.a.b"]
5050
fn msa_add_a_b(a: v16i8, b: v16i8) -> v16i8;
5151
#[link_name = "llvm.mips.add.a.h"]

crates/core_arch/src/nvptx/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ mod packed;
1919
pub use packed::*;
2020

2121
#[allow(improper_ctypes)]
22-
unsafe extern "C" {
23-
#[link_name = "llvm.nvvm.barrier0"]
24-
fn syncthreads() -> ();
22+
unsafe extern "unadjusted" {
23+
#[link_name = "llvm.nvvm.barrier.cta.sync.aligned.all"]
24+
fn syncthreads(a: u32) -> ();
2525
#[link_name = "llvm.nvvm.read.ptx.sreg.ntid.x"]
2626
fn block_dim_x() -> u32;
2727
#[link_name = "llvm.nvvm.read.ptx.sreg.ntid.y"]
@@ -54,7 +54,7 @@ unsafe extern "C" {
5454
#[inline]
5555
#[unstable(feature = "stdarch_nvptx", issue = "111199")]
5656
pub unsafe fn _syncthreads() -> () {
57-
syncthreads()
57+
syncthreads(0)
5858
}
5959

6060
/// x-th thread-block dimension.

crates/core_arch/src/nvptx/packed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use crate::intrinsics::simd::*;
88

99
#[allow(improper_ctypes)]
10-
unsafe extern "C" {
10+
unsafe extern "unadjusted" {
1111
#[link_name = "llvm.minimum.v2f16"]
1212
fn llvm_f16x2_minimum(a: f16x2, b: f16x2) -> f16x2;
1313
#[link_name = "llvm.maximum.v2f16"]

crates/core_arch/src/powerpc/altivec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl From<vector_bool_int> for m32x4 {
9696
}
9797

9898
#[allow(improper_ctypes)]
99-
unsafe extern "C" {
99+
unsafe extern "unadjusted" {
100100
#[link_name = "llvm.ppc.altivec.lvx"]
101101
fn lvx(p: *const i8) -> vector_unsigned_int;
102102

crates/core_arch/src/powerpc/vsx.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl From<vector_bool_long> for m64x2 {
5252
}
5353

5454
#[allow(improper_ctypes)]
55-
unsafe extern "C" {
55+
unsafe extern "unadjusted" {
5656
#[link_name = "llvm.ppc.altivec.vperm"]
5757
fn vperm(
5858
a: vector_signed_int,

crates/core_arch/src/powerpc64/vsx.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use stdarch_test::assert_instr;
1717
use crate::mem::transmute;
1818

1919
#[allow(improper_ctypes)]
20-
unsafe extern "C" {
20+
unsafe extern "unadjusted" {
2121
#[link_name = "llvm.ppc.vsx.lxvl"]
2222
fn lxvl(a: *const u8, l: usize) -> vector_signed_int;
2323

0 commit comments

Comments
 (0)