Skip to content

Commit 57e3b67

Browse files
committed
exclude erf* libm intrinsics from hook table
1 parent ebc143b commit 57e3b67

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

crates/rustc_codegen_spirv/src/builder/builder_methods.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2334,7 +2334,6 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
23342334
self.debug_type(result.ty),
23352335
);
23362336
}
2337-
result
23382337
} else if [self.panic_fn_id.get(), self.panic_bounds_check_fn_id.get()]
23392338
.contains(&Some(callee_val))
23402339
{

crates/rustc_codegen_spirv/src/builder/libm_intrinsics.rs

+3-14
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@ pub const TABLE: &[(&str, LibmIntrinsic)] = &[
7070
("cosf", LibmIntrinsic::GLOp(GLOp::Cos)),
7171
("cosh", LibmIntrinsic::GLOp(GLOp::Cosh)),
7272
("coshf", LibmIntrinsic::GLOp(GLOp::Cosh)),
73-
("erf", LibmIntrinsic::Custom(LibmCustomIntrinsic::Erf)),
74-
("erff", LibmIntrinsic::Custom(LibmCustomIntrinsic::Erf)),
75-
("erfc", LibmIntrinsic::Custom(LibmCustomIntrinsic::Erfc)),
76-
("erfcf", LibmIntrinsic::Custom(LibmCustomIntrinsic::Erfc)),
7773
("exp10", LibmIntrinsic::Custom(LibmCustomIntrinsic::Exp10)),
7874
("exp10f", LibmIntrinsic::Custom(LibmCustomIntrinsic::Exp10)),
7975
("exp2", LibmIntrinsic::GLOp(GLOp::Exp2)),
@@ -258,16 +254,6 @@ impl Builder<'_, '_> {
258254
let one = self.constant_float(exp.ty, 1.0);
259255
self.sub(exp, one)
260256
}
261-
LibmIntrinsic::Custom(LibmCustomIntrinsic::Erf) => {
262-
let undef = self.undef(result_type);
263-
self.zombie(undef.def(self), "Erf not supported yet");
264-
undef
265-
}
266-
LibmIntrinsic::Custom(LibmCustomIntrinsic::Erfc) => {
267-
let undef = self.undef(result_type);
268-
self.zombie(undef.def(self), "Erfc not supported yet");
269-
undef
270-
}
271257
LibmIntrinsic::Custom(LibmCustomIntrinsic::Fdim) => {
272258
let undef = self.undef(result_type);
273259
self.zombie(undef.def(self), "Fdim not supported yet");
@@ -348,6 +334,9 @@ impl Builder<'_, '_> {
348334
self.zombie(undef.def(self), "Scalbn not supported yet");
349335
undef
350336
}
337+
_ => {
338+
panic!("unexpected behavior, please open an issue")
339+
}
351340
}
352341
}
353342
}

0 commit comments

Comments
 (0)