Skip to content

Commit

Permalink
spv-out: use OpFRem instead of OpFMod
Browse files Browse the repository at this point in the history
  • Loading branch information
JCapucho committed Jan 7, 2022
1 parent a892960 commit 8f41853
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/back/spv/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ impl<'w> BlockContext<'w> {
crate::BinaryOperator::Modulo => match left_ty_inner.scalar_kind() {
Some(crate::ScalarKind::Sint) => spirv::Op::SMod,
Some(crate::ScalarKind::Uint) => spirv::Op::UMod,
Some(crate::ScalarKind::Float) => spirv::Op::FMod,
Some(crate::ScalarKind::Float) => spirv::Op::FRem,
_ => unimplemented!(),
},
crate::BinaryOperator::Equal => match left_ty_inner.scalar_kind() {
Expand Down
4 changes: 2 additions & 2 deletions tests/out/spv/operators.spvasm
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ OpFunctionEnd
OpBranch %118
%118 = OpLabel
%119 = OpSMod %8 %7 %7
%120 = OpFMod %4 %3 %3
%120 = OpFRem %4 %3 %3
%122 = OpCompositeConstruct %121 %7 %7 %7
%123 = OpCompositeConstruct %121 %7 %7 %7
%124 = OpSMod %121 %122 %123
%125 = OpCompositeConstruct %22 %3 %3 %3
%126 = OpCompositeConstruct %22 %3 %3 %3
%127 = OpFMod %22 %125 %126
%127 = OpFRem %22 %125 %126
OpReturn
OpFunctionEnd
%129 = OpFunction %2 None %117
Expand Down

0 comments on commit 8f41853

Please sign in to comment.