blob: d85c2a7fe559962c93f681714b5feac42e7cb3e6 [file] [log] [blame]
Emily Bernierd0a1eb72015-03-24 16:35:39 -04001// 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
8namespace v8 {
9namespace internal {
10namespace 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(MipsMulHigh) \
21 V(MipsMulHighU) \
22 V(MipsDiv) \
23 V(MipsDivU) \
24 V(MipsMod) \
25 V(MipsModU) \
26 V(MipsAnd) \
27 V(MipsOr) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000028 V(MipsNor) \
Emily Bernierd0a1eb72015-03-24 16:35:39 -040029 V(MipsXor) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000030 V(MipsClz) \
Ben Murdoch097c5b22016-05-18 11:27:45 +010031 V(MipsCtz) \
32 V(MipsPopcnt) \
Emily Bernierd0a1eb72015-03-24 16:35:39 -040033 V(MipsShl) \
34 V(MipsShr) \
35 V(MipsSar) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000036 V(MipsExt) \
37 V(MipsIns) \
Emily Bernierd0a1eb72015-03-24 16:35:39 -040038 V(MipsRor) \
39 V(MipsMov) \
40 V(MipsTst) \
41 V(MipsCmp) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000042 V(MipsCmpS) \
43 V(MipsAddS) \
44 V(MipsSubS) \
45 V(MipsMulS) \
46 V(MipsDivS) \
47 V(MipsModS) \
48 V(MipsAbsS) \
49 V(MipsSqrtS) \
50 V(MipsMaxS) \
51 V(MipsMinS) \
Emily Bernierd0a1eb72015-03-24 16:35:39 -040052 V(MipsCmpD) \
53 V(MipsAddD) \
54 V(MipsSubD) \
55 V(MipsMulD) \
56 V(MipsDivD) \
57 V(MipsModD) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000058 V(MipsAbsD) \
Emily Bernierd0a1eb72015-03-24 16:35:39 -040059 V(MipsSqrtD) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000060 V(MipsMaxD) \
61 V(MipsMinD) \
Ben Murdochda12d292016-06-02 14:46:10 +010062 V(MipsMulPair) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000063 V(MipsFloat32RoundDown) \
64 V(MipsFloat32RoundTruncate) \
65 V(MipsFloat32RoundUp) \
66 V(MipsFloat32RoundTiesEven) \
67 V(MipsFloat64RoundDown) \
Emily Bernierd0a1eb72015-03-24 16:35:39 -040068 V(MipsFloat64RoundTruncate) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000069 V(MipsFloat64RoundUp) \
70 V(MipsFloat64RoundTiesEven) \
Emily Bernierd0a1eb72015-03-24 16:35:39 -040071 V(MipsCvtSD) \
72 V(MipsCvtDS) \
73 V(MipsTruncWD) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000074 V(MipsRoundWD) \
75 V(MipsFloorWD) \
76 V(MipsCeilWD) \
77 V(MipsTruncWS) \
78 V(MipsRoundWS) \
79 V(MipsFloorWS) \
80 V(MipsCeilWS) \
Emily Bernierd0a1eb72015-03-24 16:35:39 -040081 V(MipsTruncUwD) \
Ben Murdoch097c5b22016-05-18 11:27:45 +010082 V(MipsTruncUwS) \
Emily Bernierd0a1eb72015-03-24 16:35:39 -040083 V(MipsCvtDW) \
84 V(MipsCvtDUw) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000085 V(MipsCvtSW) \
Ben Murdoch097c5b22016-05-18 11:27:45 +010086 V(MipsCvtSUw) \
Emily Bernierd0a1eb72015-03-24 16:35:39 -040087 V(MipsLb) \
88 V(MipsLbu) \
89 V(MipsSb) \
90 V(MipsLh) \
91 V(MipsLhu) \
92 V(MipsSh) \
93 V(MipsLw) \
94 V(MipsSw) \
95 V(MipsLwc1) \
96 V(MipsSwc1) \
97 V(MipsLdc1) \
98 V(MipsSdc1) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000099 V(MipsFloat64ExtractLowWord32) \
100 V(MipsFloat64ExtractHighWord32) \
101 V(MipsFloat64InsertLowWord32) \
102 V(MipsFloat64InsertHighWord32) \
103 V(MipsFloat64Max) \
104 V(MipsFloat64Min) \
105 V(MipsFloat32Max) \
106 V(MipsFloat32Min) \
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400107 V(MipsPush) \
108 V(MipsStoreToStackSlot) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000109 V(MipsStackClaim)
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400110
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400111// Addressing modes represent the "shape" of inputs to an instruction.
112// Many instructions support multiple addressing modes. Addressing modes
113// are encoded into the InstructionCode of the instruction and tell the
114// code generator after register allocation which assembler method to call.
115//
116// We use the following local notation for addressing modes:
117//
118// R = register
119// O = register or stack slot
120// D = double register
121// I = immediate (handle, external, int32)
122// MRI = [register + immediate]
123// MRR = [register + register]
124// TODO(plind): Add the new r6 address modes.
125#define TARGET_ADDRESSING_MODE_LIST(V) \
126 V(MRI) /* [%r0 + K] */ \
127 V(MRR) /* [%r0 + %r1] */
128
129
130} // namespace compiler
131} // namespace internal
132} // namespace v8
133
134#endif // V8_COMPILER_MIPS_INSTRUCTION_CODES_MIPS_H_