Skip to content

Commit

Permalink
exclude erf* libm intrinsics from hook table
Browse files Browse the repository at this point in the history
  • Loading branch information
djdisodo committed Jan 15, 2023
1 parent ebc143b commit 57e3b67
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
1 change: 0 additions & 1 deletion crates/rustc_codegen_spirv/src/builder/builder_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2334,7 +2334,6 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
self.debug_type(result.ty),
);
}
result
} else if [self.panic_fn_id.get(), self.panic_bounds_check_fn_id.get()]
.contains(&Some(callee_val))
{
Expand Down
17 changes: 3 additions & 14 deletions crates/rustc_codegen_spirv/src/builder/libm_intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ pub const TABLE: &[(&str, LibmIntrinsic)] = &[
("cosf", LibmIntrinsic::GLOp(GLOp::Cos)),
("cosh", LibmIntrinsic::GLOp(GLOp::Cosh)),
("coshf", LibmIntrinsic::GLOp(GLOp::Cosh)),
("erf", LibmIntrinsic::Custom(LibmCustomIntrinsic::Erf)),
("erff", LibmIntrinsic::Custom(LibmCustomIntrinsic::Erf)),
("erfc", LibmIntrinsic::Custom(LibmCustomIntrinsic::Erfc)),
("erfcf", LibmIntrinsic::Custom(LibmCustomIntrinsic::Erfc)),
("exp10", LibmIntrinsic::Custom(LibmCustomIntrinsic::Exp10)),
("exp10f", LibmIntrinsic::Custom(LibmCustomIntrinsic::Exp10)),
("exp2", LibmIntrinsic::GLOp(GLOp::Exp2)),
Expand Down Expand Up @@ -258,16 +254,6 @@ impl Builder<'_, '_> {
let one = self.constant_float(exp.ty, 1.0);
self.sub(exp, one)
}
LibmIntrinsic::Custom(LibmCustomIntrinsic::Erf) => {
let undef = self.undef(result_type);
self.zombie(undef.def(self), "Erf not supported yet");
undef
}
LibmIntrinsic::Custom(LibmCustomIntrinsic::Erfc) => {
let undef = self.undef(result_type);
self.zombie(undef.def(self), "Erfc not supported yet");
undef
}
LibmIntrinsic::Custom(LibmCustomIntrinsic::Fdim) => {
let undef = self.undef(result_type);
self.zombie(undef.def(self), "Fdim not supported yet");
Expand Down Expand Up @@ -348,6 +334,9 @@ impl Builder<'_, '_> {
self.zombie(undef.def(self), "Scalbn not supported yet");
undef
}
_ => {
panic!("unexpected behavior, please open an issue")
}
}
}
}

0 comments on commit 57e3b67

Please sign in to comment.