    .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, 0x7fffffff  # max positive 32b
    li x11, 0x80000000  # min negative 32b

    # 1. REMW : a % 1
    remw x31, x2, x4
    # expected: 0000000000000000

    # 2. REMW : a % a
    remw x31, x2, x6
    # expected: 0000000000000000

    # 3. REMW : negative % positive
    remw x31, x5, x8
    # expected: 0

    # 4. REMW : negative % positive
    remw x31, x7, x8
    # expected: 181c8

    # 5. REMW : positive % negative
    remw x31, x8, x7
    # expected: fffffffffff63448

    # 6. REMW : negative % negative
    remw x31, x7, x9
    # expected: ffffffffffff0edd

    # 7. REMW : max % 2
    li x12, 2
    remw x31, x10, x12
    # expected: 00000001

    # 8. REMW : min % -1
    li x12, -1
    remw x31, x11, x12
    # expected: 00000000

    # 9. REMW : min % 1
    remw x31, x11, x4
    # expected: 00000000

    # 10. REMW : 0 % any
    remw x31, x3, x2
    # expected: 00001234

    # 11. REMW : any % 0
    remw x31, x2, x0
    # expected: 000dead0
    remw x31, x7, x0
    # expected: -badf8
