Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 2 additions & 45 deletions tests/assembly-llvm/asm/aarch64-types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,60 +7,17 @@
//@ [arm64ec] needs-llvm-components: aarch64
//@ compile-flags: -Zmerge-functions=disabled

#![feature(no_core, repr_simd, f16, f128)]
#![feature(no_core, f16, f128)]
#![crate_type = "rlib"]
#![no_core]
#![allow(asm_sub_register, non_camel_case_types)]

extern crate minicore;
use minicore::simd::*;
use minicore::*;

type ptr = *mut u8;

#[repr(simd)]
pub struct i8x8([i8; 8]);
#[repr(simd)]
pub struct i16x4([i16; 4]);
#[repr(simd)]
pub struct i32x2([i32; 2]);
#[repr(simd)]
pub struct i64x1([i64; 1]);
#[repr(simd)]
pub struct f16x4([f16; 4]);
#[repr(simd)]
pub struct f32x2([f32; 2]);
#[repr(simd)]
pub struct f64x1([f64; 1]);
#[repr(simd)]
pub struct i8x16([i8; 16]);
#[repr(simd)]
pub struct i16x8([i16; 8]);
#[repr(simd)]
pub struct i32x4([i32; 4]);
#[repr(simd)]
pub struct i64x2([i64; 2]);
#[repr(simd)]
pub struct f16x8([f16; 8]);
#[repr(simd)]
pub struct f32x4([f32; 4]);
#[repr(simd)]
pub struct f64x2([f64; 2]);

impl Copy for i8x8 {}
impl Copy for i16x4 {}
impl Copy for i32x2 {}
impl Copy for i64x1 {}
impl Copy for f16x4 {}
impl Copy for f32x2 {}
impl Copy for f64x1 {}
impl Copy for i8x16 {}
impl Copy for i16x8 {}
impl Copy for i32x4 {}
impl Copy for i64x2 {}
impl Copy for f16x8 {}
impl Copy for f32x4 {}
impl Copy for f64x2 {}

extern "C" {
fn extern_func();
static extern_static: u8;
Expand Down
94 changes: 15 additions & 79 deletions tests/assembly-llvm/asm/amdgpu-vec-types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//@ needs-rust-lld
// ignore-tidy-linelength

#![feature(abi_gpu_kernel, no_core, asm_experimental_arch, repr_simd, f16)]
#![feature(abi_gpu_kernel, no_core, asm_experimental_arch, f16)]
#![crate_type = "rlib"]
#![no_core]
#![allow(
Expand All @@ -21,89 +21,25 @@
)]

extern crate minicore;
use minicore::simd::*;
use minicore::*;

type ptr = *mut u8;

#[repr(simd)]
pub struct i16x2([i16; 2]);
#[repr(simd)]
pub struct f16x2([f16; 2]);

#[repr(simd)]
pub struct i16x4([i16; 4]);
#[repr(simd)]
pub struct f16x4([f16; 4]);
#[repr(simd)]
pub struct i32x2([i32; 2]);
#[repr(simd)]
pub struct f32x2([f32; 2]);

#[repr(simd)]
pub struct i32x3([i32; 3]);
#[repr(simd)]
pub struct f32x3([f32; 3]);

#[repr(simd)]
pub struct i16x8([i16; 8]);
#[repr(simd)]
pub struct f16x8([f16; 8]);
#[repr(simd)]
pub struct i32x4([i32; 4]);
#[repr(simd)]
pub struct f32x4([f32; 4]);

#[repr(simd)]
pub struct i32x5([i32; 5]);
#[repr(simd)]
pub struct f32x5([f32; 5]);

#[repr(simd)]
pub struct i32x6([i32; 6]);
#[repr(simd)]
pub struct f32x6([f32; 6]);

#[repr(simd)]
pub struct i32x7([i32; 7]);
#[repr(simd)]
pub struct f32x7([f32; 7]);

