|
From: <sv...@va...> - 2015-03-28 00:59:40
|
Author: petarj
Date: Sat Mar 28 00:59:32 2015
New Revision: 15043
Log:
mips64: extend the test with new cases for Cavium SEQI and SNEI
Extend the test to introduce cases for SEQI and SNEI when immediate is
equal to the content of the GPR rs. Minor code style changes added.
Patch by Maran Pakkirisamy.
Related issue - BZ #341997.
Modified:
trunk/none/tests/mips64/cvm_ins.c
trunk/none/tests/mips64/cvm_ins.stdout.exp
Modified: trunk/none/tests/mips64/cvm_ins.c
==============================================================================
--- trunk/none/tests/mips64/cvm_ins.c (original)
+++ trunk/none/tests/mips64/cvm_ins.c Sat Mar 28 00:59:32 2015
@@ -98,7 +98,7 @@
printf("%s :: rd 0x%lx rs 0x%x, rt 0x%x\n", \
instruction, out, RSVal, RTval); \
}
-#define TESTINST3(instruction, RSVal, RT, RS,imm) \
+#define TESTINST3(instruction, RSVal, RT, RS, imm) \
{ \
unsigned long out; \
__asm__ volatile( \
@@ -127,35 +127,35 @@
switch(op) {
case EXTS: { /* To extract and sign-extend a bit field that starts
from the lower 32 bits of a register. */
- for(i = 0; i <= 255; i+=4)
+ for (i = 0; i <= 255; i+=4)
TESTINST1("exts $t1, $t2, 1, 7", reg_val[i], t1, t2, 1, 7);
break;
}
case EXTS32: { /* To extract and sign-extend a bit field that starts
from the upper 32 bits of a register. */
- for(i = 0; i <= 255; i+=4)
+ for (i = 0; i <= 255; i+=4)
TESTINST1("exts32 $t1, $t2, 1 , 7", reg_val[i], t1, t2, 1, 7);
break;
}
case CINS:{ /* To insert a bit field that starts in the lower 32 bits
of a register. */
- for(i = 0; i <= 255; i+=4)
+ for (i = 0; i <= 255; i+=4)
TESTINST1("cins $t1, $t2, 2 , 9", reg_val[i], t1, t2, 2, 9);
break;
}
case CINS32: { /* To insert a bit field that starts in the upper
32 bits of a register. */
- for(i =0; i <= 255; i+=4)
+ for (i =0; i <= 255; i+=4)
TESTINST1("cins32 $t1, $t2, 2 , 9", reg_val[i], t1, t2, 2, 9);
break;
}
case SEQ: { /* To record the result of an equals comparison. */
- for(i = 0; i <= 255; i+=4)
- for(j = 0; j <= 255; j+=4)
+ for (i = 0; i <= 255; i+=4)
+ for (j = 0; j <= 255; j+=4)
TESTINST2("seq $t1, $t2 ,$t3 ", reg_val[i], reg_val[j],
t1, t2, t3);
break;
@@ -163,14 +163,18 @@
case SEQI: { /* To record the result of an equals comparison
with a constant. */
- for(i = 0; i <= 255; i+=4)
+ /* First, make sure at least one testcase has source value (rs)
+ that equals the immediate value to validate the true case. */
+ const int immvalue = 9;
+ TESTINST3("seqi $t1, $t2 ,9 ", immvalue, t1, t2, immvalue);
+ for (i = 0; i <= 255; i+=4)
TESTINST3("seqi $t1, $t2 ,9 ", reg_val[i], t1, t2, 9);
break;
}
case SNE: { /* To record the result of a not equals comparison. */
- for(i = 0; i <= 255; i+=4)
- for(j = 0; j<= 255; j+=4)
+ for (i = 0; i <= 255; i+=4)
+ for (j = 0; j<= 255; j+=4)
TESTINST2("sne $t1, $t2 ,$t3 ", reg_val[i], reg_val[j],
t1, t2, t3);
break;
@@ -178,15 +182,19 @@
case SNEI: { /* To record the result of a not equals comparison
with a constant. */
- for(i = 0; i <= 255; i+=1)
+ /* First, make sure at least one testcase has source value (rs)
+ that equals the immediate value to validate the false case. */
+ const int immvalue = 9;
+ TESTINST3("snei $t1, $t2 ,9 ", immvalue, t1, t2, immvalue);
+ for (i = 0; i <= 255; i+=1)
TESTINST3("snei $t1, $t2 ,9 ", reg_val[i], t1, t2, 9);
break;
}
case DMUL: { /* To multiply 64-bit signed integers and
write the result to a GPR. */
- for(i = 0; i <= 255; i+=4)
- for(j = 0; j <= 255; j+=8)
+ for (i = 0; i <= 255; i+=4)
+ for (j = 0; j <= 255; j+=8)
TESTINST2("dmul $t1, $t2 ,$t3 ", reg_val[i], reg_val[j],
t1, t2, t3);
break;
Modified: trunk/none/tests/mips64/cvm_ins.stdout.exp
==============================================================================
--- trunk/none/tests/mips64/cvm_ins.stdout.exp (original)
+++ trunk/none/tests/mips64/cvm_ins.stdout.exp Sat Mar 28 00:59:32 2015
@@ -254,6 +254,7 @@
cins32 $t1, $t2, 2 , 9 :: rt 0xf5400000000 rs 0x9abc8bd5, p 0x00000002, lenm1 0x00000009
cins32 $t1, $t2, 2 , 9 :: rt 0x2c400000000 rs 0xafb010b1, p 0x00000002, lenm1 0x00000009
cins32 $t1, $t2, 2 , 9 :: rt 0x9b400000000 rs 0xbcb4666d, p 0x00000002, lenm1 0x00000009
+snei $t1, $t2 ,9 :: rt 0x0 rs 0x9,imm 0x00000009
snei $t1, $t2 ,9 :: rt 0x1 rs 0x0,imm 0x00000009
snei $t1, $t2 ,9 :: rt 0x1 rs 0x4c11db7,imm 0x00000009
snei $t1, $t2 ,9 :: rt 0x1 rs 0x9823b6e,imm 0x00000009
@@ -4606,6 +4607,7 @@
sne $t1, $t2 ,$t3 :: rd 0x1 rs 0xbcb4666d, rt 0x9abc8bd5
sne $t1, $t2 ,$t3 :: rd 0x1 rs 0xbcb4666d, rt 0xafb010b1
sne $t1, $t2 ,$t3 :: rd 0x0 rs 0xbcb4666d, rt 0xbcb4666d
+seqi $t1, $t2 ,9 :: rt 0x1 rs 0x9,imm 0x00000009
seqi $t1, $t2 ,9 :: rt 0x0 rs 0x0,imm 0x00000009
seqi $t1, $t2 ,9 :: rt 0x0 rs 0x130476dc,imm 0x00000009
seqi $t1, $t2 ,9 :: rt 0x0 rs 0x2608edb8,imm 0x00000009
|