Skip to content

Commit 192abd5

Browse files
committed
const folding: fix libm not compiling
1 parent 76acf97 commit 192abd5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/rustc_codegen_spirv/src/builder/builder_methods.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,6 +1492,8 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
14921492
simple_op! {
14931493
add,
14941494
int: i_add,
1495+
// TODO why does libm fail to compile if `add` doesn't support float? Why is it not using `fadd`?
1496+
float: f_add,
14951497
fold_const {
14961498
int(a, b) => a.wrapping_add(b);
14971499
}
@@ -1503,6 +1505,8 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
15031505
simple_op! {
15041506
sub,
15051507
int: i_sub,
1508+
// TODO why does libm fail to compile if `add` doesn't support float? Why is it not using `fadd`?
1509+
float: f_sub,
15061510
fold_const {
15071511
int(a, b) => a.wrapping_sub(b);
15081512
}

0 commit comments

Comments
 (0)