use of com.dat3m.dartagnan.program.Register in project Dat3M by hernanponcedeleon.
the class VisitorLitmusC method visitNreAtomicOp.
// ----------------------------------------------------------------------------------------------------------------
// NonReturn expressions (all other return expressions are reduced to these ones)
@Override
public Object visitNreAtomicOp(LitmusCParser.NreAtomicOpContext ctx) {
IExpr value = returnExpressionOrDefault(ctx.value, BigInteger.ONE);
Register register = programBuilder.getOrCreateRegister(scope, null, ARCH_PRECISION);
Event event = EventFactory.Linux.newRMWOp(getAddress(ctx.address), register, value, ctx.op);
return programBuilder.addChild(currentThread, event);
}
use of com.dat3m.dartagnan.program.Register in project Dat3M by hernanponcedeleon.
the class VisitorLitmusC method visitReAtomicAddUnless.
// Returns non-zero if the addition was executed, zero otherwise
@Override
public IExpr visitReAtomicAddUnless(LitmusCParser.ReAtomicAddUnlessContext ctx) {
Register register = getReturnRegister(true);
IExpr value = (IExpr) ctx.value.accept(this);
ExprInterface cmp = (ExprInterface) ctx.cmp.accept(this);
programBuilder.addChild(currentThread, EventFactory.Linux.newRMWAddUnless(getAddress(ctx.address), register, cmp, value));
return register;
}
use of com.dat3m.dartagnan.program.Register in project Dat3M by hernanponcedeleon.
the class VisitorLitmusLISA method visitLoad.
@Override
public Object visitLoad(LitmusLISAParser.LoadContext ctx) {
Register reg = programBuilder.getOrCreateRegister(mainThread, ctx.register().getText(), ARCH_PRECISION);
IExpr address = (IExpr) ctx.expression().accept(this);
String mo = ctx.mo() != null ? ctx.mo().getText() : null;
programBuilder.addChild(mainThread, EventFactory.newLoad(reg, address, mo));
return null;
}
use of com.dat3m.dartagnan.program.Register in project Dat3M by hernanponcedeleon.
the class VisitorLitmusPPC method visitStw.
@Override
public Object visitStw(LitmusPPCParser.StwContext ctx) {
Register r1 = programBuilder.getOrErrorRegister(mainThread, ctx.register(0).getText());
Register ra = programBuilder.getOrErrorRegister(mainThread, ctx.register(1).getText());
return programBuilder.addChild(mainThread, EventFactory.newStore(ra, r1, "_rx"));
}
use of com.dat3m.dartagnan.program.Register 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)));
}
Aggregations