Fix ptr_mask
impl in cg gcc
This commit is contained in:
parent
a7f6e7ebaf
commit
5eedd541a9
@ -320,8 +320,18 @@ fn codegen_intrinsic_call(&mut self, instance: Instance<'tcx>, fn_abi: &FnAbi<'t
|
||||
return;
|
||||
}
|
||||
|
||||
sym::ptr_mask => self.and(args[0].immediate(), args[1].immediate()),
|
||||
sym::ptr_mask => {
|
||||
let usize_type = self.context.new_type::<usize>();
|
||||
let void_ptr_type = self.context.new_type::<*const ()>();
|
||||
|
||||
let ptr = args[0].immediate();
|
||||
let mask = args[1].immediate();
|
||||
|
||||
let addr = self.bitcast(ptr, usize_type);
|
||||
let masked = self.and(addr, mask);
|
||||
self.bitcast(masked, void_ptr_type)
|
||||
},
|
||||
|
||||
_ if name_str.starts_with("simd_") => {
|
||||
match generic_simd_intrinsic(self, name, callee_ty, args, ret_ty, llret_ty, span) {
|
||||
Ok(llval) => llval,
|
||||
|
Loading…
Reference in New Issue
Block a user