mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-22 13:29:44 +00:00
Read volatile loads/stores
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8401 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bd9df30983
commit
dba2b225c8
@ -405,18 +405,20 @@ bool BytecodeParser::ParseInstruction(const unsigned char *&Buf,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 62: // volatile load
|
||||||
case Instruction::Load:
|
case Instruction::Load:
|
||||||
if (Raw.NumOperands != 1) return true;
|
if (Raw.NumOperands != 1) return true;
|
||||||
if (!isa<PointerType>(Raw.Ty)) return true;
|
if (!isa<PointerType>(Raw.Ty)) return true;
|
||||||
Res = new LoadInst(getValue(Raw.Ty, Raw.Arg1));
|
Res = new LoadInst(getValue(Raw.Ty, Raw.Arg1), "", Raw.Opcode == 62);
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
case 63: // volatile store
|
||||||
case Instruction::Store: {
|
case Instruction::Store: {
|
||||||
if (!isa<PointerType>(Raw.Ty) || Raw.NumOperands != 2) return true;
|
if (!isa<PointerType>(Raw.Ty) || Raw.NumOperands != 2) return true;
|
||||||
|
|
||||||
Value *Ptr = getValue(Raw.Ty, Raw.Arg2);
|
Value *Ptr = getValue(Raw.Ty, Raw.Arg2);
|
||||||
const Type *ValTy = cast<PointerType>(Ptr->getType())->getElementType();
|
const Type *ValTy = cast<PointerType>(Ptr->getType())->getElementType();
|
||||||
Res = new StoreInst(getValue(ValTy, Raw.Arg1), Ptr);
|
Res = new StoreInst(getValue(ValTy, Raw.Arg1), Ptr, Raw.Opcode == 63);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} // end switch(Raw.Opcode)
|
} // end switch(Raw.Opcode)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user