mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-04 02:18:37 +00:00
This set of tests covers MIPS r6 specific instructions: none/tests/mips32/MIPS32r6int none/tests/mips32/branch_pc none/tests/mips32/branches_r6 none/tests/mips32/fp_r6 none/tests/mips32/pc_instructions_r6 none/tests/mips64/MIPS64r6int none/tests/mips64/branch_pc none/tests/mips64/branches_r6 none/tests/mips64/fp_r6 none/tests/mips64/pc_instructions_r6 none/tests/mips64/r6_instructions The following tests had to be changed to be applicaple for Rev6: none/tests/libvex_test.c none/tests/mips32/LoadStore none/tests/mips32/LoadStore1 none/tests/mips32/MIPS32int none/tests/mips32/MoveIns none/tests/mips32/branches none/tests/mips32/change_fp_mode none/tests/mips32/mips32_dsp none/tests/mips32/vfp none/tests/mips64/arithmetic_instruction none/tests/mips64/branches none/tests/mips64/fpu_arithmetic none/tests/mips64/fpu_load_store none/tests/mips64/load_store none/tests/mips64/load_store_multiple none/tests/mips64/move_instructions The following tests are not applicable for Rev6: none/tests/mips32/fpu_branches none/tests/mips32/unaligned_load_store none/tests/mips64/branch_and_jump_instructions none/tests/mips64/change_fp_mode none/tests/mips64/fpu_branches none/tests/mips64/load_store_unaligned none/tests/mips64/unaligned_load none/tests/mips64/unaligned_load_store. Contributed by: Tamara Vlahovic, Aleksandar Rikalo and Aleksandra Karadzic. Related BZ issue - #387410.
69 lines
2.1 KiB
C
69 lines
2.1 KiB
C
#include <stdio.h>
|
|
unsigned int mem[] = {
|
|
0xaabbccdd, 0x11223344, 0x01823194, 0x01823a08,
|
|
0x00000000, 0x77ff528c, 0x77deb460, 0x00000001
|
|
};
|
|
|
|
void printMem(char* s)
|
|
{
|
|
int i;
|
|
printf("%s\n", s);
|
|
for (i=0; i<7 ; i=i+1)
|
|
printf("mem[%d]: 0x%x\n", i, mem[i]);
|
|
}
|
|
|
|
int main ()
|
|
{
|
|
#if (__mips_isa_rev<6)
|
|
printMem("PRE lwl");
|
|
__asm__ volatile("move $a0, %0" "\n\t"
|
|
"lw $t0, 0($a0)" "\n\t"
|
|
"lwl $t0, 4($a0)" "\n\t"
|
|
"sw $t0, 8($a0)" "\n\t"
|
|
"lw $t1, 0($a0)" "\n\t"
|
|
"lwl $t1, 5($a0)" "\n\t"
|
|
"sw $t1, 12($a0)" "\n\t"
|
|
"lw $t2, 0($a0)" "\n\t"
|
|
"lwl $t2, 6($a0)" "\n\t"
|
|
"sw $t2, 16($a0)" "\n\t"
|
|
"lw $t3, 0($a0)" "\n\t"
|
|
"lwl $t3, 7($a0)" "\n\t"
|
|
"sw $t3, 20($a0)" "\n\t"
|
|
:
|
|
: "r" (mem)
|
|
: "a0", "t0", "t1", "t2", "t3", "cc", "memory"
|
|
);
|
|
printMem("POST lwl");
|
|
|
|
mem[0] = 0xaabbccdd;
|
|
mem[1] = 0x11223344;
|
|
mem[2] = 0x01823194;
|
|
mem[3] = 0x01823a08;
|
|
mem[4] = 0x00000000;
|
|
mem[5] = 0x77ff528c;
|
|
mem[6] = 0x77deb460;
|
|
mem[7] = 0x00000001;
|
|
|
|
printMem("PRE lwr");
|
|
__asm__ volatile("move $a0, %0" "\n\t"
|
|
"lw $t0, 0($a0)" "\n\t"
|
|
"lwr $t0, 4($a0)" "\n\t"
|
|
"sw $t0, 8($a0)" "\n\t"
|
|
"lw $t1, 0($a0)" "\n\t"
|
|
"lwr $t1, 5($a0)" "\n\t"
|
|
"sw $t1, 12($a0)" "\n\t"
|
|
"lw $t2, 0($a0)" "\n\t"
|
|
"lwr $t2, 6($a0)" "\n\t"
|
|
"sw $t2, 16($a0)" "\n\t"
|
|
"lw $t3, 0($a0)" "\n\t"
|
|
"lwr $t3, 7($a0)" "\n\t"
|
|
"sw $t3, 20($a0)" "\n\t"
|
|
:
|
|
: "r" (mem)
|
|
: "a0", "t0", "t1", "t2", "t3", "cc", "memory"
|
|
);
|
|
printMem("POST lwr");
|
|
#endif
|
|
return 0;
|
|
}
|