Skip to content
Prev Previous commit
Next Next commit
format
  • Loading branch information
kripken committed Feb 15, 2024
commit d4bfec9c5e39f3795fe72f4d0db5d07776f82e46
9 changes: 6 additions & 3 deletions src/passes/DeNaN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,16 @@ struct DeNaN : public WalkerPass<
// is tricky (we can't depend on function names etc. while fuzzing).
// Instead, extract the lanes and use f32 checks.
auto getLane = [&](Index index) {
return builder.makeSIMDExtract(ExtractLaneVecF32x4, builder.makeLocalGet(0, type), index);
return builder.makeSIMDExtract(
ExtractLaneVecF32x4, builder.makeLocalGet(0, type), index);
};
auto getLaneCheck = [&](Index index) {
return builder.makeBinary(EqFloat32, getLane(index), getLane(index));
};
auto* firstTwo = builder.makeBinary(AndInt32, getLaneCheck(0), getLaneCheck(1));
auto* lastTwo = builder.makeBinary(AndInt32, getLaneCheck(2), getLaneCheck(3));
auto* firstTwo =
builder.makeBinary(AndInt32, getLaneCheck(0), getLaneCheck(1));
auto* lastTwo =
builder.makeBinary(AndInt32, getLaneCheck(2), getLaneCheck(3));
condition = builder.makeBinary(AndInt32, firstTwo, lastTwo);
}
func->body = builder.makeIf(
Expand Down