Improve CPU_ProbePower8() test

pull/696/head
Jeffrey Walton 2018-08-03 01:27:39 -04:00
parent c4ef77bcdb
commit c4eb38b856
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 8 additions and 4 deletions

View File

@ -161,11 +161,15 @@ bool CPU_ProbePower8()
result = false;
else
{
byte b1[19] = {255, 255, 255, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, b2[17];
const uint8x16_p v1 = (uint8x16_p)VectorLoad(0, b1+3);
VectorStore(v1, b2+1);
// POWER8 added 64-bit SIMD operations
const word64 m = W64LIT(0xffffffffffffffff);
word64 w1[2] = {m, m}, w2[2] = {3, 4}, w3[2];
const uint64x2_p v1 = (uint64x2_p)VectorLoad(0, w1);
const uint64x2_p v2 = (uint64x2_p)VectorLoad(0, w2);
VectorStore(VectorAdd(v1, v2), w3);
result = (0 == std::memcmp(b1+3, b2+1, 16));
// The 64-bit add will overflow.
result = (w3[0] == 2 && w3[1] == 3);
}
sigprocmask(SIG_SETMASK, (sigset_t*)&oldMask, NULLPTR);