1# RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips32 | \ 2# RUN: FileCheck %s --check-prefix=CHECK-NOTRAP 3# RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips32 \ 4# RUN: -mattr=+use-tcc-in-div | FileCheck %s --check-prefix=CHECK-TRAP 5 6 remu $4,$5 7# CHECK-NOTRAP: bnez $5, $tmp0 # encoding: [A,A,0xa0,0x14] 8# CHECK-NOTRAP: # fixup A - offset: 0, value: ($tmp0)-4, kind: fixup_Mips_PC16 9# CHECK-NOTRAP: divu $zero, $4, $5 # encoding: [0x1b,0x00,0x85,0x00] 10# CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00] 11# CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 12# CHECK-TRAP: teq $5, $zero, 7 # encoding: [0xf4,0x01,0xa0,0x00] 13# CHECK-TRAP: divu $zero, $4, $5 # encoding: [0x1b,0x00,0x85,0x00] 14# CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 15 16 remu $4,$0 17# CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00] 18# CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00] 19 20 remu $4,0 21# CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00] 22# CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00] 23 24 remu $0,0 25# CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00] 26# CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00] 27 28 remu $4,1 29# CHECK-NOTRAP: move $4, $zero # encoding: [0x25,0x20,0x00,0x00] 30# CHECK-TRAP: move $4, $zero # encoding: [0x25,0x20,0x00,0x00] 31 32 remu $4,-1 33# CHECK-NOTRAP: addiu $1, $zero, -1 # encoding: [0xff,0xff,0x01,0x24] 34# CHECK-NOTRAP: divu $zero, $4, $1 # encoding: [0x1b,0x00,0x81,0x00] 35# CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 36# CHECK-TRAP: addiu $1, $zero, -1 # encoding: [0xff,0xff,0x01,0x24] 37# CHECK-TRAP: divu $zero, $4, $1 # encoding: [0x1b,0x00,0x81,0x00] 38# CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 39 40 remu $4,2 41# CHECK-NOTRAP: addiu $1, $zero, 2 # encoding: [0x02,0x00,0x01,0x24] 42# CHECK-NOTRAP: divu $zero, $4, $1 # encoding: [0x1b,0x00,0x81,0x00] 43# CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 44# CHECK-TRAP: addiu $1, $zero, 2 # encoding: [0x02,0x00,0x01,0x24] 45# CHECK-TRAP: divu $zero, $4, $1 # encoding: [0x1b,0x00,0x81,0x00] 46# CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 47 48 remu $4,0x8000 49# CHECK-NOTRAP: ori $1, $zero, 32768 # encoding: [0x00,0x80,0x01,0x34] 50# CHECK-NOTRAP: divu $zero, $4, $1 # encoding: [0x1b,0x00,0x81,0x00] 51# CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 52# CHECK-TRAP: ori $1, $zero, 32768 # encoding: [0x00,0x80,0x01,0x34] 53# CHECK-TRAP: divu $zero, $4, $1 # encoding: [0x1b,0x00,0x81,0x00] 54# CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 55 56 57 remu $4,-0x8000 58# CHECK-NOTRAP: addiu $1, $zero, -32768 # encoding: [0x00,0x80,0x01,0x24] 59# CHECK-NOTRAP: divu $zero, $4, $1 # encoding: [0x1b,0x00,0x81,0x00] 60# CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 61# CHECK-TRAP: addiu $1, $zero, -32768 # encoding: [0x00,0x80,0x01,0x24] 62# CHECK-TRAP: divu $zero, $4, $1 # encoding: [0x1b,0x00,0x81,0x00] 63# CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 64 65 remu $4,0x10000 66# CHECK-NOTRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c] 67# CHECK-NOTRAP: divu $zero, $4, $1 # encoding: [0x1b,0x00,0x81,0x00] 68# CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 69# CHECK-TRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c] 70# CHECK-TRAP: divu $zero, $4, $1 # encoding: [0x1b,0x00,0x81,0x00] 71# CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 72 73 remu $4,0x1a5a5 74# CHECK-NOTRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c] 75# CHECK-NOTRAP: ori $1, $1, 42405 # encoding: [0xa5,0xa5,0x21,0x34] 76# CHECK-NOTRAP: divu $zero, $4, $1 # encoding: [0x1b,0x00,0x81,0x00] 77# CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 78# CHECK-TRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c] 79# CHECK-TRAP: ori $1, $1, 42405 # encoding: [0xa5,0xa5,0x21,0x34] 80# CHECK-TRAP: divu $zero, $4, $1 # encoding: [0x1b,0x00,0x81,0x00] 81# CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 82 83 remu $4,$5,$6 84# CHECK-NOTRAP: bnez $6, $tmp1 # encoding: [A,A,0xc0,0x14] 85# CHECK-NOTRAP: # fixup A - offset: 0, value: ($tmp1)-4, kind: fixup_Mips_PC16 86# CHECK-NOTRAP: divu $zero, $5, $6 # encoding: [0x1b,0x00,0xa6,0x00] 87# CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00] 88# CHECK-NOTRAP: $tmp1 89# CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 90# CHECK-TRAP: teq $6, $zero, 7 # encoding: [0xf4,0x01,0xc0,0x00] 91# CHECK-TRAP: divu $zero, $5, $6 # encoding: [0x1b,0x00,0xa6,0x00] 92# CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 93 94 95 remu $4,$5,$0 96# CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00] 97# CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00] 98 99 remu $4,$0,$0 100# CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00] 101# CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00] 102 103 remu $0,$5,$4 104# CHECK-NOTRAP: divu $zero, $5, $4 # encoding: [0x1b,0x00,0xa4,0x00] 105# CHECK-TRAP: divu $zero, $5, $4 # encoding: [0x1b,0x00,0xa4,0x00] 106 107 remu $4,$5,0 108# CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00] 109# CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00] 110 111 remu $4,$0,0 112# CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00] 113# CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00] 114 115 remu $4,$5,1 116# CHECK-NOTRAP: move $4, $zero # encoding: [0x25,0x20,0x00,0x00] 117# CHECK-TRAP: move $4, $zero # encoding: [0x25,0x20,0x00,0x00] 118 119 remu $4,$5,-1 120# CHECK-NOTRAP: addiu $1, $zero, -1 # encoding: [0xff,0xff,0x01,0x24] 121# CHECK-NOTRAP: divu $zero, $5, $1 # encoding: [0x1b,0x00,0xa1,0x00] 122# CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 123# CHECK-TRAP: addiu $1, $zero, -1 # encoding: [0xff,0xff,0x01,0x24] 124# CHECK-TRAP: divu $zero, $5, $1 # encoding: [0x1b,0x00,0xa1,0x00] 125# CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 126 127 remu $4,$5,2 128# CHECK-NOTRAP: addiu $1, $zero, 2 # encoding: [0x02,0x00,0x01,0x24] 129# CHECK-NOTRAP: divu $zero, $5, $1 # encoding: [0x1b,0x00,0xa1,0x00] 130# CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 131# CHECK-TRAP: addiu $1, $zero, 2 # encoding: [0x02,0x00,0x01,0x24] 132# CHECK-TRAP: divu $zero, $5, $1 # encoding: [0x1b,0x00,0xa1,0x00] 133# CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 134 135 remu $4,$5,0x8000 136# CHECK-NOTRAP: ori $1, $zero, 32768 # encoding: [0x00,0x80,0x01,0x34] 137# CHECK-NOTRAP: divu $zero, $5, $1 # encoding: [0x1b,0x00,0xa1,0x00] 138# CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 139# CHECK-TRAP: ori $1, $zero, 32768 # encoding: [0x00,0x80,0x01,0x34] 140# CHECK-TRAP: divu $zero, $5, $1 # encoding: [0x1b,0x00,0xa1,0x00] 141# CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 142 143 remu $4,$5,-0x8000 144# CHECK-NOTRAP: addiu $1, $zero, -32768 # encoding: [0x00,0x80,0x01,0x24] 145# CHECK-NOTRAP: divu $zero, $5, $1 # encoding: [0x1b,0x00,0xa1,0x00] 146# CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 147# CHECK-TRAP: addiu $1, $zero, -32768 # encoding: [0x00,0x80,0x01,0x24] 148# CHECK-TRAP: divu $zero, $5, $1 # encoding: [0x1b,0x00,0xa1,0x00] 149# CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 150 151 remu $4,$5,0x10000 152# CHECK-NOTRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c] 153# CHECK-NOTRAP: divu $zero, $5, $1 # encoding: [0x1b,0x00,0xa1,0x00] 154# CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 155# CHECK-TRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c] 156# CHECK-TRAP: divu $zero, $5, $1 # encoding: [0x1b,0x00,0xa1,0x00] 157# CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 158 159 remu $4,$5,0x1a5a5 160# CHECK-NOTRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c] 161# CHECK-NOTRAP: ori $1, $1, 42405 # encoding: [0xa5,0xa5,0x21,0x34] 162# CHECK-NOTRAP: divu $zero, $5, $1 # encoding: [0x1b,0x00,0xa1,0x00] 163# CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 164# CHECK-TRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c] 165# CHECK-TRAP: ori $1, $1, 42405 # encoding: [0xa5,0xa5,0x21,0x34] 166# CHECK-TRAP: divu $zero, $5, $1 # encoding: [0x1b,0x00,0xa1,0x00] 167# CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 168