Fixed usubBorrw
This commit is contained in:
parent
00e860eeee
commit
3f327d5e70
@ -110,10 +110,10 @@ namespace glm
|
|||||||
GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch");
|
GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch");
|
||||||
|
|
||||||
Borrow = x >= y ? static_cast<uint32>(0) : static_cast<uint32>(1);
|
Borrow = x >= y ? static_cast<uint32>(0) : static_cast<uint32>(1);
|
||||||
if(x > y)
|
if(y >= x)
|
||||||
return static_cast<uint32>(static_cast<int64>(x) - static_cast<int64>(y));
|
return y - x;
|
||||||
else
|
else
|
||||||
return static_cast<uint32>((static_cast<int64>(1) << static_cast<int64>(32)) + static_cast<int64>(x) - static_cast<int64>(y));
|
return static_cast<uint32>((static_cast<int64>(1) << static_cast<int64>(32)) + (static_cast<int64>(y) - static_cast<int64>(x)));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
|
@ -48,6 +48,7 @@ GLM 0.9.5.3: 2014-0X-XX
|
|||||||
- Added support for all extensions but GTX_string_cast to CUDA
|
- Added support for all extensions but GTX_string_cast to CUDA
|
||||||
- Fixed strict aliasing warnings in GCC 4.8.1 / Android NDK 9c (#152)
|
- Fixed strict aliasing warnings in GCC 4.8.1 / Android NDK 9c (#152)
|
||||||
- Fixed missing bitfieldInterleave definisions
|
- Fixed missing bitfieldInterleave definisions
|
||||||
|
- Fixed usubBorrow (#171)
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
GLM 0.9.5.2: 2014-02-08
|
GLM 0.9.5.2: 2014-02-08
|
||||||
|
@ -197,14 +197,14 @@ namespace findLSB
|
|||||||
genType Value;
|
genType Value;
|
||||||
genType Return;
|
genType Return;
|
||||||
};
|
};
|
||||||
|
|
||||||
type<int> const DataI32[] =
|
type<int> const DataI32[] =
|
||||||
{
|
{
|
||||||
{0x00000001, 0},
|
{0x00000001, 0},
|
||||||
{0x00000003, 0},
|
{0x00000003, 0},
|
||||||
{0x00000002, 1}
|
{0x00000002, 1}
|
||||||
};
|
};
|
||||||
|
|
||||||
int test()
|
int test()
|
||||||
{
|
{
|
||||||
int Error(0);
|
int Error(0);
|
||||||
@ -215,11 +215,27 @@ namespace findLSB
|
|||||||
Error += DataI32[i].Return == Result ? 0 : 1;
|
Error += DataI32[i].Return == Result ? 0 : 1;
|
||||||
assert(!Error);
|
assert(!Error);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Error;
|
return Error;
|
||||||
}
|
}
|
||||||
}//findLSB
|
}//findLSB
|
||||||
|
|
||||||
|
namespace usubBorrow
|
||||||
|
{
|
||||||
|
int test()
|
||||||
|
{
|
||||||
|
int Error(0);
|
||||||
|
|
||||||
|
glm::uint x = 16;
|
||||||
|
glm::uint y = 17;
|
||||||
|
glm::uint Borrow = 0;
|
||||||
|
glm::uint Result = glm::usubBorrow(x, y, Borrow);
|
||||||
|
|
||||||
|
return Error;
|
||||||
|
}
|
||||||
|
|
||||||
|
}//namespace usubBorrow
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
int Error = 0;
|
int Error = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user