-
Notifications
You must be signed in to change notification settings - Fork 296
loongarch: Mark partial intrinsics as safe #1874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
r? @folkertdev rustbot has assigned @folkertdev. Use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks good, I added some nits and questions inline
unsafe { | ||
__dbar(IMM15); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this would save 2 lines
unsafe { | |
__dbar(IMM15); | |
} | |
unsafe { __dbar(IMM15) }; |
let val: i32; | ||
let tid: isize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this would also work
let val: i32; | |
let tid: isize; | |
let (val, tid): (i32, isize); |
format!( | ||
"pub {}fn {current_name}{fn_inputs} {fn_output}", | ||
if is_mem { "unsafe " } else { "" } | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand this as a heuristic, but is it truly the case that only pointer reads/writes cause unsafety for these intrinsics?
__lasx_xvslei_b(a, IMM_S5) | ||
pub fn lasx_xvslei_b<const IMM_S5: i32>(a: v32i8) -> v32i8 { | ||
unsafe { | ||
static_assert_simm_bits!(IMM_S5, 5); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can the assert be lifted out of the unsafe block?
No description provided.