reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85
   86
   87
   88
   89
   90
   91
   92
   93
   94
   95
   96
   97
   98
   99
  100
  101
  102
  103
  104
  105
  106
  107
  108
  109
  110
  111
  112
  113
  114
  115
  116
  117
  118
  119
  120
  121
  122
  123
  124
  125
  126
  127
  128
  129
  130
  131
  132
  133
  134
  135
  136
  137
  138
  139
  140
  141
  142
  143
  144
  145
  146
  147
  148
  149
  150
  151
  152
  153
  154
# RUN: llvm-mc  %s -triple mips-unknown-linux -show-encoding -mcpu=mips64r2 | FileCheck %s
# RUN: llvm-mc  %s -triple mips-unknown-linux -show-encoding -mcpu=mips64r3 | FileCheck %s
# RUN: llvm-mc  %s -triple mips-unknown-linux -show-encoding -mcpu=mips64r5 | FileCheck %s

# RUN: llvm-mc  %s -triple mips-unknown-linux -show-encoding -mattr=use-tcc-in-div -mcpu=mips64 | FileCheck %s --check-prefix=CHECK-TRAP
# RUN: llvm-mc  %s -triple mips-unknown-linux -show-encoding -mattr=use-tcc-in-div -mcpu=mips64r2 | FileCheck %s --check-prefix=CHECK-TRAP
# RUN: llvm-mc  %s -triple mips-unknown-linux -show-encoding -mattr=use-tcc-in-div -mcpu=mips64r3 | FileCheck %s --check-prefix=CHECK-TRAP
# RUN: llvm-mc  %s -triple mips-unknown-linux -show-encoding -mattr=use-tcc-in-div -mcpu=mips64r5 | FileCheck %s --check-prefix=CHECK-TRAP

.text
text_label:

  mul  $4, $5
# CHECK:        mul     $4, $4, $5              # encoding: [0x70,0x85,0x20,0x02]
# CHECK-TRAP:   mul     $4, $4, $5              # encoding: [0x70,0x85,0x20,0x02]
  mul   $4, $5, $6
# CHECK:        mul     $4, $5, $6              # encoding: [0x70,0xa6,0x20,0x02]
# CHECK-TRAP:   mul     $4, $5, $6              # encoding: [0x70,0xa6,0x20,0x02]
  mul  $4, $5, 0
# CHECK:        addiu   $1, $zero, 0            # encoding: [0x24,0x01,0x00,0x00]
# CHECK:        mult    $5, $1                  # encoding: [0x00,0xa1,0x00,0x18]
# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
# CHECK-TRAP:   addiu   $1, $zero, 0            # encoding: [0x24,0x01,0x00,0x00]
# CHECK-TRAP:   mult    $5, $1                  # encoding: [0x00,0xa1,0x00,0x18]
# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
  mul   $4, $5, 1
# CHECK:        addiu   $1, $zero, 1            # encoding: [0x24,0x01,0x00,0x01]
# CHECK:        mult    $5, $1                  # encoding: [0x00,0xa1,0x00,0x18]
# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
# CHECK-TRAP:   addiu   $1, $zero, 1            # encoding: [0x24,0x01,0x00,0x01]
# CHECK-TRAP:   mult    $5, $1                  # encoding: [0x00,0xa1,0x00,0x18]
# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
  mul  $4, $5, 0x8000
# CHECK:        ori     $1, $zero, 32768        # encoding: [0x34,0x01,0x80,0x00]
# CHECK:        mult    $5, $1                  # encoding: [0x00,0xa1,0x00,0x18]
# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
# CHECK-TRAP:   ori     $1, $zero, 32768        # encoding: [0x34,0x01,0x80,0x00]
# CHECK-TRAP:   mult    $5, $1                  # encoding: [0x00,0xa1,0x00,0x18]
# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
  mul  $4, $5, -0x8000
# CHECK:        addiu   $1, $zero, -32768       # encoding: [0x24,0x01,0x80,0x00]
# CHECK:        mult    $5, $1                  # encoding: [0x00,0xa1,0x00,0x18]
# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
# CHECK-TRAP:   addiu   $1, $zero, -32768       # encoding: [0x24,0x01,0x80,0x00]
# CHECK-TRAP:   mult    $5, $1                  # encoding: [0x00,0xa1,0x00,0x18]
# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
  mul  $4, $5, 0x10000
