blob: e5d0912910ce72d9021cbb13e6b95da3c942f16d [file] [log] [blame]
Ben Murdoch4a90d5f2016-03-22 12:00:34 +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_X87_INSTRUCTION_CODES_X87_H_
6#define V8_COMPILER_X87_INSTRUCTION_CODES_X87_H_
7
8#include "src/compiler/instruction.h"
9#include "src/compiler/instruction-codes.h"
10namespace v8 {
11namespace internal {
12namespace compiler {
13
14// X87-specific opcodes that specify which assembly sequence to emit.
15// Most opcodes specify a single instruction.
16#define TARGET_ARCH_OPCODE_LIST(V) \
17 V(X87Add) \
18 V(X87And) \
19 V(X87Cmp) \
20 V(X87Test) \
21 V(X87Or) \
22 V(X87Xor) \
23 V(X87Sub) \
24 V(X87Imul) \
25 V(X87ImulHigh) \
26 V(X87UmulHigh) \
27 V(X87Idiv) \
28 V(X87Udiv) \
29 V(X87Not) \
30 V(X87Neg) \
31 V(X87Shl) \
32 V(X87Shr) \
33 V(X87Sar) \
34 V(X87Ror) \
35 V(X87Lzcnt) \
36 V(X87Popcnt) \
37 V(X87Float32Cmp) \
38 V(X87Float32Add) \
39 V(X87Float32Sub) \
40 V(X87Float32Mul) \
41 V(X87Float32Div) \
42 V(X87Float32Max) \
43 V(X87Float32Min) \
44 V(X87Float32Abs) \
45 V(X87Float32Sqrt) \
46 V(X87Float32Round) \
47 V(X87LoadFloat64Constant) \
48 V(X87Float64Add) \
49 V(X87Float64Sub) \
50 V(X87Float64Mul) \
51 V(X87Float64Div) \
52 V(X87Float64Mod) \
53 V(X87Float64Max) \
54 V(X87Float64Min) \
55 V(X87Float64Abs) \
Ben Murdoch097c5b22016-05-18 11:27:45 +010056 V(X87Int32ToFloat32) \
57 V(X87Uint32ToFloat32) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000058 V(X87Int32ToFloat64) \
59 V(X87Float32ToFloat64) \
60 V(X87Uint32ToFloat64) \
61 V(X87Float64ToInt32) \
Ben Murdoch097c5b22016-05-18 11:27:45 +010062 V(X87Float32ToInt32) \
63 V(X87Float32ToUint32) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000064 V(X87Float64ToFloat32) \
65 V(X87Float64ToUint32) \
66 V(X87Float64ExtractHighWord32) \
67 V(X87Float64ExtractLowWord32) \
68 V(X87Float64InsertHighWord32) \
69 V(X87Float64InsertLowWord32) \
70 V(X87Float64Sqrt) \
71 V(X87Float64Round) \
72 V(X87Float64Cmp) \
73 V(X87Movsxbl) \
74 V(X87Movzxbl) \
75 V(X87Movb) \
76 V(X87Movsxwl) \
77 V(X87Movzxwl) \
78 V(X87Movw) \
79 V(X87Movl) \
80 V(X87Movss) \
81 V(X87Movsd) \
82 V(X87Lea) \
83 V(X87BitcastFI) \
84 V(X87BitcastIF) \
85 V(X87Push) \
86 V(X87PushFloat64) \
87 V(X87PushFloat32) \
88 V(X87Poke) \
89 V(X87StackCheck)
90
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000091// Addressing modes represent the "shape" of inputs to an instruction.
92// Many instructions support multiple addressing modes. Addressing modes
93// are encoded into the InstructionCode of the instruction and tell the
94// code generator after register allocation which assembler method to call.
95//
96// We use the following local notation for addressing modes:
97//
98// M = memory operand
99// R = base register
100// N = index register * N for N in {1, 2, 4, 8}
101// I = immediate displacement (int32_t)
102
103#define TARGET_ADDRESSING_MODE_LIST(V) \
104 V(MR) /* [%r1 ] */ \
105 V(MRI) /* [%r1 + K] */ \
106 V(MR1) /* [%r1 + %r2*1 ] */ \
107 V(MR2) /* [%r1 + %r2*2 ] */ \
108 V(MR4) /* [%r1 + %r2*4 ] */ \
109 V(MR8) /* [%r1 + %r2*8 ] */ \
110 V(MR1I) /* [%r1 + %r2*1 + K] */ \
111 V(MR2I) /* [%r1 + %r2*2 + K] */ \
112 V(MR4I) /* [%r1 + %r2*3 + K] */ \
113 V(MR8I) /* [%r1 + %r2*4 + K] */ \
114 V(M1) /* [ %r2*1 ] */ \
115 V(M2) /* [ %r2*2 ] */ \
116 V(M4) /* [ %r2*4 ] */ \
117 V(M8) /* [ %r2*8 ] */ \
118 V(M1I) /* [ %r2*1 + K] */ \
119 V(M2I) /* [ %r2*2 + K] */ \
120 V(M4I) /* [ %r2*4 + K] */ \
121 V(M8I) /* [ %r2*8 + K] */ \
122 V(MI) /* [ K] */
123
124} // namespace compiler
125} // namespace internal
126} // namespace v8
127
128#endif // V8_COMPILER_X87_INSTRUCTION_CODES_X87_H_