Skip to content

Commit ed1a5e7

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

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Compiletest for #150419: Do not spill operand debuginfo to stack for
2+
// 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+
#![allow(internal_features)]
9+
#![feature(rustc_attrs, link_llvm_intrinsics)]
10+
11+
#[rustc_scalable_vector(16)]
12+
#[allow(non_camel_case_types)]
13+
#[repr(transparent)]
14+
pub struct svbool_t(bool);
15+
16+
#[rustc_scalable_vector(4)]
17+
#[allow(non_camel_case_types)]
18+
#[repr(transparent)]
19+
pub struct svbool4_t(bool);
20+
21+
impl std::convert::Into<svbool_t> for svbool4_t {
22+
#[inline(always)]
23+
fn into(self) -> svbool_t {
24+
unsafe extern "C" {
25+
#[link_name = "llvm.aarch64.sve.convert.to.svbool.nxv4i1"]
26+
fn convert_to_svbool(b: svbool4_t) -> svbool_t;
27+
}
28+
unsafe { convert_to_svbool(self) }
29+
}
30+
}
31+
32+
pub fn svwhilelt_b32_u64(op1: u64, op2: u64) -> svbool_t {
33+
unsafe extern "C" {
34+
#[link_name = "llvm.aarch64.sve.whilelo.nxv4i1.u64"]
35+
fn _svwhilelt_b32_u64(op1: u64, op2: u64) -> svbool4_t;
36+
}
37+
unsafe { _svwhilelt_b32_u64(op1, op2) }.into()
38+
}

0 commit comments

Comments
 (0)