# CHECK:        lui     $1, 1                   # encoding: [0x3c,0x01,0x00,0x01]
# CHECK:        mult    $5, $1                  # encoding: [0x00,0xa1,0x00,0x18]
# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
# CHECK-TRAP:   lui     $1, 1                   # encoding: [0x3c,0x01,0x00,0x01]
# CHECK-TRAP:   mult    $5, $1                  # encoding: [0x00,0xa1,0x00,0x18]
# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
  mul  $4, $5, 0x1a5a5
# CHECK:        lui     $1, 1                   # encoding: [0x3c,0x01,0x00,0x01]
# CHECK:        ori     $1, $1, 42405           # encoding: [0x34,0x21,0xa5,0xa5]
# CHECK:        mult    $5, $1                  # encoding: [0x00,0xa1,0x00,0x18]
# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
# CHECK-TRAP:   lui     $1, 1                   # encoding: [0x3c,0x01,0x00,0x01]
# CHECK-TRAP:   ori     $1, $1, 42405           # encoding: [0x34,0x21,0xa5,0xa5]
# CHECK-TRAP:   mult    $5, $1                  # encoding: [0x00,0xa1,0x00,0x18]
# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
  mulo  $4, $5
# CHECK:        mult    $4, $5                  # encoding: [0x00,0x85,0x00,0x18]
# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
# CHECK:        sra     $4, $4, 31              # encoding: [0x00,0x04,0x27,0xc3]
# CHECK:        mfhi    $1                      # encoding: [0x00,0x00,0x08,0x10]
# CHECK:        beq     $4, $1, $tmp0           # encoding: [0x10,0x81,A,A]
# CHECK:        nop                             # encoding: [0x00,0x00,0x00,0x00]
# CHECK:        break   6                       # encoding: [0x00,0x06,0x00,0x0d]
# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
# CHECK-TRAP:   mult    $4, $5                  # encoding: [0x00,0x85,0x00,0x18]
# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
# CHECK-TRAP:   sra     $4, $4, 31              # encoding: [0x00,0x04,0x27,0xc3]
# CHECK-TRAP:   mfhi    $1                      # encoding: [0x00,0x00,0x08,0x10]
# CHECK-TRAP:   tne     $4, $1, 6               # encoding: [0x00,0x81,0x01,0xb6]
# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]

  mulo  $4, $5, $6
# CHECK:        mult    $5, $6                  # encoding: [0x00,0xa6,0x00,0x18]
# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
# CHECK:        sra     $4, $4, 31              # encoding: [0x00,0x04,0x27,0xc3]
# CHECK:        mfhi    $1                      # encoding: [0x00,0x00,0x08,0x10]
# CHECK:        beq     $4, $1, $tmp1           # encoding: [0x10,0x81,A,A]
# CHECK:        nop                             # encoding: [0x00,0x00,0x00,0x00]
# CHECK:        break   6                       # encoding: [0x00,0x06,0x00,0x0d]
# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
# CHECK-TRAP:   mult    $5, $6                  # encoding: [0x00,0xa6,0x00,0x18]
# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
# CHECK-TRAP:   sra     $4, $4, 31              # encoding: [0x00,0x04,0x27,0xc3]
# CHECK-TRAP:   mfhi    $1                      # encoding: [0x00,0x00,0x08,0x10]
# CHECK-TRAP:   tne     $4, $1, 6               # encoding: [0x00,0x81,0x01,0xb6]
# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
 mulou  $4,$5
