|
From: <sv...@va...> - 2012-07-25 09:49:36
|
weidendo 2012-07-25 10:49:26 +0100 (Wed, 25 Jul 2012)
New Revision: 12780
Log:
Additions to PCMPxSTRx tests to check fix for bug 303963.
Some tests used movdqa triggering a seg fault. Use movdqu instead.
Modified files:
trunk/none/tests/amd64/pcmpstr64.c
trunk/none/tests/amd64/pcmpstr64w.c
Modified: trunk/none/tests/amd64/pcmpstr64w.c (+10 -5)
===================================================================
--- trunk/none/tests/amd64/pcmpstr64w.c 2012-07-24 21:37:50 +01:00 (rev 12779)
+++ trunk/none/tests/amd64/pcmpstr64w.c 2012-07-25 10:49:26 +01:00 (rev 12780)
@@ -308,9 +308,6 @@
UInt validL = ~(zmaskL | -zmaskL); // not(left(zmaskL))
UInt validR = ~(zmaskR | -zmaskR); // not(left(zmaskR))
for (hi = 0; hi < 8; hi++) {
- if ((validL & (1 << hi)) == 0)
- // run off the end of the haystack
- break;
UInt m = 1;
for (ni = 0; ni < 8; ni++) {
if ((validR & (1 << ni)) == 0) break;
@@ -319,6 +316,9 @@
if (argL[i] != argR[ni]) { m = 0; break; }
}
boolRes |= (m << hi);
+ if ((validL & (1 << hi)) == 0)
+ // run off the end of the haystack
+ break;
}
// boolRes is "pre-invalidated"
@@ -574,8 +574,8 @@
memcpy(&block[1], argR, sizeof(V128));
ULong res = 0, flags = 0;
__asm__ __volatile__(
- "movdqa 0(%2), %%xmm2" "\n\t"
- "movdqa 16(%2), %%xmm11" "\n\t"
+ "movdqu 0(%2), %%xmm2" "\n\t"
+ "movdqu 16(%2), %%xmm11" "\n\t"
"pcmpistri $0x0D, %%xmm2, %%xmm11" "\n\t"
//"pcmpistrm $0x0D, %%xmm2, %%xmm11" "\n\t"
//"movd %%xmm0, %%ecx" "\n\t"
@@ -638,6 +638,11 @@
try_istri(wot,h,s, "1111111111111234", "1111111111111234");
try_istri(wot,h,s, "0a11111111111111", "000000000000000a");
try_istri(wot,h,s, "0b11111111111111", "000000000000000a");
+
+ try_istri(wot,h,s, "b111111111111111", "0000000000000000");
+ try_istri(wot,h,s, "0000000000000000", "0000000000000000");
+ try_istri(wot,h,s, "123456789abcdef1", "0000000000000000");
+ try_istri(wot,h,s, "0000000000000000", "123456789abcdef1");
}
Modified: trunk/none/tests/amd64/pcmpstr64.c (+10 -5)
===================================================================
--- trunk/none/tests/amd64/pcmpstr64.c 2012-07-24 21:37:50 +01:00 (rev 12779)
+++ trunk/none/tests/amd64/pcmpstr64.c 2012-07-25 10:49:26 +01:00 (rev 12780)
@@ -305,9 +305,6 @@
UInt validL = ~(zmaskL | -zmaskL); // not(left(zmaskL))
UInt validR = ~(zmaskR | -zmaskR); // not(left(zmaskR))
for (hi = 0; hi < 16; hi++) {
- if ((validL & (1 << hi)) == 0)
- // run off the end of the haystack
- break;
UInt m = 1;
for (ni = 0; ni < 16; ni++) {
if ((validR & (1 << ni)) == 0) break;
@@ -316,6 +313,9 @@
if (argL[i] != argR[ni]) { m = 0; break; }
}
boolRes |= (m << hi);
+ if ((validL & (1 << hi)) == 0)
+ // run off the end of the haystack
+ break;
}
// boolRes is "pre-invalidated"
@@ -573,8 +573,8 @@
memcpy(&block[1], argR, sizeof(V128));
ULong res = 0, flags = 0;
__asm__ __volatile__(
- "movdqa 0(%2), %%xmm2" "\n\t"
- "movdqa 16(%2), %%xmm11" "\n\t"
+ "movdqu 0(%2), %%xmm2" "\n\t"
+ "movdqu 16(%2), %%xmm11" "\n\t"
"pcmpistri $0x0C, %%xmm2, %%xmm11" "\n\t"
//"pcmpistrm $0x0C, %%xmm2, %%xmm11" "\n\t"
//"movd %%xmm0, %%ecx" "\n\t"
@@ -639,6 +639,11 @@
try_istri(wot,h,s, "1111111111111234", "1111111111111234");
try_istri(wot,h,s, "a111111111111111", "000000000000000a");
try_istri(wot,h,s, "b111111111111111", "000000000000000a");
+
+ try_istri(wot,h,s, "b111111111111111", "0000000000000000");
+ try_istri(wot,h,s, "0000000000000000", "0000000000000000");
+ try_istri(wot,h,s, "123456789abcdef1", "0000000000000000");
+ try_istri(wot,h,s, "0000000000000000", "123456789abcdef1");
}
|