|
|
@ -979,6 +979,7 @@ namespace findLSB |
|
|
|
{0x00000000, -1} |
|
|
|
{0x00000000, -1} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# if GLM_HAS_BITSCAN_WINDOWS |
|
|
|
template <typename genIUType> |
|
|
|
template <typename genIUType> |
|
|
|
GLM_FUNC_QUALIFIER int findLSB_intrinsic(genIUType Value) |
|
|
|
GLM_FUNC_QUALIFIER int findLSB_intrinsic(genIUType Value) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -991,6 +992,7 @@ namespace findLSB |
|
|
|
_BitScanForward(&Result, Value); |
|
|
|
_BitScanForward(&Result, Value); |
|
|
|
return int(Result); |
|
|
|
return int(Result); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
# endif |
|
|
|
|
|
|
|
|
|
|
|
template <typename genIUType> |
|
|
|
template <typename genIUType> |
|
|
|
GLM_FUNC_QUALIFIER int findLSB_095(genIUType Value) |
|
|
|
GLM_FUNC_QUALIFIER int findLSB_095(genIUType Value) |
|
|
@ -1039,11 +1041,13 @@ namespace findLSB |
|
|
|
Error += DataI32[i].Return == Result ? 0 : 1; |
|
|
|
Error += DataI32[i].Return == Result ? 0 : 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# if GLM_HAS_BITSCAN_WINDOWS |
|
|
|
for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(type<int>); ++i) |
|
|
|
for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(type<int>); ++i) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int Result = findLSB_intrinsic(DataI32[i].Value); |
|
|
|
int Result = findLSB_intrinsic(DataI32[i].Value); |
|
|
|
Error += DataI32[i].Return == Result ? 0 : 1; |
|
|
|
Error += DataI32[i].Return == Result ? 0 : 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
# endif |
|
|
|
|
|
|
|
|
|
|
|
for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(type<int>); ++i) |
|
|
|
for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(type<int>); ++i) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -1094,12 +1098,14 @@ namespace findLSB |
|
|
|
|
|
|
|
|
|
|
|
std::clock_t Timestamps2 = std::clock(); |
|
|
|
std::clock_t Timestamps2 = std::clock(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# if GLM_HAS_BITSCAN_WINDOWS |
|
|
|
for(std::size_t k = 0; k < Count; ++k) |
|
|
|
for(std::size_t k = 0; k < Count; ++k) |
|
|
|
for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(type<int>); ++i) |
|
|
|
for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(type<int>); ++i) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int Result = findLSB_intrinsic(DataI32[i].Value); |
|
|
|
int Result = findLSB_intrinsic(DataI32[i].Value); |
|
|
|
Error += DataI32[i].Return == Result ? 0 : 1; |
|
|
|
Error += DataI32[i].Return == Result ? 0 : 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
# endif |
|
|
|
|
|
|
|
|
|
|
|
std::clock_t Timestamps3 = std::clock(); |
|
|
|
std::clock_t Timestamps3 = std::clock(); |
|
|
|
|
|
|
|
|
|
|
@ -1123,7 +1129,11 @@ namespace findLSB |
|
|
|
|
|
|
|
|
|
|
|
std::printf("glm::findLSB: %d clocks\n", static_cast<unsigned int>(Timestamps1 - Timestamps0)); |
|
|
|
std::printf("glm::findLSB: %d clocks\n", static_cast<unsigned int>(Timestamps1 - Timestamps0)); |
|
|
|
std::printf("findLSB - 0.9.5: %d clocks\n", static_cast<unsigned int>(Timestamps2 - Timestamps1)); |
|
|
|
std::printf("findLSB - 0.9.5: %d clocks\n", static_cast<unsigned int>(Timestamps2 - Timestamps1)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# if GLM_HAS_BITSCAN_WINDOWS |
|
|
|
std::printf("findLSB - intrinsics: %d clocks\n", static_cast<unsigned int>(Timestamps3 - Timestamps2)); |
|
|
|
std::printf("findLSB - intrinsics: %d clocks\n", static_cast<unsigned int>(Timestamps3 - Timestamps2)); |
|
|
|
|
|
|
|
# endif |
|
|
|
|
|
|
|
|
|
|
|
std::printf("findLSB - ntz2: %d clocks\n", static_cast<unsigned int>(Timestamps4 - Timestamps3)); |
|
|
|
std::printf("findLSB - ntz2: %d clocks\n", static_cast<unsigned int>(Timestamps4 - Timestamps3)); |
|
|
|
std::printf("findLSB - branchfree: %d clocks\n", static_cast<unsigned int>(Timestamps5 - Timestamps4)); |
|
|
|
std::printf("findLSB - branchfree: %d clocks\n", static_cast<unsigned int>(Timestamps5 - Timestamps4)); |
|
|
|
|
|
|
|
|
|
|
|