use of com.dat3m.dartagnan.program.Register in project Dat3M by hernanponcedeleon.
the class PthreadsProcedures method mutexUnlock.
private static void mutexUnlock(VisitorBoogie visitor, Call_cmdContext ctx) {
ExprsContext lock = ctx.call_params().exprs();
Register register = visitor.programBuilder.getOrCreateRegister(visitor.threadCount, null, ARCH_PRECISION);
IExpr lockAddress = (IExpr) lock.accept(visitor);
if (lockAddress != null) {
visitor.programBuilder.addChild(visitor.threadCount, EventFactory.Pthread.newUnlock(lock.getText(), lockAddress, register));
}
}
use of com.dat3m.dartagnan.program.Register in project Dat3M by hernanponcedeleon.
the class PthreadsProcedures method pthread_join.
private static void pthread_join(VisitorBoogie visitor, Call_cmdContext ctx) {
String namePtr = ctx.call_params().exprs().expr().get(0).getText();
// This names are global so we don't use currentScope.getID(), but per thread.
Register callReg = visitor.programBuilder.getOrCreateRegister(visitor.threadCount, namePtr, ARCH_PRECISION);
if (visitor.pool.getPtrFromReg(callReg) == null) {
throw new UnsupportedOperationException("pthread_join cannot be handled");
}
MemoryObject object = visitor.programBuilder.getOrNewObject(String.format("%s(%s)_active", visitor.pool.getPtrFromReg(callReg), visitor.pool.getCreatorFromPtr(visitor.pool.getPtrFromReg(callReg))));
Register reg = visitor.programBuilder.getOrCreateRegister(visitor.threadCount, null, ARCH_PRECISION);
visitor.programBuilder.addChild(visitor.threadCount, EventFactory.Pthread.newJoin(visitor.pool.getPtrFromReg(callReg), reg, object));
}
use of com.dat3m.dartagnan.program.Register in project Dat3M by hernanponcedeleon.
the class ProgramBuilder method initRegEqLocPtr.
public void initRegEqLocPtr(int regThread, String regName, String locName, int precision) {
MemoryObject object = getOrNewObject(locName);
Register reg = getOrCreateRegister(regThread, regName, precision);
addChild(regThread, EventFactory.newLocal(reg, object));
}
use of com.dat3m.dartagnan.program.Register in project Dat3M by hernanponcedeleon.
the class VisitorLitmusAArch64 method visitArithmetic.
@Override
public Object visitArithmetic(LitmusAArch64Parser.ArithmeticContext ctx) {
Register rD = programBuilder.getOrCreateRegister(mainThread, ctx.rD, ARCH_PRECISION);
Register r1 = programBuilder.getOrErrorRegister(mainThread, ctx.rV);
IExpr expr = ctx.expr32() != null ? (IExpr) ctx.expr32().accept(this) : (IExpr) ctx.expr64().accept(this);
return programBuilder.addChild(mainThread, EventFactory.newLocal(rD, new IExprBin(r1, ctx.arithmeticInstruction().op, expr)));
}
use of com.dat3m.dartagnan.program.Register in project Dat3M by hernanponcedeleon.
the class VisitorLitmusAArch64 method visitStoreExclusive.
@Override
public Object visitStoreExclusive(LitmusAArch64Parser.StoreExclusiveContext ctx) {
Register register = programBuilder.getOrCreateRegister(mainThread, ctx.rV, ARCH_PRECISION);
Register statusReg = programBuilder.getOrCreateRegister(mainThread, ctx.rS, ARCH_PRECISION);
Register address = programBuilder.getOrErrorRegister(mainThread, ctx.address().id);
if (ctx.offset() != null) {
address = visitOffset(ctx.offset(), address);
}
StoreExclusive event = EventFactory.AArch64.newExclusiveStore(statusReg, address, register, ctx.storeExclusiveInstruction().mo);
return programBuilder.addChild(mainThread, event);
}
Aggregations