• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: llvm-mc  %s -triple mips-unknown-linux -show-encoding -mcpu=mips64r2 | FileCheck %s
2# RUN: llvm-mc  %s -triple mips-unknown-linux -show-encoding -mcpu=mips64r3 | FileCheck %s
3# RUN: llvm-mc  %s -triple mips-unknown-linux -show-encoding -mcpu=mips64r5 | FileCheck %s
4
5# RUN: llvm-mc  %s -triple mips-unknown-linux -show-encoding -mattr=use-tcc-in-div -mcpu=mips64 | FileCheck %s --check-prefix=CHECK-TRAP
6# RUN: llvm-mc  %s -triple mips-unknown-linux -show-encoding -mattr=use-tcc-in-div -mcpu=mips64r2 | FileCheck %s --check-prefix=CHECK-TRAP
7# RUN: llvm-mc  %s -triple mips-unknown-linux -show-encoding -mattr=use-tcc-in-div -mcpu=mips64r3 | FileCheck %s --check-prefix=CHECK-TRAP
8# RUN: llvm-mc  %s -triple mips-unknown-linux -show-encoding -mattr=use-tcc-in-div -mcpu=mips64r5 | FileCheck %s --check-prefix=CHECK-TRAP
9
10.text
11text_label:
12
13  mul  $4, $5
14# CHECK:        mul     $4, $4, $5              # encoding: [0x70,0x85,0x20,0x02]
15# CHECK-TRAP:   mul     $4, $4, $5              # encoding: [0x70,0x85,0x20,0x02]
16  mul   $4, $5, $6
17# CHECK:        mul     $4, $5, $6              # encoding: [0x70,0xa6,0x20,0x02]
18# CHECK-TRAP:   mul     $4, $5, $6              # encoding: [0x70,0xa6,0x20,0x02]
19  mul  $4, $5, 0
20# CHECK:        addiu   $1, $zero, 0            # encoding: [0x24,0x01,0x00,0x00]
21# CHECK:        mult    $5, $1                  # encoding: [0x00,0xa1,0x00,0x18]
22# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
23# CHECK-TRAP:   addiu   $1, $zero, 0            # encoding: [0x24,0x01,0x00,0x00]
24# CHECK-TRAP:   mult    $5, $1                  # encoding: [0x00,0xa1,0x00,0x18]
25# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
26  mul   $4, $5, 1
27# CHECK:        addiu   $1, $zero, 1            # encoding: [0x24,0x01,0x00,0x01]
28# CHECK:        mult    $5, $1                  # encoding: [0x00,0xa1,0x00,0x18]
29# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
30# CHECK-TRAP:   addiu   $1, $zero, 1            # encoding: [0x24,0x01,0x00,0x01]
31# CHECK-TRAP:   mult    $5, $1                  # encoding: [0x00,0xa1,0x00,0x18]
32# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
33  mul  $4, $5, 0x8000
34# CHECK:        ori     $1, $zero, 32768        # encoding: [0x34,0x01,0x80,0x00]
35# CHECK:        mult    $5, $1                  # encoding: [0x00,0xa1,0x00,0x18]
36# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
37# CHECK-TRAP:   ori     $1, $zero, 32768        # encoding: [0x34,0x01,0x80,0x00]
38# CHECK-TRAP:   mult    $5, $1                  # encoding: [0x00,0xa1,0x00,0x18]
39# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
40  mul  $4, $5, -0x8000
41# CHECK:        addiu   $1, $zero, -32768       # encoding: [0x24,0x01,0x80,0x00]
42# CHECK:        mult    $5, $1                  # encoding: [0x00,0xa1,0x00,0x18]
43# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
44# CHECK-TRAP:   addiu   $1, $zero, -32768       # encoding: [0x24,0x01,0x80,0x00]
45# CHECK-TRAP:   mult    $5, $1                  # encoding: [0x00,0xa1,0x00,0x18]
46# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
47  mul  $4, $5, 0x10000
48# CHECK:        lui     $1, 1                   # encoding: [0x3c,0x01,0x00,0x01]
49# CHECK:        mult    $5, $1                  # encoding: [0x00,0xa1,0x00,0x18]
50# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
51# CHECK-TRAP:   lui     $1, 1                   # encoding: [0x3c,0x01,0x00,0x01]
52# CHECK-TRAP:   mult    $5, $1                  # encoding: [0x00,0xa1,0x00,0x18]
53# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
54  mul  $4, $5, 0x1a5a5
55# CHECK:        lui     $1, 1                   # encoding: [0x3c,0x01,0x00,0x01]
56# CHECK:        ori     $1, $1, 42405           # encoding: [0x34,0x21,0xa5,0xa5]
57# CHECK:        mult    $5, $1                  # encoding: [0x00,0xa1,0x00,0x18]
58# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
59# CHECK-TRAP:   lui     $1, 1                   # encoding: [0x3c,0x01,0x00,0x01]
60# CHECK-TRAP:   ori     $1, $1, 42405           # encoding: [0x34,0x21,0xa5,0xa5]
61# CHECK-TRAP:   mult    $5, $1                  # encoding: [0x00,0xa1,0x00,0x18]
62# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
63  mulo  $4, $5
64# CHECK:        mult    $4, $5                  # encoding: [0x00,0x85,0x00,0x18]
65# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
66# CHECK:        sra     $4, $4, 31              # encoding: [0x00,0x04,0x27,0xc3]
67# CHECK:        mfhi    $1                      # encoding: [0x00,0x00,0x08,0x10]
68# CHECK:        beq     $4, $1, $tmp0           # encoding: [0x10,0x81,A,A]
69# CHECK:        nop                             # encoding: [0x00,0x00,0x00,0x00]
70# CHECK:        break   6                       # encoding: [0x00,0x06,0x00,0x0d]
71# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
72# CHECK-TRAP:   mult    $4, $5                  # encoding: [0x00,0x85,0x00,0x18]
73# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
74# CHECK-TRAP:   sra     $4, $4, 31              # encoding: [0x00,0x04,0x27,0xc3]
75# CHECK-TRAP:   mfhi    $1                      # encoding: [0x00,0x00,0x08,0x10]
76# CHECK-TRAP:   tne     $4, $1, 6               # encoding: [0x00,0x81,0x01,0xb6]
77# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
78
79  mulo  $4, $5, $6
80# CHECK:        mult    $5, $6                  # encoding: [0x00,0xa6,0x00,0x18]
81# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
82# CHECK:        sra     $4, $4, 31              # encoding: [0x00,0x04,0x27,0xc3]
83# CHECK:        mfhi    $1                      # encoding: [0x00,0x00,0x08,0x10]
84# CHECK:        beq     $4, $1, $tmp1           # encoding: [0x10,0x81,A,A]
85# CHECK:        nop                             # encoding: [0x00,0x00,0x00,0x00]
86# CHECK:        break   6                       # encoding: [0x00,0x06,0x00,0x0d]
87# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
88# CHECK-TRAP:   mult    $5, $6                  # encoding: [0x00,0xa6,0x00,0x18]
89# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
90# CHECK-TRAP:   sra     $4, $4, 31              # encoding: [0x00,0x04,0x27,0xc3]
91# CHECK-TRAP:   mfhi    $1                      # encoding: [0x00,0x00,0x08,0x10]
92# CHECK-TRAP:   tne     $4, $1, 6               # encoding: [0x00,0x81,0x01,0xb6]
93# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
94 mulou  $4,$5
95# CHECK:        multu   $4, $5                  # encoding: [0x00,0x85,0x00,0x19]
96# CHECK:        mfhi    $1                      # encoding: [0x00,0x00,0x08,0x10]
97# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
98# CHECK:        beqz    $1, $tmp2               # encoding: [0x10,0x20,A,A]
99# CHECK:        nop                             # encoding: [0x00,0x00,0x00,0x00]
100# CHECK:        break   6                       # encoding: [0x00,0x06,0x00,0x0d]
101# CHECK-TRAP:   multu   $4, $5                  # encoding: [0x00,0x85,0x00,0x19]
102# CHECK-TRAP:   mfhi    $1                      # encoding: [0x00,0x00,0x08,0x10]
103# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
104# CHECK-TRAP:   tne     $1, $zero, 6            # encoding: [0x00,0x20,0x01,0xb6]
105 mulou $4, $5, $6
106# CHECK:        multu   $5, $6                  # encoding: [0x00,0xa6,0x00,0x19]
107# CHECK:        mfhi    $1                      # encoding: [0x00,0x00,0x08,0x10]
108# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
109# CHECK:        beqz    $1, $tmp3               # encoding: [0x10,0x20,A,A]
110# CHECK:        nop                             # encoding: [0x00,0x00,0x00,0x00]
111# CHECK:        break   6                       # encoding: [0x00,0x06,0x00,0x0d]
112# CHECK-TRAP:   multu   $5, $6                  # encoding: [0x00,0xa6,0x00,0x19]
113# CHECK-TRAP:   mfhi    $1                      # encoding: [0x00,0x00,0x08,0x10]
114# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
115# CHECK-TRAP:   tne     $1, $zero, 6            # encoding: [0x00,0x20,0x01,0xb6]
116
117 dmul $4, $5, $6
118# CHECK:        dmultu  $5, $6                  # encoding: [0x00,0xa6,0x00,0x1d]
119# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
120# CHECK-TRAP    dmultu  $5, $6                  # encoding: [0x00,0xa6,0x00,0x1d]
121# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
122 dmul $4, $5, 1
123# CHECK:        addiu   $1, $zero, 1            # encoding: [0x24,0x01,0x00,0x01]
124# CHECK:        dmult   $5, $1                  # encoding: [0x00,0xa1,0x00,0x1c]
125# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
126# CHECK-TRAP:   addiu   $1, $zero, 1            # encoding: [0x24,0x01,0x00,0x01]
127# CHECK-TRAP:   dmult   $5, $1                  # encoding: [0x00,0xa1,0x00,0x1c]
128# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
129 dmulo $4, $5, $6
130# CHECK:        dmult   $5, $6                  # encoding: [0x00,0xa6,0x00,0x1c]
131# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
132# CHECK:        dsra32  $4, $4, 31              # encoding: [0x00,0x04,0x27,0xff]
133# CHECK:        mfhi    $1                      # encoding: [0x00,0x00,0x08,0x10]
134# CHECK:        beq     $4, $1, $tmp4           # encoding: [0x10,0x81,A,A]
135# CHECK:        nop                             # encoding: [0x00,0x00,0x00,0x00]
136# CHECK:        break   6                       # encoding: [0x00,0x06,0x00,0x0d]
137# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
138# CHECK-TRAP:   dmult   $5, $6                  # encoding: [0x00,0xa6,0x00,0x1c]
139# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
140# CHECK-TRAP:   dsra32  $4, $4, 31              # encoding: [0x00,0x04,0x27,0xff]
141# CHECK-TRAP:   mfhi    $1                      # encoding: [0x00,0x00,0x08,0x10]
142# CHECK-TRAP:   tne     $4, $1, 6               # encoding: [0x00,0x81,0x01,0xb6]
143# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
144 dmulou  $4,$5,$6
145# CHECK:        dmultu  $5, $6                  # encoding: [0x00,0xa6,0x00,0x1d]
146# CHECK:        mfhi    $1                      # encoding: [0x00,0x00,0x08,0x10]
147# CHECK:        mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
148# CHECK:        beqz    $1, $tmp5               # encoding: [0x10,0x20,A,A]
149# CHECK:        nop                             # encoding: [0x00,0x00,0x00,0x00]
150# CHECK:        break   6                       # encoding: [0x00,0x06,0x00,0x0d]
151# CHECK-TRAP:   dmultu  $5, $6                  # encoding: [0x00,0xa6,0x00,0x1d]
152# CHECK-TRAP:   mfhi    $1                      # encoding: [0x00,0x00,0x08,0x10]
153# CHECK-TRAP:   mflo    $4                      # encoding: [0x00,0x00,0x20,0x12]
154# CHECK-TRAP:   tne     $1, $zero, 6            # encoding: [0x00,0x20,0x01,0xb6]
155