Skip to content

Commit 4c485a4

Browse files
committed
add compiletest for debuginfo generation for SVE predicates <vscale x N x i1> where N != 16
1 parent f9007bc commit 4c485a4

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Compiletest for rust-lang/rust#150419: Do not spill operands to the stack when
2+
// creating debuginfo for AArch64 SVE predicates `<vscale x N x i1>` where `N != 16`
3+
//@ edition: 2021
4+
//@ only-aarch64
5+
//@ build-pass
6+
//@ compile-flags: -C debuginfo=2 -C target-feature=+sve
7+
8+
#![crate_type = "lib"]
9+
#![allow(internal_features)]
10+
#![feature(rustc_attrs, link_llvm_intrinsics)]
11+
12+
#[rustc_scalable_vector(16)]
13+
#[allow(non_camel_case_types)]
14+
#[repr(transparent)]
15+
pub struct svbool_t(bool);
16+
17+
#[rustc_scalable_vector(4)]
18+
#[allow(non_camel_case_types)]
19+
#[repr(transparent)]
20+
pub struct svbool4_t(bool);
21+
22+
impl std::convert::Into<svbool_t> for svbool4_t {
23+
#[inline(always)]
24+
fn into(self) -> svbool_t {
25+
unsafe extern "C" {
26+
#[link_name = "llvm.aarch64.sve.convert.to.svbool.nxv4i1"]
27+
fn convert_to_svbool(b: svbool4_t) -> svbool_t;
28+
}
29+
unsafe { convert_to_svbool(self) }
30+
}
31+
}
32+
33+
pub fn svwhilelt_b32_u64(op1: u64, op2: u64) -> svbool_t {
34+
unsafe extern "C" {
35+
#[link_name = "llvm.aarch64.sve.whilelo.nxv4i1.u64"]
36+
fn _svwhilelt_b32_u64(op1: u64, op2: u64) -> svbool4_t;
37+
}
38+
unsafe { _svwhilelt_b32_u64(op1, op2) }.into()
39+
}

0 commit comments

Comments
 (0)