diff --git a/src/compile.cpp b/src/compile.cpp index 4888778e7b..93f5ca543d 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -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) { diff --git a/src/powerpc.cpp b/src/powerpc.cpp index 63ee6da3b4..9cec9a1cdd 100644 --- a/src/powerpc.cpp +++ b/src/powerpc.cpp @@ -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(0); diff --git a/src/powerpc.h b/src/powerpc.h index 1ef1437e0f..9a55c13266 100644 --- a/src/powerpc.h +++ b/src/powerpc.h @@ -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(p), old, new_); } #endif // USE_ATOMIC_OPERATIONS diff --git a/src/thunks.cpp b/src/thunks.cpp index bab06da664..f55c0018a9 100644 --- a/src/thunks.cpp +++ b/src/thunks.cpp @@ -22,6 +22,8 @@ THUNK(divideFloat) THUNK(moduloFloat) THUNK(negateFloat) THUNK(absoluteFloat) +THUNK(absoluteLong) +THUNK(absoluteInt) THUNK(divideLong) THUNK(divideInt) THUNK(moduloLong)