filename | test/sh4/tas.s |
changeset | 399:23e51a2b4f99 |
author | nkeynes |
date | Sun Dec 14 07:50:48 2008 +0000 (15 years ago) |
permissions | -rw-r--r-- |
last change | Setup a 'proper' stackframe in translated blocks. This doesn't affect performance noticeably, but does ensure that a) The stack is aligned correctly on OS X with no extra effort, and b) We can't mess up the stack and crash that way anymore. Replace all PUSH/POP instructions (outside of prologue/epilogue) with ESP-rel moves to stack local variables. Finally merge ia32mac and ia32abi together, since they're pretty much the same now anyway (and thereby simplifying maintenance a good deal) |
file | annotate | diff | log | raw |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +00001.2 +++ b/test/sh4/tas.s Sun Dec 14 07:50:48 2008 +00001.3 @@ -0,0 +1,107 @@1.4 +.section .text1.5 +.include "sh4/inc.s"1.6 +1.7 +.global _test_tas1.8 +_test_tas:1.9 + start_test1.10 +1.11 +test_tas_1:1.12 + add #1, r121.13 +1.14 + mova test_tas_1_data, r0 ! test with byte == 01.15 + mov r0, r41.16 + mov r4, r51.17 + tas.b @r41.18 + bf test_tas_1_fail1.19 + cmp/eq r4, r51.20 + bf test_tas_1_fail1.21 + mov #0x40, r11.22 + shll r11.23 + mov.l test_tas_1_data, r31.24 + cmp/eq r1, r31.25 + bt test_tas_21.26 +1.27 +test_tas_1_fail:1.28 + fail test_tas_str_k1.29 + bra test_tas_21.30 + nop1.31 +test_tas_1_data:1.32 + .long 0x000000001.33 +1.34 +test_tas_2:1.35 + add #1, r121.36 +1.37 + mova test_tas_2_data, r0 ! test with byte == 0x801.38 + mov r0, r41.39 + mov r4, r51.40 + tas.b @r4 ! follow up test with byte == 0x000000801.41 + bt test_tas_2_fail1.42 + cmp/eq r4, r51.43 + bf test_tas_2_fail1.44 + mov.l @r4, r31.45 + mov #0x40, r11.46 + shll r11.47 + cmp/eq r1, r31.48 + bt test_tas_31.49 +test_tas_2_fail:1.50 + fail test_tas_str_k1.51 + bra test_tas_31.52 + nop1.53 +test_tas_2_data:1.54 + .long 0x000000801.55 +1.56 +test_tas_3: ! Test with byte = 0x45 (ensure existing bits aren't changed)1.57 + add #1, r121.58 + mova test_tas_3_data, r01.59 + mov r0, r41.60 + mov.l test_tas_3_result, r11.61 + mov r4, r51.62 + tas.b @r41.63 + bt test_tas_3_fail1.64 + cmp/eq r4,r51.65 + bf test_tas_3_fail1.66 + mov.l test_tas_3_data, r31.67 + cmp/eq r1, r31.68 + bt test_tas_41.69 +1.70 +test_tas_3_fail:1.71 + fail test_tas_str_k1.72 + bra test_tas_41.73 + nop1.74 +test_tas_3_data:1.75 + .long 0x000000451.76 +test_tas_3_result:1.77 + .long 0x000000C51.78 +1.79 +test_tas_4: ! Test that it's really a byte op1.80 + add #1, r121.81 + mova test_tas_4_data, r01.82 + mov r0, r41.83 + mov.l test_tas_4_result, r11.84 + add #1, r41.85 + mov r4, r51.86 + tas.b @r41.87 + bf test_tas_4_fail1.88 + cmp/eq r4, r51.89 + mov.l test_tas_4_data, r31.90 + cmp/eq r1, r31.91 + bt test_tas_end1.92 +test_tas_4_fail:1.93 + fail test_tas_str_k1.94 + bra test_tas_end1.95 + nop1.96 +test_tas_4_data:1.97 + .long 0xAB9C00ED1.98 +test_tas_4_result:1.99 + .long 0xAB9C80ED1.100 +1.101 +test_tas_end:1.102 + end_test test_tas_str_k1.103 +1.104 +test_tas_str:1.105 + .string "TAS"1.106 +1.107 +.align 41.108 +test_tas_str_k:1.109 + .long test_tas_str1.110 +1.111 \ No newline at end of file
.