mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-13 10:32:06 +00:00
Convert to use the new factored out TargetData class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@381 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3a13c7e56f
commit
e3860e5be5
@ -27,23 +27,14 @@
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
UltraSparc::UltraSparc()
|
UltraSparc::UltraSparc()
|
||||||
: TargetMachine(new UltraSparcInstrInfo)
|
: TargetMachine("UltraSparc-Native", new UltraSparcInstrInfo()) {
|
||||||
{
|
|
||||||
optSizeForSubWordData = 4;
|
optSizeForSubWordData = 4;
|
||||||
intSize = 4;
|
|
||||||
floatSize = 4;
|
|
||||||
longSize = 8;
|
|
||||||
doubleSize = 8;
|
|
||||||
longDoubleSize = 16;
|
|
||||||
pointerSize = 8;
|
|
||||||
minMemOpWordSize = 8;
|
minMemOpWordSize = 8;
|
||||||
maxAtomicMemOpWordSize = 8;
|
maxAtomicMemOpWordSize = 8;
|
||||||
zeroRegNum = 0; // %g0 always gives 0 on Sparc
|
zeroRegNum = 0; // %g0 always gives 0 on Sparc
|
||||||
}
|
}
|
||||||
|
|
||||||
UltraSparc::~UltraSparc()
|
UltraSparc::~UltraSparc() {
|
||||||
{
|
|
||||||
delete (UltraSparcInstrInfo*) machineInstrInfo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//**************************************************************************/
|
//**************************************************************************/
|
||||||
|
@ -1347,8 +1347,7 @@ SetMemOperands_Internal(MachineInstr* minstr,
|
|||||||
isConstantOffset = true;
|
isConstantOffset = true;
|
||||||
|
|
||||||
// Compute the offset value using the index vector
|
// Compute the offset value using the index vector
|
||||||
offset = MemAccessInst::getIndexedOfsetForTarget(ptrType,
|
offset = target.DataLayout.getIndexedOffset(ptrType, idxVec);
|
||||||
idxVec, target);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1359,13 +1358,12 @@ SetMemOperands_Internal(MachineInstr* minstr,
|
|||||||
assert(arrayOffsetVal != NULL
|
assert(arrayOffsetVal != NULL
|
||||||
&& "Expect to be given Value* for array offsets");
|
&& "Expect to be given Value* for array offsets");
|
||||||
|
|
||||||
if (arrayOffsetVal->getValueType() == Value::ConstantVal)
|
if (ConstPoolVal *CPV = arrayOffsetVal->castConstant()) {
|
||||||
{
|
|
||||||
isConstantOffset = true; // always constant for structs
|
isConstantOffset = true; // always constant for structs
|
||||||
assert(arrayOffsetVal->getType()->isIntegral());
|
assert(arrayOffsetVal->getType()->isIntegral());
|
||||||
offset = (arrayOffsetVal->getType()->isSigned())
|
offset = (CPV->getType()->isSigned())
|
||||||
? ((ConstPoolSInt*) arrayOffsetVal)->getValue()
|
? ((ConstPoolSInt*)CPV)->getValue()
|
||||||
: (int64_t) ((ConstPoolUInt*) arrayOffsetVal)->getValue();
|
: (int64_t) ((ConstPoolUInt*)CPV)->getValue();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user