#[repr(simd)]
pub struct i16x16([i16; 16]);
#[repr(simd)]
pub struct f16x16([f16; 16]);
#[repr(simd)]
pub struct i32x8([i32; 8]);
#[repr(simd)]
pub struct f32x8([f32; 8]);

#[repr(simd)]
pub struct i32x10([i32; 10]);
#[repr(simd)]
pub struct f32x10([f32; 10]);

#[repr(simd)]
pub struct i16x32([i16; 32]);
#[repr(simd)]
pub struct f16x32([f16; 32]);
#[repr(simd)]
pub struct i32x16([i32; 16]);
#[repr(simd)]
pub struct f32x16([f32; 16]);

macro_rules! impl_copy {
($($ty:ident)*) => {
$(
impl Copy for $ty {}
)*
};
}
type i32x3 = Simd<i32, 3>;
type f32x3 = Simd<f32, 3>;

type i32x5 = Simd<i32, 5>;
type f32x5 = Simd<f32, 5>;
Comment on lines +32 to +33

@folkertdev folkertdev Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non-standard (so not a power of 2) types I've left as type aliases in specific tests.

View changes since the review


type i32x6 = Simd<i32, 6>;
type f32x6 = Simd<f32, 6>;

type i32x7 = Simd<i32, 7>;
type f32x7 = Simd<f32, 7>;

impl_copy!(
i16x2 f16x2 i16x4 f16x4 i32x2 f32x2 i32x3 f32x3 i16x8 f16x8 i32x4 f32x4
i32x5 f32x5 i32x6 f32x6 i32x7 f32x7 i16x16 f16x16 i32x8 f32x8 i32x10 f32x10
i16x32 f16x32 i32x16 f32x16
);
type i32x10 = Simd<i32, 10>;
type f32x10 = Simd<f32, 10>;

macro_rules! check {
($func:ident $ty:ident $class:ident $mov:literal) => {
Expand Down
51 changes: 8 additions & 43 deletions tests/assembly-llvm/asm/amdgpu-vec-types2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

// Tests for different gfx versions that do not fit in gfx11 and 12

#![feature(abi_gpu_kernel, no_core, asm_experimental_arch, repr_simd, f16)]
#![feature(abi_gpu_kernel, no_core, asm_experimental_arch, f16)]
#![crate_type = "rlib"]
#![no_core]
#![allow(
Expand All @@ -24,54 +24,19 @@
)]

extern crate minicore;
use minicore::simd::*;
use minicore::*;

type ptr = *mut u8;

#[repr(simd)]
pub struct i32x4([i32; 4]);
#[repr(simd)]
pub struct f32x4([f32; 4]);
type i32x9 = Simd<i32, 9>;
type f32x9 = Simd<f32, 9>;

#[repr(simd)]
pub struct i32x9([i32; 9]);
#[repr(simd)]
pub struct f32x9([f32; 9]);
type i32x11 = Simd<i32, 11>;
type f32x11 = Simd<f32, 11>;

#[repr(simd)]
pub struct i32x11([i32; 11]);
#[repr(simd)]
pub struct f32x11([f32; 11]);

#[repr(simd)]
pub struct i32x12([i32; 12]);
#[repr(simd)]
pub struct f32x12([f32; 12]);

#[repr(simd)]
pub struct i16x32([i16; 32]);
#[repr(simd)]
pub struct f16x32([f16; 32]);
#[repr(simd)]
pub struct i32x16([i32; 16]);
#[repr(simd)]
pub struct f32x16([f32; 16]);

#[repr(simd)]
pub struct f32x32([f32; 32]);

macro_rules! impl_copy {
($($ty:ident)*) => {
$(
impl Copy for $ty {}
)*
};
}

impl_copy!(
i32x4 f32x4 i32x9 f32x9 i32x11 f32x11 i32x12 f32x12 i16x32 f16x32
i32x16 f32x16 f32x32
);
type i32x12 = Simd<i32, 12>;
type f32x12 = Simd<f32, 12>;

