1 # RUN: llvm-mc %s -triple=mips-unknown-linux -show-encoding -mcpu=mips64r2 | \ 2 # RUN: FileCheck %s --check-prefix=CHECK-NOTRAP 3 # RUN: llvm-mc %s -triple=mips-unknown-linux -show-encoding -mcpu=mips64r2 \ 4 # RUN: -mattr=+use-tcc-in-div | FileCheck %s --check-prefix=CHECK-TRAP 5 6 ddiv $25, $11 7 # CHECK-NOTRAP: bne $11, $zero, 8 # encoding: [0x15,0x60,0x00,0x02] 8 # CHECK-NOTRAP: ddiv $zero, $25, $11 # encoding: [0x03,0x2b,0x00,0x1e] 9 # CHECK-NOTRAP: break 7 # encoding: [0x00,0x07,0x00,0x0d] 10 # CHECK-NOTRAP: addiu $1, $zero, -1 # encoding: [0x24,0x01,0xff,0xff] 11 # CHECK-NOTRAP: bne $11, $1, 20 # encoding: [0x15,0x61,0x00,0x05] 12 # CHECK-NOTRAP: addiu $1, $zero, 1 # encoding: [0x24,0x01,0x00,0x01] 13 # CHECK-NOTRAP: dsll32 $1, $1, 31 # encoding: [0x00,0x01,0x0f,0xfc] 14 # CHECK-NOTRAP: bne $25, $1, 8 # encoding: [0x17,0x21,0x00,0x02] 15 # CHECK-NOTRAP: sll $zero, $zero, 0 # encoding: [0x00,0x00,0x00,0x00] 16 # CHECK-NOTRAP: break 6 # encoding: [0x00,0x06,0x00,0x0d] 17 # CHECK-NOTRAP: mflo $25 # encoding: [0x00,0x00,0xc8,0x12] 18 19 ddiv $24,$12 20 # CHECK-NOTRAP: bne $12, $zero, 8 # encoding: [0x15,0x80,0x00,0x02] 21 # CHECK-NOTRAP: ddiv $zero, $24, $12 # encoding: [0x03,0x0c,0x00,0x1e] 22 # CHECK-NOTRAP: break 7 # encoding: [0x00,0x07,0x00,0x0d] 23 # CHECK-NOTRAP: addiu $1, $zero, -1 # encoding: [0x24,0x01,0xff,0xff] 24 # CHECK-NOTRAP: bne $12, $1, 20 # encoding: [0x15,0x81,0x00,0x05] 25 # CHECK-NOTRAP: addiu $1, $zero, 1 # encoding: [0x24,0x01,0x00,0x01] 26 # CHECK-NOTRAP: dsll32 $1, $1, 31 # encoding: [0x00,0x01,0x0f,0xfc] 27 # CHECK-NOTRAP: bne $24, $1, 8 # encoding: [0x17,0x01,0x00,0x02] 28 # CHECK-NOTRAP: sll $zero, $zero, 0 # encoding: [0x00,0x00,0x00,0x00] 29 # CHECK-NOTRAP: break 6 # encoding: [0x00,0x06,0x00,0x0d] 30 # CHECK-NOTRAP: mflo $24 # encoding: [0x00,0x00,0xc0,0x12] 31 32 ddiv $25,$0 33 # CHECK-NOTRAP: break 7 # encoding: [0x00,0x07,0x00,0x0d] 34 35 ddiv $0,$9 36 # CHECK-NOTRAP: bne $9, $zero, 8 # encoding: [0x15,0x20,0x00,0x02] 37 # CHECK-NOTRAP: ddiv $zero, $zero, $9 # encoding: [0x00,0x09,0x00,0x1e] 38 # CHECK-NOTRAP: break 7 # encoding: [0x00,0x07,0x00,0x0d] 39 # CHECK-NOTRAP: addiu $1, $zero, -1 # encoding: [0x24,0x01,0xff,0xff] 40 # CHECK-NOTRAP: bne $9, $1, 20 # encoding: [0x15,0x21,0x00,0x05] 41 # CHECK-NOTRAP: addiu $1, $zero, 1 # encoding: [0x24,0x01,0x00,0x01] 42 # CHECK-NOTRAP: dsll32 $1, $1, 31 # encoding: [0x00,0x01,0x0f,0xfc] 43 # CHECK-NOTRAP: bne $zero, $1, 8 # encoding: [0x14,0x01,0x00,0x02] 44 # CHECK-NOTRAP: sll $zero, $zero, 0 # encoding: [0x00,0x00,0x00,0x00] 45 # CHECK-NOTRAP: break 6 # encoding: [0x00,0x06,0x00,0x0d] 46 # CHECK-NOTRAP: mflo $zero # encoding: [0x00,0x00,0x00,0x12] 47 48 ddiv $0,$0 49 # CHECK-NOTRAP: break 7 # encoding: [0x00,0x07,0x00,0x0d] 50 51 ddiv $4,$5,$6 52 # CHECK-NOTRAP: bne $6, $zero, 8 # encoding: [0x14,0xc0,0x00,0x02] 53 # CHECK-NOTRAP: ddiv $zero, $5, $6 # encoding: [0x00,0xa6,0x00,0x1e] 54 # CHECK-NOTRAP: break 7 # encoding: [0x00,0x07,0x00,0x0d] 55 # CHECK-NOTRAP: addiu $1, $zero, -1 # encoding: [0x24,0x01,0xff,0xff] 56 # CHECK-NOTRAP: bne $6, $1, 20 # encoding: [0x14,0xc1,0x00,0x05] 57 # CHECK-NOTRAP: addiu $1, $zero, 1 # encoding: [0x24,0x01,0x00,0x01] 58 # CHECK-NOTRAP: dsll32 $1, $1, 31 # encoding: [0x00,0x01,0x0f,0xfc] 59 # CHECK-NOTRAP: bne $5, $1, 8 # encoding: [0x14,0xa1,0x00,0x02] 60 # CHECK-NOTRAP: sll $zero, $zero, 0 # encoding: [0x00,0x00,0x00,0x00] 61 # CHECK-NOTRAP: break 6 # encoding: [0x00,0x06,0x00,0x0d] 62 # CHECK-NOTRAP: mflo $4 # encoding: [0x00,0x00,0x20,0x12] 63 64 ddiv $4,$5,$0 65 # CHECK-NOTRAP: break 7 # encoding: [0x00,0x07,0x00,0x0d] 66 67 ddiv $4,$0,$0 68 # CHECK-NOTRAP: break 7 # encoding: [0x00,0x07,0x00,0x0d] 69 70 ddiv $0, $4, $5 71 # CHECK-NOTRAP: ddiv $zero, $4, $5 # encoding: [0x00,0x85,0x00,0x1e] 72 73 ddiv $25,$11 74 # CHECK-TRAP: teq $11, $zero, 7 # encoding: [0x01,0x60,0x01,0xf4] 75 # CHECK-TRAP: ddiv $zero, $25, $11 # encoding: [0x03,0x2b,0x00,0x1e] 76 # CHECK-TRAP: addiu $1, $zero, -1 # encoding: [0x24,0x01,0xff,0xff] 77 # CHECK-TRAP: bne $11, $1, 12 # encoding: [0x15,0x61,0x00,0x03] 78 # CHECK-TRAP: addiu $1, $zero, 1 # encoding: [0x24,0x01,0x00,0x01] 79 # CHECK-TRAP: dsll32 $1, $1, 31 # encoding: [0x00,0x01,0x0f,0xfc] 80 # CHECK-TRAP: teq $25, $1, 6 # encoding: [0x03,0x21,0x01,0xb4] 81 # CHECK-TRAP: mflo $25 # encoding: [0x00,0x00,0xc8,0x12] 82 83 ddiv $24,$12 84 # CHECK-TRAP: teq $12, $zero, 7 # encoding: [0x01,0x80,0x01,0xf4] 85 # CHECK-TRAP: ddiv $zero, $24, $12 # encoding: [0x03,0x0c,0x00,0x1e] 86 # CHECK-TRAP: addiu $1, $zero, -1 # encoding: [0x24,0x01,0xff,0xff] 87 # CHECK-TRAP: bne $12, $1, 12 # encoding: [0x15,0x81,0x00,0x03] 88 # CHECK-TRAP: addiu $1, $zero, 1 # encoding: [0x24,0x01,0x00,0x01] 89 # CHECK-TRAP: dsll32 $1, $1, 31 # encoding: [0x00,0x01,0x0f,0xfc] 90 # CHECK-TRAP: teq $24, $1, 6 # encoding: [0x03,0x01,0x01,0xb4] 91 # CHECK-TRAP: mflo $24 # encoding: [0x00,0x00,0xc0,0x12] 92 93 ddiv $25,$0 94 # CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0x00,0x00,0x01,0xf4] 95 96 ddiv $0,$9 97 # CHECK-TRAP: teq $9, $zero, 7 # encoding: [0x01,0x20,0x01,0xf4] 98 # CHECK-TRAP: ddiv $zero, $zero, $9 # encoding: [0x00,0x09,0x00,0x1e] 99 # CHECK-TRAP: addiu $1, $zero, -1 # encoding: [0x24,0x01,0xff,0xff] 100 # CHECK-TRAP: bne $9, $1, 12 # encoding: [0x15,0x21,0x00,0x03] 101 # CHECK-TRAP: addiu $1, $zero, 1 # encoding: [0x24,0x01,0x00,0x01] 102 # CHECK-TRAP: dsll32 $1, $1, 31 # encoding: [0x00,0x01,0x0f,0xfc] 103 # CHECK-TRAP: teq $zero, $1, 6 # encoding: [0x00,0x01,0x01,0xb4] 104 # CHECK-TRAP: mflo $zero # encoding: [0x00,0x00,0x00,0x12] 105 106 ddiv $0,$0 107 # CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0x00,0x00,0x01,0xf4] 108 109 ddiv $4,$5,$6 110 # CHECK-TRAP: teq $6, $zero, 7 # encoding: [0x00,0xc0,0x01,0xf4] 111 # CHECK-TRAP: ddiv $zero, $5, $6 # encoding: [0x00,0xa6,0x00,0x1e] 112 # CHECK-TRAP: addiu $1, $zero, -1 # encoding: [0x24,0x01,0xff,0xff] 113 # CHECK-TRAP: bne $6, $1, 12 # encoding: [0x14,0xc1,0x00,0x03] 114 # CHECK-TRAP: addiu $1, $zero, 1 # encoding: [0x24,0x01,0x00,0x01] 115 # CHECK-TRAP: dsll32 $1, $1, 31 # encoding: [0x00,0x01,0x0f,0xfc] 116 # CHECK-TRAP: teq $5, $1, 6 # encoding: [0x00,0xa1,0x01,0xb4] 117 # CHECK-TRAP: mflo $4 # encoding: [0x00,0x00,0x20,0x12] 118 119 ddiv $4,$5,$0 120 # CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0x00,0x00,0x01,0xf4] 121 122 ddiv $4,$0,$0 123 # CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0x00,0x00,0x01,0xf4] 124 125 ddiv $0, $4, $5 126 # CHECK-TRAP: ddiv $zero, $4, $5 # encoding: [0x00,0x85,0x00,0x1e] 127