1# RUN: llvm-mc %s -triple=mips64el-unknown-linux -show-encoding -mcpu=mips64 | \ 2# RUN: FileCheck %s --check-prefix=CHECK-NOTRAP 3# RUN: llvm-mc %s -triple=mips64el-unknown-linux -show-encoding -mcpu=mips64 \ 4# RUN: -mattr=+use-tcc-in-div | FileCheck %s --check-prefix=CHECK-TRAP 5 6 dremu $4,$5 7# CHECK-NOTRAP: bne $5, $zero, .Ltmp0 # encoding: [A,A,0xa0,0x14] 8# CHECK-NOTRAP: # fixup A - offset: 0, value: .Ltmp0-4, kind: fixup_Mips_PC16 9# CHECK-NOTRAP: ddivu $zero, $4, $5 # encoding: [0x1f,0x00,0x85,0x00] 10# CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00] 11# CHECK-NOTRAP: .Ltmp0 12# CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 13# CHECK-TRAP: teq $5, $zero, 7 # encoding: [0xf4,0x01,0xa0,0x00] 14# CHECK-TRAP: ddivu $zero, $4, $5 # encoding: [0x1f,0x00,0x85,0x00] 15# CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 16 17 dremu $4,$0 18# CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00] 19# CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00] 20 21 dremu $4,0 22# CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00] 23# CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00] 24 25 dremu $0,0 26# CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00] 27# CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00] 28 29 dremu $4,1 30# CHECK-NOTRAP: or $4, $zero, $zero # encoding: [0x25,0x20,0x00,0x00] 31# CHECK-TRAP: or $4, $zero, $zero # encoding: [0x25,0x20,0x00,0x00] 32 33 dremu $4,2 34# CHECK-NOTRAP: addiu $1, $zero, 2 # encoding: [0x02,0x00,0x01,0x24] 35# CHECK-NOTRAP: ddivu $zero, $4, $1 # encoding: [0x1f,0x00,0x81,0x00] 36# CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 37# CHECK-TRAP: addiu $1, $zero, 2 # encoding: [0x02,0x00,0x01,0x24] 38# CHECK-TRAP: ddivu $zero, $4, $1 # encoding: [0x1f,0x00,0x81,0x00] 39# CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 40 41 dremu $4,-1 42# CHECK-NOTRAP: addiu $1, $zero, -1 # encoding: [0xff,0xff,0x01,0x24] 43# CHECK-NOTRAP: ddivu $zero, $4, $1 # encoding: [0x1f,0x00,0x81,0x00] 44# CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 45# CHECK-TRAP: addiu $1, $zero, -1 # encoding: [0xff,0xff,0x01,0x24] 46# CHECK-TRAP: ddivu $zero, $4, $1 # encoding: [0x1f,0x00,0x81,0x00] 47# CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 48 49 dremu $4,0x1a5a5 50# CHECK-NOTRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c] 51# CHECK-NOTRAP: ori $1, $1, 42405 # encoding: [0xa5,0xa5,0x21,0x34] 52# CHECK-NOTRAP: ddivu $zero, $4, $1 # encoding: [0x1f,0x00,0x81,0x00] 53# CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 54# CHECK-TRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c] 55# CHECK-TRAP: ori $1, $1, 42405 # encoding: [0xa5,0xa5,0x21,0x34] 56# CHECK-TRAP: ddivu $zero, $4, $1 # encoding: [0x1f,0x00,0x81,0x00] 57# CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 58 59 dremu $4,0x10000 60# CHECK-NOTRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c] 61# CHECK-NOTRAP: ddivu $zero, $4, $1 # encoding: [0x1f,0x00,0x81,0x00] 62# CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 63# CHECK-TRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c] 64# CHECK-TRAP: ddivu $zero, $4, $1 # encoding: [0x1f,0x00,0x81,0x00] 65# CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 66 67 dremu $4,-0x8000 68# CHECK-NOTRAP: addiu $1, $zero, -32768 # encoding: [0x00,0x80,0x01,0x24] 69# CHECK-NOTRAP: ddivu $zero, $4, $1 # encoding: [0x1f,0x00,0x81,0x00] 70# CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 71# CHECK-TRAP: addiu $1, $zero, -32768 # encoding: [0x00,0x80,0x01,0x24] 72# CHECK-TRAP: ddivu $zero, $4, $1 # encoding: [0x1f,0x00,0x81,0x00] 73# CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 74 75 dremu $4,0x8000 76# CHECK-NOTRAP: ori $1, $zero, 32768 # encoding: [0x00,0x80,0x01,0x34] 77# CHECK-NOTRAP: ddivu $zero, $4, $1 # encoding: [0x1f,0x00,0x81,0x00] 78# CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 79# CHECK-TRAP: ori $1, $zero, 32768 # encoding: [0x00,0x80,0x01,0x34] 80# CHECK-TRAP: ddivu $zero, $4, $1 # encoding: [0x1f,0x00,0x81,0x00] 81# CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 82 83 dremu $4,$5,$6 84# CHECK-NOTRAP: bne $6, $zero, .Ltmp1 # encoding: [A,A,0xc0,0x14] 85# CHECK-NOTRAP: # fixup A - offset: 0, value: .Ltmp1-4, kind: fixup_Mips_PC16 86# CHECK-NOTRAP: ddivu $zero, $5, $6 # encoding: [0x1f,0x00,0xa6,0x00] 87# CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00] 88# CHECK-NOTRAP: .Ltmp1 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: ddivu $zero, $5, $6 # encoding: [0x1f,0x00,0xa6,0x00] 92# CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 93 94 dremu $4,$5,$0 95# CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00] 96# CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00] 97 98 dremu $4,$0,$0 99# CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00] 100# CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00] 101 102 dremu $0,$4,$5 103# CHECK-NOTRAP: ddivu $zero, $4, $5 # encoding: [0x1f,0x00,0x85,0x00] 104# CHECK-TRAP: ddivu $zero, $4, $5 # encoding: [0x1f,0x00,0x85,0x00] 105 106 dremu $0,$5,$4 107# CHECK-NOTRAP: ddivu $zero, $5, $4 # encoding: [0x1f,0x00,0xa4,0x00] 108# CHECK-TRAP: ddivu $zero, $5, $4 # encoding: [0x1f,0x00,0xa4,0x00] 109 110 dremu $4,$5,0 111# CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00] 112# CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00] 113 114 dremu $4,$0,0 115# CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00] 116# CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00] 117 118 dremu $4,$5,1 119# CHECK-NOTRAP: or $4, $zero, $zero # encoding: [0x25,0x20,0x00,0x00] 120# CHECK-TRAP: or $4, $zero, $zero # encoding: [0x25,0x20,0x00,0x00] 121 122 dremu $4,$5,-1 123# CHECK-NOTRAP: addiu $1, $zero, -1 # encoding: [0xff,0xff,0x01,0x24] 124# CHECK-NOTRAP: ddivu $zero, $5, $1 # encoding: [0x1f,0x00,0xa1,0x00] 125# CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 126# CHECK-TRAP: addiu $1, $zero, -1 # encoding: [0xff,0xff,0x01,0x24] 127# CHECK-TRAP: ddivu $zero, $5, $1 # encoding: [0x1f,0x00,0xa1,0x00] 128# CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 129 130 dremu $4,$5,2 131# CHECK-NOTRAP: addiu $1, $zero, 2 # encoding: [0x02,0x00,0x01,0x24] 132# CHECK-NOTRAP: ddivu $zero, $5, $1 # encoding: [0x1f,0x00,0xa1,0x00] 133# CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 134# CHECK-TRAP: addiu $1, $zero, 2 # encoding: [0x02,0x00,0x01,0x24] 135# CHECK-TRAP: ddivu $zero, $5, $1 # encoding: [0x1f,0x00,0xa1,0x00] 136# CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00] 137