Search in sources :

Example 46 with Register

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

the class VisitorLitmusC method visitReReadOnce.

@Override
public IExpr visitReReadOnce(LitmusCParser.ReReadOnceContext ctx) {
    Register register = getReturnRegister(true);
    Event event = EventFactory.newLoad(register, getAddress(ctx.address), 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 47 with Register

use of com.dat3m.dartagnan.program.Register 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;
}
Also used : Register(com.dat3m.dartagnan.program.Register) Event(com.dat3m.dartagnan.program.event.core.Event)

Example 48 with Register

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

the class VisitorLitmusC method visitReOpArith.

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

Example 49 with Register

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

the class VisitorLitmusC method visitReOpCompare.

// ----------------------------------------------------------------------------------------------------------------
// Return expressions (register for return value is optional)
@Override
public ExprInterface visitReOpCompare(LitmusCParser.ReOpCompareContext ctx) {
    Register register = getReturnRegister(false);
    ExprInterface v1 = (ExprInterface) ctx.re(0).accept(this);
    ExprInterface v2 = (ExprInterface) ctx.re(1).accept(this);
    Atom result = new Atom(v1, ctx.opCompare().op, v2);
    return assignToReturnRegister(register, result);
}
Also used : Register(com.dat3m.dartagnan.program.Register)

Example 50 with Register

use of com.dat3m.dartagnan.program.Register 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;
}
Also used : Register(com.dat3m.dartagnan.program.Register) Event(com.dat3m.dartagnan.program.event.core.Event)

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