Search in sources :

Example 1 with RMWReadCondUnless

use of com.dat3m.dartagnan.program.event.lang.linux.cond.RMWReadCondUnless in project Dat3M by hernanponcedeleon.

the class VisitorNone method visitRMWAddUnless.

@Override
public List<Event> visitRMWAddUnless(RMWAddUnless e) {
    Register resultRegister = e.getResultRegister();
    Register dummy = new Register(null, resultRegister.getThreadId(), resultRegister.getPrecision());
    RMWReadCondUnless load = Linux.newRMWReadCondUnless(dummy, e.getCmp(), e.getAddress(), Tag.Linux.MO_RELAXED);
    return eventSequence(Linux.newConditionalMemoryBarrier(load), load, Linux.newRMWStoreCond(load, e.getAddress(), new IExprBin(dummy, IOpBin.PLUS, (IExpr) e.getMemValue()), Tag.Linux.MO_RELAXED), newLocal(resultRegister, new Atom(dummy, NEQ, e.getCmp())), Linux.newConditionalMemoryBarrier(load));
}
Also used : Register(com.dat3m.dartagnan.program.Register) RMWReadCondUnless(com.dat3m.dartagnan.program.event.lang.linux.cond.RMWReadCondUnless)

Example 2 with RMWReadCondUnless

use of com.dat3m.dartagnan.program.event.lang.linux.cond.RMWReadCondUnless in project Dat3M by hernanponcedeleon.

the class VisitorLKMM method visitRMWAddUnless.

@Override
public List<Event> visitRMWAddUnless(RMWAddUnless e) {
    Register resultRegister = e.getResultRegister();
    Register dummy = e.getThread().newRegister(resultRegister.getPrecision());
    RMWReadCondUnless load = Linux.newRMWReadCondUnless(dummy, e.getCmp(), e.getAddress(), Tag.Linux.MO_ONCE);
    return eventSequence(Linux.newConditionalMemoryBarrier(load), load, Linux.newRMWStoreCond(load, e.getAddress(), new IExprBin(dummy, IOpBin.PLUS, (IExpr) e.getMemValue()), Tag.Linux.MO_ONCE), newLocal(resultRegister, new Atom(dummy, NEQ, e.getCmp())), Linux.newConditionalMemoryBarrier(load));
}
Also used : Register(com.dat3m.dartagnan.program.Register) RMWReadCondUnless(com.dat3m.dartagnan.program.event.lang.linux.cond.RMWReadCondUnless)

Aggregations

Register (com.dat3m.dartagnan.program.Register)2 RMWReadCondUnless (com.dat3m.dartagnan.program.event.lang.linux.cond.RMWReadCondUnless)2