use of com.dat3m.dartagnan.expression.IExprBin in project Dat3M by hernanponcedeleon.
the class VisitorLitmusPPC method visitXor.
@Override
public Object visitXor(LitmusPPCParser.XorContext ctx) {
Register r1 = programBuilder.getOrCreateRegister(mainThread, ctx.register(0).getText(), ARCH_PRECISION);
Register r2 = programBuilder.getOrErrorRegister(mainThread, ctx.register(1).getText());
Register r3 = programBuilder.getOrErrorRegister(mainThread, ctx.register(2).getText());
return programBuilder.addChild(mainThread, EventFactory.newLocal(r1, new IExprBin(r2, IOpBin.XOR, r3)));
}
use of com.dat3m.dartagnan.expression.IExprBin in project Dat3M by hernanponcedeleon.
the class VisitorLitmusAArch64 method visitArithmetic.
@Override
public Object visitArithmetic(LitmusAArch64Parser.ArithmeticContext ctx) {
Register rD = programBuilder.getOrCreateRegister(mainThread, ctx.rD, ARCH_PRECISION);
Register r1 = programBuilder.getOrErrorRegister(mainThread, ctx.rV);
IExpr expr = ctx.expr32() != null ? (IExpr) ctx.expr32().accept(this) : (IExpr) ctx.expr64().accept(this);
return programBuilder.addChild(mainThread, EventFactory.newLocal(rD, new IExprBin(r1, ctx.arithmeticInstruction().op, expr)));
}
use of com.dat3m.dartagnan.expression.IExprBin in project Dat3M by hernanponcedeleon.
the class VisitorLitmusAArch64 method visitExpressionRegister64.
@Override
public IExpr visitExpressionRegister64(LitmusAArch64Parser.ExpressionRegister64Context ctx) {
IExpr expr = programBuilder.getOrCreateRegister(mainThread, ctx.register64().id, ARCH_PRECISION);
if (ctx.shift() != null) {
IValue val = new IValue(new BigInteger(ctx.shift().immediate().constant().getText()), ARCH_PRECISION);
expr = new IExprBin(expr, ctx.shift().shiftOperator().op, val);
}
return expr;
}
use of com.dat3m.dartagnan.expression.IExprBin in project Dat3M by hernanponcedeleon.
the class VisitorLitmusAArch64 method visitExpressionImmediate.
@Override
public IExpr visitExpressionImmediate(LitmusAArch64Parser.ExpressionImmediateContext ctx) {
IExpr expr = new IValue(new BigInteger(ctx.immediate().constant().getText()), ARCH_PRECISION);
if (ctx.shift() != null) {
IValue val = new IValue(new BigInteger(ctx.shift().immediate().constant().getText()), ARCH_PRECISION);
expr = new IExprBin(expr, ctx.shift().shiftOperator().op, val);
}
return expr;
}
use of com.dat3m.dartagnan.expression.IExprBin in project Dat3M by hernanponcedeleon.
the class VisitorLitmusPPC method visitAddi.
@Override
public Object visitAddi(LitmusPPCParser.AddiContext ctx) {
Register r1 = programBuilder.getOrCreateRegister(mainThread, ctx.register(0).getText(), ARCH_PRECISION);
Register r2 = programBuilder.getOrErrorRegister(mainThread, ctx.register(1).getText());
IValue constant = new IValue(new BigInteger(ctx.constant().getText()), ARCH_PRECISION);
return programBuilder.addChild(mainThread, EventFactory.newLocal(r1, new IExprBin(r2, IOpBin.PLUS, constant)));
}
Aggregations