use of com.dat3m.dartagnan.expression.IValue in project Dat3M by hernanponcedeleon.
the class VisitorLitmusAssertions method acceptAssertionValue.
private LastValueInterface acceptAssertionValue(LitmusAssertionsParser.AssertionValueContext ctx, boolean right) {
if (ctx.constant() != null) {
return new IValue(new BigInteger(ctx.constant().getText()), ARCH_PRECISION);
}
String name = ctx.varName().getText();
if (ctx.threadId() != null) {
return programBuilder.getOrErrorRegister(ctx.threadId().id, name);
}
MemoryObject base = programBuilder.getObject(name);
checkState(base != null, "uninitialized location %s", name);
TerminalNode offset = ctx.DigitSequence();
int o = offset == null ? 0 : Integer.parseInt(offset.getText());
return right && offset == null ? base : new Location(name, base, o);
}
use of com.dat3m.dartagnan.expression.IValue in project Dat3M by hernanponcedeleon.
the class VisitorLitmusPPC method visitLi.
@Override
public Object visitLi(LitmusPPCParser.LiContext ctx) {
Register register = programBuilder.getOrCreateRegister(mainThread, ctx.register().getText(), ARCH_PRECISION);
IValue constant = new IValue(new BigInteger(ctx.constant().getText()), ARCH_PRECISION);
return programBuilder.addChild(mainThread, EventFactory.newLocal(register, constant));
}
use of com.dat3m.dartagnan.expression.IValue 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)));
}
use of com.dat3m.dartagnan.expression.IValue in project Dat3M by hernanponcedeleon.
the class VisitorLitmusX86 method visitStoreValueToLocation.
@Override
public Object visitStoreValueToLocation(LitmusX86Parser.StoreValueToLocationContext ctx) {
MemoryObject object = programBuilder.getOrNewObject(ctx.location().getText());
IValue constant = new IValue(new BigInteger(ctx.constant().getText()), ARCH_PRECISION);
return programBuilder.addChild(mainThread, EventFactory.newStore(object, constant, "_rx"));
}
use of com.dat3m.dartagnan.expression.IValue in project Dat3M by hernanponcedeleon.
the class VisitorLitmusAArch64 method visitOffset.
private Register visitOffset(LitmusAArch64Parser.OffsetContext ctx, Register register) {
Register result = programBuilder.getOrCreateRegister(mainThread, null, ARCH_PRECISION);
IExpr expr = ctx.immediate() == null ? programBuilder.getOrErrorRegister(mainThread, ctx.expressionConversion().register32().id) : new IValue(new BigInteger(ctx.immediate().constant().getText()), ARCH_PRECISION);
programBuilder.addChild(mainThread, EventFactory.newLocal(result, new IExprBin(register, IOpBin.PLUS, expr)));
return result;
}
Aggregations