use of com.dat3m.dartagnan.program.Register in project Dat3M by hernanponcedeleon.
the class VisitorLitmusC method visitReReadOnce.
@Override
public IExpr visitReReadOnce(LitmusCParser.ReReadOnceContext ctx) {
Register register = getReturnRegister(true);
Event event = EventFactory.newLoad(register, getAddress(ctx.address), ctx.mo);
programBuilder.addChild(currentThread, event);
return register;
}
use of com.dat3m.dartagnan.program.Register in project Dat3M by hernanponcedeleon.
the class VisitorLitmusC method visitReCmpXchg.
@Override
public IExpr visitReCmpXchg(LitmusCParser.ReCmpXchgContext ctx) {
Register register = getReturnRegister(true);
ExprInterface cmp = (ExprInterface) ctx.cmp.accept(this);
IExpr value = (IExpr) ctx.value.accept(this);
Event event = EventFactory.Linux.newRMWCompareExchange(getAddress(ctx.address), register, cmp, value, ctx.mo);
programBuilder.addChild(currentThread, event);
return register;
}
use of com.dat3m.dartagnan.program.Register in project Dat3M by hernanponcedeleon.
the class VisitorLitmusC method visitReOpArith.
@Override
public ExprInterface visitReOpArith(LitmusCParser.ReOpArithContext ctx) {
Register register = getReturnRegister(false);
IExpr v1 = (IExpr) ctx.re(0).accept(this);
IExpr v2 = (IExpr) ctx.re(1).accept(this);
IExpr result = new IExprBin(v1, ctx.opArith().op, v2);
return assignToReturnRegister(register, result);
}
use of com.dat3m.dartagnan.program.Register in project Dat3M by hernanponcedeleon.
the class VisitorLitmusC method visitReOpCompare.
// ----------------------------------------------------------------------------------------------------------------
// Return expressions (register for return value is optional)
@Override
public ExprInterface visitReOpCompare(LitmusCParser.ReOpCompareContext ctx) {
Register register = getReturnRegister(false);
ExprInterface v1 = (ExprInterface) ctx.re(0).accept(this);
ExprInterface v2 = (ExprInterface) ctx.re(1).accept(this);
Atom result = new Atom(v1, ctx.opCompare().op, v2);
return assignToReturnRegister(register, result);
}
use of com.dat3m.dartagnan.program.Register in project Dat3M by hernanponcedeleon.
the class VisitorLitmusC method visitReAtomicOpAndTest.
@Override
public IExpr visitReAtomicOpAndTest(LitmusCParser.ReAtomicOpAndTestContext ctx) {
Register register = getReturnRegister(true);
IExpr value = returnExpressionOrDefault(ctx.value, BigInteger.ONE);
Event event = EventFactory.Linux.newRMWOpAndTest(getAddress(ctx.address), register, value, ctx.op);
programBuilder.addChild(currentThread, event);
return register;
}
Aggregations