mirror of
https://github.com/EmbarkStudios/rust-gpu.git
synced 2025-02-21 11:24:28 +00:00
Re-add things that shouldn't have been removed
This commit is contained in:
parent
ebff8a8f39
commit
11fcf56935
@ -82,6 +82,27 @@ impl<'a, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'tcx> {
|
||||
return;
|
||||
}
|
||||
|
||||
sym::saturating_add => {
|
||||
assert_eq!(arg_tys[0], arg_tys[1]);
|
||||
match &arg_tys[0].kind() {
|
||||
TyKind::Int(_) | TyKind::Uint(_) => {
|
||||
self.add(args[0].immediate(), args[1].immediate())
|
||||
}
|
||||
TyKind::Float(_) => self.fadd(args[0].immediate(), args[1].immediate()),
|
||||
other => panic!("Unimplemented intrinsic type: {:#?}", other),
|
||||
}
|
||||
}
|
||||
sym::saturating_sub => {
|
||||
assert_eq!(arg_tys[0], arg_tys[1]);
|
||||
match &arg_tys[0].kind() {
|
||||
TyKind::Int(_) | TyKind::Uint(_) => {
|
||||
self.sub(args[0].immediate(), args[1].immediate())
|
||||
}
|
||||
TyKind::Float(_) => self.fsub(args[0].immediate(), args[1].immediate()),
|
||||
other => panic!("Unimplemented intrinsic type: {:#?}", other),
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Configure these to be ocl vs. gl ext instructions, etc.
|
||||
sym::sqrtf32 | sym::sqrtf64 => {
|
||||
if self.kernel_mode {
|
||||
|
Loading…
Reference in New Issue
Block a user