Skip to content

Commit

Permalink
test cases for vpfxs, vpfxt and vpfxd
Browse files Browse the repository at this point in the history
  • Loading branch information
AngheloAlf committed Apr 21, 2024
1 parent 9cb018f commit b70927f
Show file tree
Hide file tree
Showing 7 changed files with 2,541 additions and 1,262 deletions.
82 changes: 79 additions & 3 deletions adsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,88 @@ def do_vrot():
i = 7
k = 1

for p in range(1 << 1):
for t in range(1 << 1):
for t in range(1 << 1):
for p in range(1 << 1):
if p == 0 and t == 0:
continue
for j in range(1 << 5):
print(f" .word 0x{VFPU6:08X} | 0x{k<<21:08X} | 0x{i << 23:08X} | 0x{j<<16:08X} | 0x{t << 15:08X} | 0x{VS:08X} | 0x{p << 7:08X} | 0x{VD:08X}")
func_end("vrot_test")

do_vrot()
source_target_prefix_instruction_formats = [
"X",
"Y",
"Z",
"W",
"|X|",
"|Y|",
"|Z|",
"|W|",
"0",
"1",
"2",
"1/2",
"3",
"1/3",
"1/4",
"1/6",
"-X",
"-Y",
"-Z",
"-W",
"-|X|",
"-|Y|",
"-|Z|",
"-|W|",
"-0",
"-1",
"-2",
"-1/2",
"-3",
"-1/3",
"-1/4",
"-1/6",
]

def do_vpfxs_and_vpfxt():
# vpfxs
for mnemonic in ["vpfxs", "vpfxt"]:
RPX, RPY, RPZ, RPW = source_target_prefix_instruction_formats[0], source_target_prefix_instruction_formats[0], source_target_prefix_instruction_formats[0], source_target_prefix_instruction_formats[0]

for rpx in source_target_prefix_instruction_formats:
print(f"{mnemonic} {rpx}, {RPY}, {RPZ}, {RPW}")

for rpy in source_target_prefix_instruction_formats:
print(f"{mnemonic} {RPX}, {rpy}, {RPZ}, {RPW}")

for rpz in source_target_prefix_instruction_formats:
print(f"{mnemonic} {RPX}, {RPY}, {rpz}, {RPW}")

for rpw in source_target_prefix_instruction_formats:
print(f"{mnemonic} {RPX}, {RPY}, {RPZ}, {rpw}")

destination_prefix_instruction_formats = [
"",
"0",
"1",
"M",
];

def do_vpfxd():
# vpfxs
mnemonic = "vpfxd"
WPX, WPY, WPZ, WPW = destination_prefix_instruction_formats[0], destination_prefix_instruction_formats[0], destination_prefix_instruction_formats[0], destination_prefix_instruction_formats[0]

for wpx in destination_prefix_instruction_formats:
print(f"{mnemonic} {wpx}, {WPY}, {WPZ}, {WPW}")

for wpy in destination_prefix_instruction_formats:
print(f"{mnemonic} {WPX}, {wpy}, {WPZ}, {WPW}")

for wpz in destination_prefix_instruction_formats:
print(f"{mnemonic} {WPX}, {WPY}, {wpz}, {WPW}")

for wpw in destination_prefix_instruction_formats:
print(f"{mnemonic} {WPX}, {WPY}, {WPZ}, {wpw}")

do_vpfxd()
2 changes: 1 addition & 1 deletion asdf.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,5 +149,5 @@ Error on word '0xDFC0F000'. Expected 'vfim.s S002, -8192.0', got 'vfim.s
InstrIdType: 'R4000ALLEGREX_VFPU5_FMT3'
gnuMode 'true'

tests/c/instruction_checks/r4000allegrex_vfpu_disasm.c: 29 errors out of 5322 entries. 99.46% correct.
tests/c/instruction_checks/r4000allegrex_vfpu_disasm.c: 29 errors out of 5418 entries. 99.46% correct.

104 changes: 104 additions & 0 deletions tests/asm/r4000allegrex/allegrex_vfpu.s
Original file line number Diff line number Diff line change
Expand Up @@ -5259,3 +5259,107 @@ vmmul_test:

jr $ra
.size vmmul_test, . - vmmul_test

.type vrot_test,@function
.globl vrot_test
vrot_test:
# vrot
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00000000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00010000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00020000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00030000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00040000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00050000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00060000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00070000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00080000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00090000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x000A0000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x000B0000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x000C0000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x000D0000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x000E0000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x000F0000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00100000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00110000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00120000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00130000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00140000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00150000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00160000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00170000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00180000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00190000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x001A0000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x001B0000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x001C0000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x001D0000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x001E0000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x001F0000 | 0x00000000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00000000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00010000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00020000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00030000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00040000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00050000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00060000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00070000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00080000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00090000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x000A0000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x000B0000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x000C0000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x000D0000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x000E0000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x000F0000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00100000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00110000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00120000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00130000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00140000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00150000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00160000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00170000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00180000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00190000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x001A0000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x001B0000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x001C0000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x001D0000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x001E0000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x001F0000 | 0x00008000 | 0x00000000 | 0x00000000 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00000000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00010000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00020000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00030000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00040000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00050000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00060000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00070000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00080000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00090000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x000A0000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x000B0000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x000C0000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x000D0000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x000E0000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x000F0000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00100000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00110000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00120000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00130000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00140000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00150000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00160000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00170000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00180000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x00190000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x001A0000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x001B0000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x001C0000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x001D0000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x001E0000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F
.word 0xF0000000 | 0x00200000 | 0x03800000 | 0x001F0000 | 0x00008000 | 0x00000000 | 0x00000080 | 0x0000001F

jr $ra
.size vrot_test, . - vrot_test
Loading

0 comments on commit b70927f

Please sign in to comment.