Home | History | Annotate | Download | only in Mips
      1 # RUN: llvm-mc %s -triple=mips-unknown-linux -show-encoding -mcpu=mips32r2 | \
      2 # RUN:   FileCheck %s --check-prefix=CHECK-NOTRAP
      3 # RUN: llvm-mc %s -triple=mips-unknown-linux -show-encoding -mcpu=mips32r2 \
      4 # RUN:  -mattr=+use-tcc-in-div | FileCheck %s --check-prefix=CHECK-TRAP
      5 
      6   div $25,$11
      7 # CHECK-NOTRAP: bnez $11, 8               # encoding: [0x15,0x60,0x00,0x02]
      8 # CHECK-NOTRAP: div $zero, $25, $11       # encoding: [0x03,0x2b,0x00,0x1a]
      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, 16           # encoding: [0x15,0x61,0x00,0x04]
     12 # CHECK-NOTRAP: lui $1, 32768             # encoding: [0x3c,0x01,0x80,0x00]
     13 # CHECK-NOTRAP: bne $25, $1, 8            # encoding: [0x17,0x21,0x00,0x02]
     14 # CHECK-NOTRAP: nop                       # encoding: [0x00,0x00,0x00,0x00]
     15 # CHECK-NOTRAP: break 6                   # encoding: [0x00,0x06,0x00,0x0d]
     16 # CHECK-NOTRAP: mflo $25                  # encoding: [0x00,0x00,0xc8,0x12]
     17 
     18   div $24,$12
     19 # CHECK-NOTRAP: bnez $12, 8               # encoding: [0x15,0x80,0x00,0x02]
     20 # CHECK-NOTRAP: div $zero, $24, $12       # encoding: [0x03,0x0c,0x00,0x1a]
     21 # CHECK-NOTRAP: break 7                   # encoding: [0x00,0x07,0x00,0x0d]
     22 # CHECK-NOTRAP: addiu $1, $zero, -1       # encoding: [0x24,0x01,0xff,0xff]
     23 # CHECK-NOTRAP: bne $12, $1, 16           # encoding: [0x15,0x81,0x00,0x04]
     24 # CHECK-NOTRAP: lui $1, 32768             # encoding: [0x3c,0x01,0x80,0x00]
     25 # CHECK-NOTRAP: bne $24, $1, 8            # encoding: [0x17,0x01,0x00,0x02]
     26 # CHECK-NOTRAP: nop                       # encoding: [0x00,0x00,0x00,0x00]
     27 # CHECK-NOTRAP: break 6                   # encoding: [0x00,0x06,0x00,0x0d]
     28 # CHECK-NOTRAP: mflo $24                  # encoding: [0x00,0x00,0xc0,0x12]
     29 
     30   div $25,$0
     31 # CHECK-NOTRAP: break 7                   # encoding: [0x00,0x07,0x00,0x0d]
     32 
     33   div $0,$9
     34 # CHECK-NOTRAP: div $zero, $zero, $9      # encoding: [0x00,0x09,0x00,0x1a]
     35 
     36   div $0,$0
     37 # CHECK-NOTRAP: div $zero, $zero, $zero   # encoding: [0x00,0x00,0x00,0x1a]
     38 
     39   div $25, $11
     40 # CHECK-TRAP: teq $11, $zero, 7           # encoding: [0x01,0x60,0x01,0xf4]
     41 # CHECK-TRAP: div $zero, $25, $11         # encoding: [0x03,0x2b,0x00,0x1a]
     42 # CHECK-TRAP: addiu $1, $zero, -1         # encoding: [0x24,0x01,0xff,0xff]
     43 # CHECK-TRAP: bne $11, $1, 8              # encoding: [0x15,0x61,0x00,0x02]
     44 # CHECK-TRAP: lui $1, 32768               # encoding: [0x3c,0x01,0x80,0x00]
     45 # CHECK-TRAP: teq $25, $1, 6              # encoding: [0x03,0x21,0x01,0xb4]
     46 # CHECK-TRAP: mflo $25                    # encoding: [0x00,0x00,0xc8,0x12]
     47 
     48   div $24,$12
     49 # CHECK-TRAP: teq $12, $zero, 7           # encoding: [0x01,0x80,0x01,0xf4]
     50 # CHECK-TRAP: div $zero, $24, $12         # encoding: [0x03,0x0c,0x00,0x1a]
     51 # CHECK-TRAP: addiu $1, $zero, -1         # encoding: [0x24,0x01,0xff,0xff]
     52 # CHECK-TRAP: bne $12, $1, 8              # encoding: [0x15,0x81,0x00,0x02]
     53 # CHECK-TRAP: lui $1, 32768               # encoding: [0x3c,0x01,0x80,0x00]
     54 # CHECK-TRAP: teq $24, $1, 6              # encoding: [0x03,0x01,0x01,0xb4]
     55 # CHECK-TRAP: mflo $24                    # encoding: [0x00,0x00,0xc0,0x12]
     56 
     57   div $25,$0
     58 # CHECK-TRAP: teq $zero, $zero, 7         # encoding: [0x00,0x00,0x01,0xf4]
     59 
     60   div $0,$9
     61 # CHECK-TRAP: div $zero, $zero, $9        # encoding: [0x00,0x09,0x00,0x1a]
     62 
     63   div $0,$0
     64 # CHECK-TRAP: div $zero, $zero, $zero     # encoding: [0x00,0x00,0x00,0x1a]
     65