.text _start: li x2, 0xdead00000 # +59774074880 li x3, 0 # zero li x4, 1 # one li x5, -1 # -1 li x6, 0xdead00000 # duplicate of x2 li x7, -235555555555 # negative li x8, 123456789 # positive li x9, 765432000000 # positive li x10, 0x7fffffffffffffff # max positive 64b li x11, 0x8000000000000000 # min negative 64b # -------------------------------------------------------------- # 1. MULHSU : a * 0 mulhsu x31, x2, x3 # expected: 0000000000000000 # 2. MULHSU : a * 1 mulhsu x31, x2, x4 # expected: 0000000000000000 # 3. MULHSU : a * a mulhsu x31, x2, x6 # expected: 00000000000000c1 # 4. MULHSU : -1 * a mulhsu x31, x5, x2 # expected: ffffffffffffffff # 5. MULHSU : negative * positive mulhsu x31, x7, x8 # expected: fffffffffffffffe # 6. MULHSU : negative * positive large mulhsu x31, x7, x9 # expected: ffffffffffffd9d1 # 7. MULHSU : positive * positive mulhsu x31, x8, x9 # expected: 0000000000000005 # 8. MULHSU : overflow example (max * 2) li x12, 2 mulhsu x31, x10, x12 # expected: 0000000000000000 # 9. MULHSU : max * max mulhsu x31, x10, x10 # expected: 3fffffffffffffff # 10. MULHSU : min * max mulhsu x31, x11, x10 # expected: c000000000000000