use of com.dat3m.dartagnan.program.event.core.Event 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.event.core.Event 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;
}
use of com.dat3m.dartagnan.program.event.core.Event 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.event.core.Event in project Dat3M by hernanponcedeleon.
the class VisitorLitmusC method visitNreStore.
@Override
public Object visitNreStore(LitmusCParser.NreStoreContext ctx) {
ExprInterface value = (ExprInterface) ctx.value.accept(this);
if (ctx.mo.equals(Tag.Linux.MO_MB)) {
Event event = EventFactory.newStore(getAddress(ctx.address), value, Tag.Linux.MO_ONCE);
programBuilder.addChild(currentThread, event);
return programBuilder.addChild(currentThread, EventFactory.Linux.newMemoryBarrier());
}
Event event = EventFactory.newStore(getAddress(ctx.address), value, ctx.mo);
return programBuilder.addChild(currentThread, event);
}
use of com.dat3m.dartagnan.program.event.core.Event in project Dat3M by hernanponcedeleon.
the class VisitorLitmusPPC method visitBranchCond.
@Override
public Object visitBranchCond(LitmusPPCParser.BranchCondContext ctx) {
Label label = programBuilder.getOrCreateLabel(ctx.Label().getText());
Event lastEvent = programBuilder.getLastEvent(mainThread);
if (!(lastEvent instanceof Cmp)) {
throw new ParsingException("Invalid syntax near " + ctx.getText());
}
Cmp cmp = (Cmp) lastEvent;
Atom expr = new Atom(cmp.getLeft(), ctx.cond().op, cmp.getRight());
return programBuilder.addChild(mainThread, EventFactory.newJump(expr, label));
}
Aggregations