2024-02-22 12:10:29 +00:00
|
|
|
//@ compile-flags: -Copt-level=0
|
2022-08-08 14:00:45 +00:00
|
|
|
#![crate_type = "lib"]
|
|
|
|
#![feature(core_intrinsics)]
|
|
|
|
|
2022-08-09 15:51:45 +00:00
|
|
|
// CHECK-LABEL: @mask_ptr
|
2022-12-30 20:11:30 +00:00
|
|
|
// CHECK-SAME: [[WORD:i[0-9]+]] %mask
|
2022-08-09 15:51:45 +00:00
|
|
|
#[no_mangle]
|
2022-08-18 18:21:53 +00:00
|
|
|
pub fn mask_ptr(ptr: *const u16, mask: usize) -> *const u16 {
|
2022-08-09 15:51:45 +00:00
|
|
|
// CHECK: call
|
2023-07-27 21:44:13 +00:00
|
|
|
// CHECK-SAME: @llvm.ptrmask.{{p0|p0i8}}.[[WORD]](ptr {{%ptr|%1}}, [[WORD]] %mask)
|
2022-08-08 14:00:45 +00:00
|
|
|
core::intrinsics::ptr_mask(ptr, mask)
|
|
|
|
}
|