powerpc bugfixes

This commit is contained in:
Joel Dice 2009-12-01 09:21:33 -07:00
parent 9ba71cf508
commit 98275e175e
4 changed files with 30 additions and 5 deletions

View File

@ -785,6 +785,10 @@ class Context {
{
if (size == 8) {
switch(op) {
case Absolute:
assert(t, resultSize == 8);
return local::getThunk(t, absoluteLongThunk);
case FloatNegate:
assert(t, resultSize == 8);
return local::getThunk(t, negateDoubleThunk);
@ -819,12 +823,16 @@ class Context {
assert(t, size == 4);
switch(op) {
case Absolute:
assert(t, resultSize == 4);
return local::getThunk(t, absoluteIntThunk);
case FloatNegate:
assert(t, size == 4);
assert(t, resultSize == 4);
return local::getThunk(t, negateFloatThunk);
case FloatAbsolute:
assert(t, size == 4);
assert(t, resultSize == 4);
return local::getThunk(t, absoluteFloatThunk);
case Float2Float:
@ -2160,6 +2168,18 @@ absoluteFloat(uint32_t a)
return floatToBits(fabsf(bitsToFloat(a)));
}
int64_t
absoluteLong(int64_t a)
{
return a > 0 ? a : -a;
}
int64_t
absoluteInt(int32_t a)
{
return a > 0 ? a : -a;
}
int64_t
divideLong(int64_t b, int64_t a)
{

View File

@ -2065,6 +2065,9 @@ class MyArchitecture: public Assembler::Architecture {
*aTypeMask = (1 << RegisterOperand);
break;
case Absolute:
case FloatAbsolute:
case FloatSquareRoot:
case FloatNegate:
case Float2Float:
case Float2Int:
@ -2096,9 +2099,9 @@ class MyArchitecture: public Assembler::Architecture {
}
virtual void planMove
(unsigned size, uint8_t* srcTypeMask, uint64_t* srcRegisterMask,
(unsigned, uint8_t* srcTypeMask, uint64_t* srcRegisterMask,
uint8_t* tmpTypeMask, uint64_t* tmpRegisterMask,
uint8_t dstTypeMask, uint64_t dstRegisterMask)
uint8_t dstTypeMask, uint64_t)
{
*srcTypeMask = ~0;
*srcRegisterMask = ~static_cast<uint64_t>(0);

View File

@ -122,7 +122,7 @@ atomicCompareAndSwap32(uint32_t* p, uint32_t old, uint32_t new_)
inline bool
atomicCompareAndSwap(uintptr_t* p, uintptr_t old, uintptr_t new_)
{
return atomicCompareAndSwap32(p, old, new_);
return atomicCompareAndSwap32(reinterpret_cast<uint32_t*>(p), old, new_);
}
#endif // USE_ATOMIC_OPERATIONS

View File

@ -22,6 +22,8 @@ THUNK(divideFloat)
THUNK(moduloFloat)
THUNK(negateFloat)
THUNK(absoluteFloat)
THUNK(absoluteLong)
THUNK(absoluteInt)
THUNK(divideLong)
THUNK(divideInt)
THUNK(moduloLong)