Search in sources :

Example 91 with Register

use of com.dat3m.dartagnan.program.Register in project Dat3M by hernanponcedeleon.

the class VisitorLitmusC method visitReReadNa.

@Override
public IExpr visitReReadNa(LitmusCParser.ReReadNaContext ctx) {
    Register register = getReturnRegister(true);
    Event event = EventFactory.newLoad(register, getAddress(ctx.address), "NA");
    programBuilder.addChild(currentThread, event);
    return register;
}
Also used : Register(com.dat3m.dartagnan.program.Register) Event(com.dat3m.dartagnan.program.event.core.Event)

Example 92 with Register

use of com.dat3m.dartagnan.program.Register in project Dat3M by hernanponcedeleon.

the class VisitorLitmusC method visitThreadArguments.

@Override
public Object visitThreadArguments(LitmusCParser.ThreadArgumentsContext ctx) {
    if (ctx != null) {
        for (LitmusCParser.VarNameContext varName : ctx.varName()) {
            String name = varName.getText();
            MemoryObject object = programBuilder.getOrNewObject(name);
            Register register = programBuilder.getOrCreateRegister(scope, name, ARCH_PRECISION);
            programBuilder.addChild(currentThread, EventFactory.newLocal(register, object));
        }
    }
    return null;
}
Also used : Register(com.dat3m.dartagnan.program.Register) LitmusCParser(com.dat3m.dartagnan.parsers.LitmusCParser) MemoryObject(com.dat3m.dartagnan.program.memory.MemoryObject)

Example 93 with Register

use of com.dat3m.dartagnan.program.Register in project Dat3M by hernanponcedeleon.

the class VisitorLitmusC method visitReOpBool.

@Override
public ExprInterface visitReOpBool(LitmusCParser.ReOpBoolContext ctx) {
    Register register = getReturnRegister(false);
    ExprInterface v1 = (ExprInterface) ctx.re(0).accept(this);
    ExprInterface v2 = (ExprInterface) ctx.re(1).accept(this);
    BExprBin result = new BExprBin(v1, ctx.opBool().op, v2);
    return assignToReturnRegister(register, result);
}
Also used : Register(com.dat3m.dartagnan.program.Register)

Example 94 with Register

use of com.dat3m.dartagnan.program.Register in project Dat3M by hernanponcedeleon.

the class VisitorLitmusC method visitReXchg.

@Override
public IExpr visitReXchg(LitmusCParser.ReXchgContext ctx) {
    Register register = getReturnRegister(true);
    IExpr value = (IExpr) ctx.value.accept(this);
    Event event = EventFactory.Linux.newRMWExchange(getAddress(ctx.address), register, value, ctx.mo);
    programBuilder.addChild(currentThread, event);
    return register;
}
Also used : Register(com.dat3m.dartagnan.program.Register) Event(com.dat3m.dartagnan.program.event.core.Event)

Example 95 with Register

use of com.dat3m.dartagnan.program.Register in project Dat3M by hernanponcedeleon.

the class VisitorLitmusC method visitReConst.

@Override
public ExprInterface visitReConst(LitmusCParser.ReConstContext ctx) {
    Register register = getReturnRegister(false);
    IValue result = new IValue(new BigInteger(ctx.getText()), ARCH_PRECISION);
    return assignToReturnRegister(register, result);
}
Also used : Register(com.dat3m.dartagnan.program.Register) BigInteger(java.math.BigInteger)

Aggregations

Register (com.dat3m.dartagnan.program.Register)154 MemoryObject (com.dat3m.dartagnan.program.memory.MemoryObject)29 Event (com.dat3m.dartagnan.program.event.core.Event)25 IExpr (com.dat3m.dartagnan.expression.IExpr)16 RegWriter (com.dat3m.dartagnan.program.event.core.utils.RegWriter)15 ProgramBuilder (com.dat3m.dartagnan.parsers.program.utils.ProgramBuilder)13 AliasAnalysis (com.dat3m.dartagnan.program.analysis.AliasAnalysis)12 Label (com.dat3m.dartagnan.program.event.core.Label)11 ParsingException (com.dat3m.dartagnan.exception.ParsingException)10 BigInteger (java.math.BigInteger)8 IConst (com.dat3m.dartagnan.expression.IConst)7 IExprBin (com.dat3m.dartagnan.expression.IExprBin)6 IValue (com.dat3m.dartagnan.expression.IValue)6 IOpBin (com.dat3m.dartagnan.expression.op.IOpBin)6 Program (com.dat3m.dartagnan.program.Program)6 Dependency (com.dat3m.dartagnan.program.analysis.Dependency)6 ExprInterface (com.dat3m.dartagnan.expression.ExprInterface)5 Thread (com.dat3m.dartagnan.program.Thread)5 java.util (java.util)5 Atom (com.dat3m.dartagnan.expression.Atom)4