use of com.dat3m.dartagnan.program.Register in project Dat3M by hernanponcedeleon.
the class VisitorIMM method visitAtomicFetchOp.
@Override
public List<Event> visitAtomicFetchOp(AtomicFetchOp e) {
Register resultRegister = e.getResultRegister();
IOpBin op = e.getOp();
IExpr address = e.getAddress();
String mo = e.getMo();
Fence optionalFence = mo.equals(Tag.C11.MO_SC) ? newFence(Tag.C11.MO_SC) : null;
Register dummyReg = e.getThread().newRegister(resultRegister.getPrecision());
Load load = newRMWLoad(resultRegister, address, extractLoadMo(mo));
return eventSequence(optionalFence, load, newLocal(dummyReg, new IExprBin(resultRegister, op, (IExpr) e.getMemValue())), optionalFence, newRMWStore(load, address, dummyReg, extractStoreMo(mo)));
}
use of com.dat3m.dartagnan.program.Register in project Dat3M by hernanponcedeleon.
the class VisitorIMM method visitJoin.
@Override
public List<Event> visitJoin(Join e) {
Register resultRegister = e.getResultRegister();
Load load = newLoad(resultRegister, e.getAddress(), extractLoadMo(e.getMo()));
load.addFilters(C11.PTHREAD);
return eventSequence(load, newJumpUnless(new Atom(resultRegister, EQ, IValue.ZERO), (Label) e.getThread().getExit()), newFence(Tag.C11.MO_SC));
}
use of com.dat3m.dartagnan.program.Register in project Dat3M by hernanponcedeleon.
the class VisitorLKMM method visitJoin.
@Override
public List<Event> visitJoin(Join e) {
Register resultRegister = e.getResultRegister();
Load load = newLoad(resultRegister, e.getAddress(), Tag.Linux.MO_ACQUIRE);
load.addFilters(C11.PTHREAD);
return eventSequence(load, newJumpUnless(new Atom(resultRegister, EQ, IValue.ZERO), (Label) e.getThread().getExit()));
}
use of com.dat3m.dartagnan.program.Register in project Dat3M by hernanponcedeleon.
the class VisitorLKMM method visitRMWOp.
@Override
public List<Event> visitRMWOp(RMWOp e) {
IExpr address = e.getAddress();
Register resultRegister = e.getResultRegister();
Load load = newRMWLoad(resultRegister, address, Tag.Linux.MO_ONCE);
load.addFilters(Tag.Linux.NORETURN);
return eventSequence(load, newRMWStore(load, address, new IExprBin(resultRegister, e.getOp(), (IExpr) e.getMemValue()), Tag.Linux.MO_ONCE));
}
use of com.dat3m.dartagnan.program.Register in project Dat3M by hernanponcedeleon.
the class VisitorLKMM method visitLKMMLock.
@Override
public List<Event> visitLKMMLock(LKMMLock e) {
Register dummy = e.getThread().newRegister(GlobalSettings.ARCH_PRECISION);
// In litmus tests, spinlocks are guaranteed to success, i.e. its read part gets value 0
Event middle = e.getThread().getProgram().getFormat().equals(LITMUS) ? newAssume(new Atom(dummy, COpBin.EQ, IValue.ZERO)) : newJump(new Atom(dummy, NEQ, IValue.ZERO), (Label) e.getThread().getExit());
return eventSequence(Linux.newLockRead(dummy, e.getLock()), middle, Linux.newLockWrite(e.getLock()));
}
Aggregations