Skip to content

Commit e480e1f

Browse files
committed
Forgot to add the stubs
Signed-off-by: Hanif Ariffin <hanif.ariffin.4326@gmail.com>
1 parent 2ef7858 commit e480e1f

File tree

4 files changed

+46
-47
lines changed

4 files changed

+46
-47
lines changed

tests/assembly/rust-abi-arg-attr.rs

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ add-core-stubs
12
//@ assembly-output: emit-asm
23
//@ revisions: riscv64 riscv64-zbb loongarch64
34
//@ compile-flags: -C opt-level=3
@@ -14,46 +15,8 @@
1415
#![no_std]
1516
#![no_core]
1617

17-
// FIXME: Migrate these code after PR #130693 is landed.
18-
// vvvvv core
19-
20-
#[lang = "sized"]
21-
trait Sized {}
22-
23-
#[lang = "copy"]
24-
trait Copy {}
25-
26-
impl Copy for i8 {}
27-
impl Copy for u32 {}
28-
impl Copy for i32 {}
29-
30-
#[lang = "neg"]
31-
trait Neg {
32-
type Output;
33-
34-
fn neg(self) -> Self::Output;
35-
}
36-
37-
impl Neg for i8 {
38-
type Output = i8;
39-
40-
fn neg(self) -> Self::Output {
41-
-self
42-
}
43-
}
44-
45-
#[lang = "Ordering"]
46-
#[repr(i8)]
47-
enum Ordering {
48-
Less = -1,
49-
Equal = 0,
50-
Greater = 1,
51-
}
52-
53-
#[rustc_intrinsic]
54-
fn three_way_compare<T: Copy>(lhs: T, rhs: T) -> Ordering;
55-
56-
// ^^^^^ core
18+
extern crate minicore;
19+
use minicore::*;
5720

5821
// Reimplementation of function `{integer}::max`.
5922
macro_rules! max {

tests/assembly/simd-intrinsic-gather.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ pub struct m64x4([i64; 4]);
2222
#[repr(simd)]
2323
pub struct pf64x4([*const f64; 4]);
2424

25-
#[rustc_intrinsic]
26-
unsafe fn simd_gather<V, M, P>(values: V, mask: M, pointer: P) -> V;
27-
2825
// CHECK-LABEL: gather_f64x4
2926
#[no_mangle]
3027
pub unsafe extern "C" fn gather_f64x4(mask: m64x4, ptrs: pf64x4) -> f64x4 {

tests/assembly/simd-intrinsic-mask-load.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ pub struct f64x4([f64; 4]);
3434
#[repr(simd)]
3535
pub struct m64x4([i64; 4]);
3636

37-
#[rustc_intrinsic]
38-
unsafe fn simd_masked_load<M, P, T>(mask: M, pointer: P, values: T) -> T;
39-
4037
// CHECK-LABEL: load_i8x16
4138
#[no_mangle]
4239
pub unsafe extern "C" fn load_i8x16(mask: m8x16, pointer: *const i8) -> i8x16 {

tests/auxiliary/minicore.rs

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
f16,
2727
f128,
2828
asm_experimental_arch,
29-
unboxed_closures
29+
unboxed_closures,
30+
intrinsics
3031
)]
3132
#![allow(unused, improper_ctypes_definitions, internal_features)]
3233
#![no_std]
@@ -191,3 +192,44 @@ impl<'a, 'b: 'a, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<&'a U> for &'b
191192
trait Drop {
192193
fn drop(&mut self);
193194
}
195+
196+
#[lang = "neg"]
197+
trait Neg: Sized {
198+
type Output;
199+
200+
fn neg(self) -> Self::Output;
201+
}
202+
203+
// Macro to implement Neg for a list of primitive numeric types
204+
macro_rules! impl_neg_trait {
205+
( $($ty:ty),* $(,)? ) => {
206+
$(
207+
impl Neg for $ty {
208+
type Output = $ty;
209+
210+
fn neg(self) -> Self::Output {
211+
-self
212+
}
213+
}
214+
)*
215+
}
216+
}
217+
218+
impl_neg_trait!(isize, i8, i16, i32, i64, i128,);
219+
220+
#[lang = "Ordering"]
221+
#[repr(i8)]
222+
pub enum Ordering {
223+
Less = -1,
224+
Equal = 0,
225+
Greater = 1,
226+
}
227+
228+
#[rustc_intrinsic]
229+
pub fn three_way_compare<T: Copy>(lhs: T, rhs: T) -> Ordering;
230+
231+
#[rustc_intrinsic]
232+
pub unsafe fn simd_gather<V, M, P>(values: V, mask: M, pointer: P) -> V;
233+
234+
#[rustc_intrinsic]
235+
pub unsafe fn simd_masked_load<M, P, T>(mask: M, pointer: P, values: T) -> T;

0 commit comments

Comments
 (0)