Discussion:
Valgrind: r16395 - in /trunk/none/tests/mips32: LoadStore.c LoadStore1.c
(too old to reply)
s***@valgrind.org
2017-05-17 15:35:48 UTC
Permalink
Raw Message
Author: petarj
Date: Wed May 17 16:35:48 2017
New Revision: 16395

Log:
mips32: update clobbers in none/mips32/LoadStore tests

Add missing registers to clobbers.

Modified:
trunk/none/tests/mips32/LoadStore.c
trunk/none/tests/mips32/LoadStore1.c

Modified: trunk/none/tests/mips32/LoadStore.c
==============================================================================
--- trunk/none/tests/mips32/LoadStore.c (original)
+++ trunk/none/tests/mips32/LoadStore.c Wed May 17 16:35:48 2017
@@ -22,51 +22,52 @@

// sb $t0, 0($t1)
#define TESTINST1(instruction, RTval, offset, RT, RS) \
-{ \
- unsigned int out; \
- __asm__ volatile( \
- "move $" #RS", %1\n\t" \
- "li $" #RT", " #RTval"\n\t" \
- instruction "\n\t" \
- "lw %0, "#offset"($"#RS")\n\t" \
- : "=&r" (out) \
- : "r" (mem1), "r" (RTval) \
- : #RT, "cc", "memory" \
- ); \
- printf("%s :: RTval: 0x%x, out: 0x%x\n", \
- instruction, RTval, out); \
- out = 0; \
- __asm__ volatile( \
- "move $" #RS", %1\n\t" \
- "li $" #RT", " #RTval"\n\t" \
- instruction "\n\t" \
- "lw %0, "#offset"($"#RS")\n\t" \
- : "=&r" (out) \
- : "r" (mem), "r" (RTval) \
- : #RT, "cc", "memory" \
- ); \
- printf("%s :: RTval: 0x%x, out: 0x%x\n", \
- instruction, RTval, out); \
+{ \
+ unsigned int out; \
+ __asm__ volatile( \
+ "move $" #RS", %1 \n\t" \
+ "li $" #RT", " #RTval" \n\t" \
+ instruction " \n\t" \
+ "lw %0, "#offset"($"#RS") \n\t" \
+ : "=&r" (out) \
+ : "r" (mem1), "r" (RTval) \
+ : #RS, #RT, "memory" \
+ ); \
+ printf("%s :: RTval: 0x%x, out: 0x%x\n", \
+ instruction, RTval, out); \
+ out = 0; \
+ __asm__ volatile( \
+ "move $" #RS", %1 \n\t" \
+ "li $" #RT", " #RTval " \n\t" \
+ instruction " \n\t" \
+ "lw %0, "#offset"($"#RS") \n\t" \
+ : "=&r" (out) \
+ : "r" (mem), "r" (RTval) \
+ : #RS, #RT, "memory" \
+ ); \
+ printf("%s :: RTval: 0x%x, out: 0x%x\n", \
+ instruction, RTval, out); \
}

// swl $t0, 3($t1)
// swr $t0, 0($t1)
-#define TESTINSTsw(RTval, offset, RT, RS) \
-{ \
- unsigned int out; \
- __asm__ volatile( \
- "move $" #RS", %1\n\t" \
- "addiu $"#RS", $"#RS", "#offset"\n\t" \
- "li $" #RT", " #RTval"\n\t" \
- "swl $t0, 3($t1) \n\t" \
- "swr $t0, 0($t1) \n\t" \
- "lw %0, 0($"#RS")\n\t" \
- : "=&r" (out) \
- : "r" (mem2), "r" (RTval) \
- : #RT, #RS, "cc", "memory" \
- ); \
- printf("swl $t0, 3($t1)\nswr $t0, 0($t1)\n :: RTval: 0x%x, out: 0x%x\n", \
- RTval, out); \
+#define TESTINSTsw(RTval, offset, RT, RS) \
+{ \
+ unsigned int out; \
+ __asm__ volatile( \
+ "move $" #RS", %1\n\t" \
+ "addiu $"#RS", $"#RS", "#offset" \n\t" \
+ "li $" #RT", " #RTval" \n\t" \
+ "swl $t0, 3($t1) \n\t" \
+ "swr $t0, 0($t1) \n\t" \
+ "lw %0, 0($"#RS") \n\t" \
+ : "=&r" (out) \
+ : "r" (mem2), "r" (RTval) \
+ : #RT, #RS, "memory" \
+ ); \
+ printf("swl $t0, 3($t1)\nswr $t0, 0($t1)\n" \
+ " :: RTval: 0x%x, out: 0x%x\n", \
+ RTval, out); \
}

void ppMem(unsigned int* m, int len)

Modified: trunk/none/tests/mips32/LoadStore1.c
==============================================================================
--- trunk/none/tests/mips32/LoadStore1.c (original)
+++ trunk/none/tests/mips32/LoadStore1.c Wed May 17 16:35:48 2017
@@ -22,51 +22,52 @@

// sb $t0, 0($t1)
#define TESTINST1(instruction, RTval, offset, RT, RS) \
-{ \
- unsigned int out; \
- __asm__ volatile( \
- "move $" #RS", %1\n\t" \
- "li $" #RT", " #RTval"\n\t" \
- instruction "\n\t" \
- "lw %0, "#offset"($"#RS")\n\t" \
- : "=&r" (out) \
- : "r" (mem1), "r" (RTval) \
- : #RT, "cc", "memory" \
- ); \
- printf("%s :: RTval: 0x%x, out: 0x%x\n", \
- instruction, RTval, out); \
- out = 0; \
- __asm__ volatile( \
- "move $" #RS", %1\n\t" \
- "li $" #RT", " #RTval"\n\t" \
- instruction "\n\t" \
- "lw %0, "#offset"($"#RS")\n\t" \
- : "=&r" (out) \
- : "r" (mem), "r" (RTval) \
- : #RT, "cc", "memory" \
- ); \
- printf("%s :: RTval: 0x%x, out: 0x%x\n", \
- instruction, RTval, out); \
+{ \
+ unsigned int out; \
+ __asm__ volatile( \
+ "move $" #RS", %1 \n\t" \
+ "li $" #RT", " #RTval" \n\t" \
+ instruction " \n\t" \
+ "lw %0, "#offset"($"#RS") \n\t" \
+ : "=&r" (out) \
+ : "r" (mem1), "r" (RTval) \
+ : #RS, #RT, "memory" \
+ ); \
+ printf("%s :: RTval: 0x%x, out: 0x%x\n", \
+ instruction, RTval, out); \
+ out = 0; \
+ __asm__ volatile( \
+ "move $" #RS", %1 \n\t" \
+ "li $" #RT", " #RTval " \n\t" \
+ instruction " \n\t" \
+ "lw %0, "#offset"($"#RS") \n\t" \
+ : "=&r" (out) \
+ : "r" (mem), "r" (RTval) \
+ : #RS, #RT, "memory" \
+ ); \
+ printf("%s :: RTval: 0x%x, out: 0x%x\n", \
+ instruction, RTval, out); \
}

// swl $t0, 3($t1)
// swr $t0, 0($t1)
-#define TESTINSTsw(RTval, offset, RT, RS) \
-{ \
- unsigned int out; \
- __asm__ volatile( \
- "move $" #RS", %1\n\t" \
- "addiu $"#RS", $"#RS", "#offset"\n\t" \
- "li $" #RT", " #RTval"\n\t" \
- "swl $t0, 3($t1) \n\t" \
- "swr $t0, 0($t1) \n\t" \
- "lw %0, 0($"#RS")\n\t" \
- : "=&r" (out) \
- : "r" (mem2), "r" (RTval) \
- : #RT, #RS, "cc", "memory" \
- ); \
- printf("swl $t0, 3($t1)\nswr $t0, 0($t1)\n :: RTval: 0x%x, out: 0x%x\n", \
- RTval, out); \
+#define TESTINSTsw(RTval, offset, RT, RS) \
+{ \
+ unsigned int out; \
+ __asm__ volatile( \
+ "move $" #RS", %1\n\t" \
+ "addiu $"#RS", $"#RS", "#offset" \n\t" \
+ "li $" #RT", " #RTval" \n\t" \
+ "swl $t0, 3($t1) \n\t" \
+ "swr $t0, 0($t1) \n\t" \
+ "lw %0, 0($"#RS") \n\t" \
+ : "=&r" (out) \
+ : "r" (mem2), "r" (RTval) \
+ : #RT, #RS, "memory" \
+ ); \
+ printf("swl $t0, 3($t1)\nswr $t0, 0($t1)\n" \
+ " :: RTval: 0x%x, out: 0x%x\n", \
+ RTval, out); \
}

void ppMem(unsigned int* m, int len)

Loading...