• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef V8_COMPILER_MIPS_INSTRUCTION_CODES_MIPS_H_
6 #define V8_COMPILER_MIPS_INSTRUCTION_CODES_MIPS_H_
7 
8 namespace v8 {
9 namespace internal {
10 namespace compiler {
11 
12 // MIPS-specific opcodes that specify which assembly sequence to emit.
13 // Most opcodes specify a single instruction.
14 #define TARGET_ARCH_OPCODE_LIST(V) \
15   V(MipsAdd)                       \
16   V(MipsAddOvf)                    \
17   V(MipsSub)                       \
18   V(MipsSubOvf)                    \
19   V(MipsMul)                       \
20   V(MipsMulOvf)                    \
21   V(MipsMulHigh)                   \
22   V(MipsMulHighU)                  \
23   V(MipsDiv)                       \
24   V(MipsDivU)                      \
25   V(MipsMod)                       \
26   V(MipsModU)                      \
27   V(MipsAnd)                       \
28   V(MipsOr)                        \
29   V(MipsNor)                       \
30   V(MipsXor)                       \
31   V(MipsClz)                       \
32   V(MipsCtz)                       \
33   V(MipsPopcnt)                    \
34   V(MipsLsa)                       \
35   V(MipsShl)                       \
36   V(MipsShr)                       \
37   V(MipsSar)                       \
38   V(MipsShlPair)                   \
39   V(MipsShrPair)                   \
40   V(MipsSarPair)                   \
41   V(MipsExt)                       \
42   V(MipsIns)                       \
43   V(MipsRor)                       \
44   V(MipsMov)                       \
45   V(MipsTst)                       \
46   V(MipsCmp)                       \
47   V(MipsCmpS)                      \
48   V(MipsAddS)                      \
49   V(MipsSubS)                      \
50   V(MipsMulS)                      \
51   V(MipsDivS)                      \
52   V(MipsModS)                      \
53   V(MipsAbsS)                      \
54   V(MipsSqrtS)                     \
55   V(MipsMaxS)                      \
56   V(MipsMinS)                      \
57   V(MipsCmpD)                      \
58   V(MipsAddD)                      \
59   V(MipsSubD)                      \
60   V(MipsMulD)                      \
61   V(MipsDivD)                      \
62   V(MipsModD)                      \
63   V(MipsAbsD)                      \
64   V(MipsSqrtD)                     \
65   V(MipsMaxD)                      \
66   V(MipsMinD)                      \
67   V(MipsNegS)                      \
68   V(MipsNegD)                      \
69   V(MipsAddPair)                   \
70   V(MipsSubPair)                   \
71   V(MipsMulPair)                   \
72   V(MipsMaddS)                     \
73   V(MipsMaddD)                     \
74   V(MipsMsubS)                     \
75   V(MipsMsubD)                     \
76   V(MipsFloat32RoundDown)          \
77   V(MipsFloat32RoundTruncate)      \
78   V(MipsFloat32RoundUp)            \
79   V(MipsFloat32RoundTiesEven)      \
80   V(MipsFloat64RoundDown)          \
81   V(MipsFloat64RoundTruncate)      \
82   V(MipsFloat64RoundUp)            \
83   V(MipsFloat64RoundTiesEven)      \
84   V(MipsCvtSD)                     \
85   V(MipsCvtDS)                     \
86   V(MipsTruncWD)                   \
87   V(MipsRoundWD)                   \
88   V(MipsFloorWD)                   \
89   V(MipsCeilWD)                    \
90   V(MipsTruncWS)                   \
91   V(MipsRoundWS)                   \
92   V(MipsFloorWS)                   \
93   V(MipsCeilWS)                    \
94   V(MipsTruncUwD)                  \
95   V(MipsTruncUwS)                  \
96   V(MipsCvtDW)                     \
97   V(MipsCvtDUw)                    \
98   V(MipsCvtSW)                     \
99   V(MipsCvtSUw)                    \
100   V(MipsLb)                        \
101   V(MipsLbu)                       \
102   V(MipsSb)                        \
103   V(MipsLh)                        \
104   V(MipsUlh)                       \
105   V(MipsLhu)                       \
106   V(MipsUlhu)                      \
107   V(MipsSh)                        \
108   V(MipsUsh)                       \
109   V(MipsLw)                        \
110   V(MipsUlw)                       \
111   V(MipsSw)                        \
112   V(MipsUsw)                       \
113   V(MipsLwc1)                      \
114   V(MipsUlwc1)                     \
115   V(MipsSwc1)                      \
116   V(MipsUswc1)                     \
117   V(MipsLdc1)                      \
118   V(MipsUldc1)                     \
119   V(MipsSdc1)                      \
120   V(MipsUsdc1)                     \
121   V(MipsFloat64ExtractLowWord32)   \
122   V(MipsFloat64ExtractHighWord32)  \
123   V(MipsFloat64InsertLowWord32)    \
124   V(MipsFloat64InsertHighWord32)   \
125   V(MipsFloat64SilenceNaN)         \
126   V(MipsFloat32Max)                \
127   V(MipsFloat64Max)                \
128   V(MipsFloat32Min)                \
129   V(MipsFloat64Min)                \
130   V(MipsPush)                      \
131   V(MipsPeek)                      \
132   V(MipsStoreToStackSlot)          \
133   V(MipsByteSwap32)                \
134   V(MipsStackClaim)                \
135   V(MipsSeb)                       \
136   V(MipsSeh)                       \
137   V(MipsS128Zero)                  \
138   V(MipsI32x4Splat)                \
139   V(MipsI32x4ExtractLane)          \
140   V(MipsI32x4ReplaceLane)          \
141   V(MipsI32x4Add)                  \
142   V(MipsI32x4AddHoriz)             \
143   V(MipsI32x4Sub)                  \
144   V(MipsF32x4Splat)                \
145   V(MipsF32x4ExtractLane)          \
146   V(MipsF32x4ReplaceLane)          \
147   V(MipsF32x4SConvertI32x4)        \
148   V(MipsF32x4UConvertI32x4)        \
149   V(MipsI32x4Mul)                  \
150   V(MipsI32x4MaxS)                 \
151   V(MipsI32x4MinS)                 \
152   V(MipsI32x4Eq)                   \
153   V(MipsI32x4Ne)                   \
154   V(MipsI32x4Shl)                  \
155   V(MipsI32x4ShrS)                 \
156   V(MipsI32x4ShrU)                 \
157   V(MipsI32x4MaxU)                 \
158   V(MipsI32x4MinU)                 \
159   V(MipsF32x4Abs)                  \
160   V(MipsF32x4Neg)                  \
161   V(MipsF32x4RecipApprox)          \
162   V(MipsF32x4RecipSqrtApprox)      \
163   V(MipsF32x4Add)                  \
164   V(MipsF32x4AddHoriz)             \
165   V(MipsF32x4Sub)                  \
166   V(MipsF32x4Mul)                  \
167   V(MipsF32x4Max)                  \
168   V(MipsF32x4Min)                  \
169   V(MipsF32x4Eq)                   \
170   V(MipsF32x4Ne)                   \
171   V(MipsF32x4Lt)                   \
172   V(MipsF32x4Le)                   \
173   V(MipsI32x4SConvertF32x4)        \
174   V(MipsI32x4UConvertF32x4)        \
175   V(MipsI32x4Neg)                  \
176   V(MipsI32x4GtS)                  \
177   V(MipsI32x4GeS)                  \
178   V(MipsI32x4GtU)                  \
179   V(MipsI32x4GeU)                  \
180   V(MipsI16x8Splat)                \
181   V(MipsI16x8ExtractLane)          \
182   V(MipsI16x8ReplaceLane)          \
183   V(MipsI16x8Neg)                  \
184   V(MipsI16x8Shl)                  \
185   V(MipsI16x8ShrS)                 \
186   V(MipsI16x8ShrU)                 \
187   V(MipsI16x8Add)                  \
188   V(MipsI16x8AddSaturateS)         \
189   V(MipsI16x8AddHoriz)             \
190   V(MipsI16x8Sub)                  \
191   V(MipsI16x8SubSaturateS)         \
192   V(MipsI16x8Mul)                  \
193   V(MipsI16x8MaxS)                 \
194   V(MipsI16x8MinS)                 \
195   V(MipsI16x8Eq)                   \
196   V(MipsI16x8Ne)                   \
197   V(MipsI16x8GtS)                  \
198   V(MipsI16x8GeS)                  \
199   V(MipsI16x8AddSaturateU)         \
200   V(MipsI16x8SubSaturateU)         \
201   V(MipsI16x8MaxU)                 \
202   V(MipsI16x8MinU)                 \
203   V(MipsI16x8GtU)                  \
204   V(MipsI16x8GeU)                  \
205   V(MipsI8x16Splat)                \
206   V(MipsI8x16ExtractLane)          \
207   V(MipsI8x16ReplaceLane)          \
208   V(MipsI8x16Neg)                  \
209   V(MipsI8x16Shl)                  \
210   V(MipsI8x16ShrS)                 \
211   V(MipsI8x16Add)                  \
212   V(MipsI8x16AddSaturateS)         \
213   V(MipsI8x16Sub)                  \
214   V(MipsI8x16SubSaturateS)         \
215   V(MipsI8x16Mul)                  \
216   V(MipsI8x16MaxS)                 \
217   V(MipsI8x16MinS)                 \
218   V(MipsI8x16Eq)                   \
219   V(MipsI8x16Ne)                   \
220   V(MipsI8x16GtS)                  \
221   V(MipsI8x16GeS)                  \
222   V(MipsI8x16ShrU)                 \
223   V(MipsI8x16AddSaturateU)         \
224   V(MipsI8x16SubSaturateU)         \
225   V(MipsI8x16MaxU)                 \
226   V(MipsI8x16MinU)                 \
227   V(MipsI8x16GtU)                  \
228   V(MipsI8x16GeU)                  \
229   V(MipsS128And)                   \
230   V(MipsS128Or)                    \
231   V(MipsS128Xor)                   \
232   V(MipsS128Not)                   \
233   V(MipsS128Select)                \
234   V(MipsS1x4AnyTrue)               \
235   V(MipsS1x4AllTrue)               \
236   V(MipsS1x8AnyTrue)               \
237   V(MipsS1x8AllTrue)               \
238   V(MipsS1x16AnyTrue)              \
239   V(MipsS1x16AllTrue)              \
240   V(MipsS32x4InterleaveRight)      \
241   V(MipsS32x4InterleaveLeft)       \
242   V(MipsS32x4PackEven)             \
243   V(MipsS32x4PackOdd)              \
244   V(MipsS32x4InterleaveEven)       \
245   V(MipsS32x4InterleaveOdd)        \
246   V(MipsS32x4Shuffle)              \
247   V(MipsS16x8InterleaveRight)      \
248   V(MipsS16x8InterleaveLeft)       \
249   V(MipsS16x8PackEven)             \
250   V(MipsS16x8PackOdd)              \
251   V(MipsS16x8InterleaveEven)       \
252   V(MipsS16x8InterleaveOdd)        \
253   V(MipsS16x4Reverse)              \
254   V(MipsS16x2Reverse)              \
255   V(MipsS8x16InterleaveRight)      \
256   V(MipsS8x16InterleaveLeft)       \
257   V(MipsS8x16PackEven)             \
258   V(MipsS8x16PackOdd)              \
259   V(MipsS8x16InterleaveEven)       \
260   V(MipsS8x16InterleaveOdd)        \
261   V(MipsS8x16Shuffle)              \
262   V(MipsS8x16Concat)               \
263   V(MipsS8x8Reverse)               \
264   V(MipsS8x4Reverse)               \
265   V(MipsS8x2Reverse)               \
266   V(MipsMsaLd)                     \
267   V(MipsMsaSt)                     \
268   V(MipsI32x4SConvertI16x8Low)     \
269   V(MipsI32x4SConvertI16x8High)    \
270   V(MipsI32x4UConvertI16x8Low)     \
271   V(MipsI32x4UConvertI16x8High)    \
272   V(MipsI16x8SConvertI8x16Low)     \
273   V(MipsI16x8SConvertI8x16High)    \
274   V(MipsI16x8SConvertI32x4)        \
275   V(MipsI16x8UConvertI32x4)        \
276   V(MipsI16x8UConvertI8x16Low)     \
277   V(MipsI16x8UConvertI8x16High)    \
278   V(MipsI8x16SConvertI16x8)        \
279   V(MipsI8x16UConvertI16x8)
280 
281 // Addressing modes represent the "shape" of inputs to an instruction.
282 // Many instructions support multiple addressing modes. Addressing modes
283 // are encoded into the InstructionCode of the instruction and tell the
284 // code generator after register allocation which assembler method to call.
285 //
286 // We use the following local notation for addressing modes:
287 //
288 // R = register
289 // O = register or stack slot
290 // D = double register
291 // I = immediate (handle, external, int32)
292 // MRI = [register + immediate]
293 // MRR = [register + register]
294 // TODO(plind): Add the new r6 address modes.
295 #define TARGET_ADDRESSING_MODE_LIST(V) \
296   V(MRI) /* [%r0 + K] */               \
297   V(MRR) /* [%r0 + %r1] */
298 
299 
300 }  // namespace compiler
301 }  // namespace internal
302 }  // namespace v8
303 
304 #endif  // V8_COMPILER_MIPS_INSTRUCTION_CODES_MIPS_H_
305