diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/spirv/VisitorOpsArithmetic.java b/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/spirv/VisitorOpsArithmetic.java index 9b5c00a49e..596725a674 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/spirv/VisitorOpsArithmetic.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/spirv/VisitorOpsArithmetic.java @@ -62,6 +62,11 @@ public Event visitOpSDiv(SpirvParser.OpSDivContext ctx) { return visitIntegerBinExpression(ctx.idResult(), ctx.idResultType(), ctx.operand1(), ctx.operand2(), DIV); } + @Override + public Event visitOpUMod(SpirvParser.OpUModContext ctx) { + return visitIntegerBinExpression(ctx.idResult(), ctx.idResultType(), ctx.operand1(), ctx.operand2(), UREM); + } + private Event visitIntegerUnExpression( SpirvParser.IdResultContext idCtx, SpirvParser.IdResultTypeContext typeCtx, @@ -122,7 +127,8 @@ public Set getSupportedOps() { "OpISub", "OpIMul", "OpUDiv", - "OpSDiv" + "OpSDiv", + "OpUMod" ); } } diff --git a/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/spirv/VisitorOpsLogical.java b/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/spirv/VisitorOpsLogical.java index a1343d664d..1383576d68 100644 --- a/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/spirv/VisitorOpsLogical.java +++ b/dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/spirv/VisitorOpsLogical.java @@ -59,7 +59,7 @@ public Event visitOpSelect(SpirvParser.OpSelectContext ctx) { "expected two operands type '%s but received '%s' and '%s'", id, type, op1.getType(), op2.getType()); } - if (op1.getType() instanceof IntegerType) { + if (op1.getType() instanceof IntegerType || op1.getType() instanceof BooleanType) { return builder.addEvent(new Local(register, expressions.makeITE(cond, op1, op2))); } throw new ParsingException("Illegal definition for '%s', " +