61 lines
1.3 KiB
ArmAsm
61 lines
1.3 KiB
ArmAsm
.text
|
|
_start:
|
|
li x2, 0xdead0 # 912080
|
|
li x3, 0x1234 # 4660
|
|
li x4, 1 # 1
|
|
li x5, -123456 # -123456
|
|
li x6, 0xdead0 # duplicate of x2
|
|
li x7, -765432 # -765432
|
|
li x8, 123456 # 123456
|
|
li x9, -234567 # -234567
|
|
li x10, 0x7fffffffffffffff # max positive 64b
|
|
li x11, 0x8000000000000000 # min negative 64b
|
|
|
|
# 1. REM : a % 1
|
|
rem x31, x2, x4
|
|
# expected: 0000000000000000
|
|
|
|
# 2. REM : a % a
|
|
rem x31, x2, x6
|
|
# expected: 0000000000000000
|
|
|
|
# 3. REM : negative % positive
|
|
rem x31, x5, x8
|
|
# expected: 0000000000000000
|
|
|
|
# 4. REM : negative % positive
|
|
rem x31, x7, x8
|
|
# expected: 00000000000181c8
|
|
|
|
# 5. REM : positive % negative
|
|
rem x31, x8, x7
|
|
# expected: -9cbb8
|
|
|
|
# 6. REM : negative % negative
|
|
rem x31, x7, x9
|
|
# expected: -f123
|
|
|
|
# 7. REM : max % 2
|
|
li x12, 2
|
|
rem x31, x10, x12
|
|
# expected: 0000000000000001
|
|
|
|
# 8. REM : min % -1
|
|
li x12, -1
|
|
rem x31, x11, x12
|
|
# expected: 0000000000000000
|
|
|
|
# 9. REM : min % 1
|
|
rem x31, x11, x4
|
|
# expected: 0000000000000000
|
|
|
|
# 10. REM : 0 % any
|
|
rem x31, x3, x2
|
|
# expected: 0000000000001234
|
|
|
|
# 11. REM : any % 0
|
|
rem x31, x2, x0
|
|
# expected: 00000000000dead0
|
|
rem x31, x7, x0
|
|
# expected: -badf8
|