blob: ec9fd188fcd791d035901097c1a0f5d701236996 [file] [log] [blame]
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001// 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_IA32_INSTRUCTION_CODES_IA32_H_
6#define V8_COMPILER_IA32_INSTRUCTION_CODES_IA32_H_
7
8namespace v8 {
9namespace internal {
10namespace compiler {
11
12// IA32-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(IA32Add) \
16 V(IA32And) \
17 V(IA32Cmp) \
18 V(IA32Test) \
19 V(IA32Or) \
20 V(IA32Xor) \
21 V(IA32Sub) \
22 V(IA32Imul) \
Emily Bernierd0a1eb72015-03-24 16:35:39 -040023 V(IA32ImulHigh) \
24 V(IA32UmulHigh) \
Ben Murdochb8a8cc12014-11-26 15:28:44 +000025 V(IA32Idiv) \
26 V(IA32Udiv) \
27 V(IA32Not) \
28 V(IA32Neg) \
29 V(IA32Shl) \
30 V(IA32Shr) \
31 V(IA32Sar) \
32 V(IA32Ror) \
33 V(SSEFloat64Cmp) \
34 V(SSEFloat64Add) \
35 V(SSEFloat64Sub) \
36 V(SSEFloat64Mul) \
37 V(SSEFloat64Div) \
38 V(SSEFloat64Mod) \
39 V(SSEFloat64Sqrt) \
Emily Bernierd0a1eb72015-03-24 16:35:39 -040040 V(SSEFloat64Floor) \
41 V(SSEFloat64Ceil) \
42 V(SSEFloat64RoundTruncate) \
43 V(SSECvtss2sd) \
44 V(SSECvtsd2ss) \
Ben Murdochb8a8cc12014-11-26 15:28:44 +000045 V(SSEFloat64ToInt32) \
46 V(SSEFloat64ToUint32) \
47 V(SSEInt32ToFloat64) \
48 V(SSEUint32ToFloat64) \
Emily Bernierd0a1eb72015-03-24 16:35:39 -040049 V(AVXFloat64Add) \
50 V(AVXFloat64Sub) \
51 V(AVXFloat64Mul) \
52 V(AVXFloat64Div) \
Ben Murdochb8a8cc12014-11-26 15:28:44 +000053 V(IA32Movsxbl) \
54 V(IA32Movzxbl) \
55 V(IA32Movb) \
56 V(IA32Movsxwl) \
57 V(IA32Movzxwl) \
58 V(IA32Movw) \
59 V(IA32Movl) \
60 V(IA32Movss) \
61 V(IA32Movsd) \
Emily Bernierd0a1eb72015-03-24 16:35:39 -040062 V(IA32Lea) \
Ben Murdochb8a8cc12014-11-26 15:28:44 +000063 V(IA32Push) \
64 V(IA32StoreWriteBarrier)
65
66
67// Addressing modes represent the "shape" of inputs to an instruction.
68// Many instructions support multiple addressing modes. Addressing modes
69// are encoded into the InstructionCode of the instruction and tell the
70// code generator after register allocation which assembler method to call.
71//
72// We use the following local notation for addressing modes:
73//
Emily Bernierd0a1eb72015-03-24 16:35:39 -040074// M = memory operand
75// R = base register
76// N = index register * N for N in {1, 2, 4, 8}
77// I = immediate displacement (int32_t)
78
Ben Murdochb8a8cc12014-11-26 15:28:44 +000079#define TARGET_ADDRESSING_MODE_LIST(V) \
Emily Bernierd0a1eb72015-03-24 16:35:39 -040080 V(MR) /* [%r1 ] */ \
81 V(MRI) /* [%r1 + K] */ \
82 V(MR1) /* [%r1 + %r2*1 ] */ \
83 V(MR2) /* [%r1 + %r2*2 ] */ \
84 V(MR4) /* [%r1 + %r2*4 ] */ \
85 V(MR8) /* [%r1 + %r2*8 ] */ \
86 V(MR1I) /* [%r1 + %r2*1 + K] */ \
87 V(MR2I) /* [%r1 + %r2*2 + K] */ \
88 V(MR4I) /* [%r1 + %r2*3 + K] */ \
89 V(MR8I) /* [%r1 + %r2*4 + K] */ \
90 V(M1) /* [ %r2*1 ] */ \
91 V(M2) /* [ %r2*2 ] */ \
92 V(M4) /* [ %r2*4 ] */ \
93 V(M8) /* [ %r2*8 ] */ \
94 V(M1I) /* [ %r2*1 + K] */ \
95 V(M2I) /* [ %r2*2 + K] */ \
96 V(M4I) /* [ %r2*4 + K] */ \
97 V(M8I) /* [ %r2*8 + K] */ \
98 V(MI) /* [ K] */
Ben Murdochb8a8cc12014-11-26 15:28:44 +000099
100} // namespace compiler
101} // namespace internal
102} // namespace v8
103
104#endif // V8_COMPILER_IA32_INSTRUCTION_CODES_IA32_H_