# CHECK:        multu   $4, $5                  # encoding: [0x00,0x85,0x00,0x19]
# CHECK:        mfhi    $1                      # encoding: [0x00,0x00,0x08,0x10]
# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
# CHECK:        beqz    $1, $tmp2               # encoding: [0x10,0x20,A,A]
# CHECK:        nop                             # encoding: [0x00,0x00,0x00,0x00]
# CHECK:        break   6                       # encoding: [0x00,0x06,0x00,0x0d]
# CHECK-TRAP:   multu   $4, $5                  # encoding: [0x00,0x85,0x00,0x19]
# CHECK-TRAP:   mfhi    $1                      # encoding: [0x00,0x00,0x08,0x10]
# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
# CHECK-TRAP:   tne     $1, $zero, 6            # encoding: [0x00,0x20,0x01,0xb6]
 mulou $4, $5, $6
# CHECK:        multu   $5, $6                  # encoding: [0x00,0xa6,0x00,0x19]
# CHECK:        mfhi    $1                      # encoding: [0x00,0x00,0x08,0x10]
# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
# CHECK:        beqz    $1, $tmp3               # encoding: [0x10,0x20,A,A]
# CHECK:        nop                             # encoding: [0x00,0x00,0x00,0x00]
# CHECK:        break   6                       # encoding: [0x00,0x06,0x00,0x0d]
# CHECK-TRAP:   multu   $5, $6                  # encoding: [0x00,0xa6,0x00,0x19]
# CHECK-TRAP:   mfhi    $1                      # encoding: [0x00,0x00,0x08,0x10]
# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
# CHECK-TRAP:   tne     $1, $zero, 6            # encoding: [0x00,0x20,0x01,0xb6]

 dmul $4, $5, $6
# CHECK:        dmultu  $5, $6                  # encoding: [0x00,0xa6,0x00,0x1d]
# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
# CHECK-TRAP    dmultu  $5, $6                  # encoding: [0x00,0xa6,0x00,0x1d]
# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
 dmul $4, $5, 1
# CHECK:        addiu   $1, $zero, 1            # encoding: [0x24,0x01,0x00,0x01]
# CHECK:        dmult   $5, $1                  # encoding: [0x00,0xa1,0x00,0x1c]
# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
# CHECK-TRAP:   addiu   $1, $zero, 1            # encoding: [0x24,0x01,0x00,0x01]
# CHECK-TRAP:   dmult   $5, $1                  # encoding: [0x00,0xa1,0x00,0x1c]
# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
 dmulo $4, $5, $6
# CHECK:        dmult   $5, $6                  # encoding: [0x00,0xa6,0x00,0x1c]
# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
# CHECK:        dsra32  $4, $4, 31              # encoding: [0x00,0x04,0x27,0xff]
# CHECK:        mfhi    $1                      # encoding: [0x00,0x00,0x08,0x10]
# CHECK:        beq     $4, $1, $tmp4           # encoding: [0x10,0x81,A,A]
# CHECK:        nop                             # encoding: [0x00,0x00,0x00,0x00]
# CHECK:        break   6                       # encoding: [0x00,0x06,0x00,0x0d]
# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
# CHECK-TRAP:   dmult   $5, $6                  # encoding: [0x00,0xa6,0x00,0x1c]
# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
# CHECK-TRAP:   dsra32  $4, $4, 31              # encoding: [0x00,0x04,0x27,0xff]
# CHECK-TRAP:   mfhi    $1                      # encoding: [0x00,0x00,0x08,0x10]
# CHECK-TRAP:   tne     $4, $1, 6               # encoding: [0x00,0x81,0x01,0xb6]
# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
 dmulou  $4,$5,$6
# CHECK:        dmultu  $5, $6                  # encoding: [0x00,0xa6,0x00,0x1d]
# CHECK:        mfhi    $1                      # encoding: [0x00,0x00,0x08,0x10]
# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
# CHECK:        beqz    $1, $tmp5               # encoding: [0x10,0x20,A,A]
# CHECK:        nop                             # encoding: [0x00,0x00,0x00,0x00]
# CHECK:        break   6                       # encoding: [0x00,0x06,0x00,0x0d]
# CHECK-TRAP:   dmultu  $5, $6                  # encoding: [0x00,0xa6,0x00,0x1d]
# CHECK-TRAP:   mfhi    $1                      # encoding: [0x00,0x00,0x08,0x10]
# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
# CHECK-TRAP:   tne     $1, $zero, 6            # encoding: [0x00,0x20,0x01,0xb6]