macro_rules! check {
($func:ident $ty:ident $class:ident $mov:literal) => {
Expand Down
8 changes: 2 additions & 6 deletions tests/assembly-llvm/asm/arm-modifiers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,15 @@
//@ compile-flags: -Zmerge-functions=disabled
//@ needs-llvm-components: arm

#![feature(no_core, repr_simd)]
#![feature(no_core)]
#![crate_type = "rlib"]
#![no_core]
#![allow(asm_sub_register, non_camel_case_types)]

extern crate minicore;
use minicore::simd::*;
use minicore::*;

#[repr(simd)]
pub struct f32x4([f32; 4]);

impl Copy for f32x4 {}

macro_rules! check {
($func:ident $modifier:literal $reg:ident $ty:ident $mov:literal) => {
// -Copt-level=3 and extern "C" guarantee that the selected register is always r0/s0/d0/q0
Expand Down
41 changes: 2 additions & 39 deletions tests/assembly-llvm/asm/arm-types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,54 +9,17 @@
//@[neon] filecheck-flags: --check-prefix d32
//@ needs-llvm-components: arm

#![feature(no_core, repr_simd, f16)]
#![feature(no_core, f16)]
#![crate_type = "rlib"]
#![no_core]
#![allow(asm_sub_register, non_camel_case_types)]

extern crate minicore;
use minicore::simd::*;
use minicore::*;

type ptr = *mut u8;

#[repr(simd)]
pub struct i8x8([i8; 8]);
#[repr(simd)]
pub struct i16x4([i16; 4]);
#[repr(simd)]
pub struct i32x2([i32; 2]);
#[repr(simd)]
pub struct i64x1([i64; 1]);
#[repr(simd)]
pub struct f16x4([f16; 4]);
#[repr(simd)]
pub struct f32x2([f32; 2]);
#[repr(simd)]
pub struct i8x16([i8; 16]);
#[repr(simd)]
pub struct i16x8([i16; 8]);
#[repr(simd)]
pub struct i32x4([i32; 4]);
#[repr(simd)]
pub struct i64x2([i64; 2]);
#[repr(simd)]
pub struct f16x8([f16; 8]);
#[repr(simd)]
pub struct f32x4([f32; 4]);

impl Copy for i8x8 {}
impl Copy for i16x4 {}
impl Copy for i32x2 {}
impl Copy for i64x1 {}
impl Copy for f16x4 {}
impl Copy for f32x2 {}
impl Copy for i8x16 {}
impl Copy for i16x8 {}
impl Copy for i32x4 {}
impl Copy for i64x2 {}
impl Copy for f16x8 {}
impl Copy for f32x4 {}

extern "C" {
fn extern_func();
static extern_static: u8;
Expand Down
12 changes: 4 additions & 8 deletions tests/assembly-llvm/asm/hexagon-types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,19 @@
//@ compile-flags: -Zmerge-functions=disabled
//@ needs-llvm-components: hexagon

#![feature(no_core, repr_simd, asm_experimental_arch)]
#![feature(no_core, asm_experimental_arch)]
#![crate_type = "rlib"]
#![no_core]
#![allow(asm_sub_register, non_camel_case_types)]

extern crate minicore;
use minicore::simd::*;
use minicore::*;

type ptr = *const i32;

#[repr(simd)]
pub struct i32x32([i32; 32]); // 1024-bit HVX vector (128B mode)
impl Copy for i32x32 {}

#[repr(simd)]
pub struct i32x64([i32; 64]); // 2048-bit HVX vector pair (128B mode)
impl Copy for i32x64 {}
type i32x32 = Simd<i32, 32>; // 1024-bit HVX vector (128B mode)
type i32x64 = Simd<i32, 64>; // 2048-bit HVX vector pair (128B mode)
Comment on lines +19 to +20

@folkertdev folkertdev Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here the types have specific comments, so I've left them as type aliases here rather than importing.

View changes since the review


extern "C" {
fn extern_func();
Expand Down
Loading
Loading