Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: src/compiler/instruction-codes.h

Issue 426233002: Land the Fan (disabled) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback, rebase and "git cl format" Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/compiler/instruction.cc ('k') | src/compiler/instruction-selector.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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_INSTRUCTION_CODES_H_
6 #define V8_COMPILER_INSTRUCTION_CODES_H_
7
8 #if V8_TARGET_ARCH_ARM
9 #include "src/compiler/arm/instruction-codes-arm.h"
10 #elif V8_TARGET_ARCH_ARM64
11 #include "src/compiler/arm64/instruction-codes-arm64.h"
12 #elif V8_TARGET_ARCH_IA32
13 #include "src/compiler/ia32/instruction-codes-ia32.h"
14 #elif V8_TARGET_ARCH_X64
15 #include "src/compiler/x64/instruction-codes-x64.h"
16 #else
17 #error "Unsupported target architecture."
18 #endif
19 #include "src/utils.h"
20
21 namespace v8 {
22 namespace internal {
23
24 class OStream;
25
26 namespace compiler {
27
28 // Target-specific opcodes that specify which assembly sequence to emit.
29 // Most opcodes specify a single instruction.
30 #define ARCH_OPCODE_LIST(V) \
31 V(ArchDeoptimize) \
32 V(ArchJmp) \
33 V(ArchNop) \
34 V(ArchRet) \
35 TARGET_ARCH_OPCODE_LIST(V)
36
37 enum ArchOpcode {
38 #define DECLARE_ARCH_OPCODE(Name) k##Name,
39 ARCH_OPCODE_LIST(DECLARE_ARCH_OPCODE)
40 #undef DECLARE_ARCH_OPCODE
41 #define COUNT_ARCH_OPCODE(Name) +1
42 kLastArchOpcode = -1 ARCH_OPCODE_LIST(COUNT_ARCH_OPCODE)
43 #undef COUNT_ARCH_OPCODE
44 };
45
46 OStream& operator<<(OStream& os, const ArchOpcode& ao);
47
48 // Addressing modes represent the "shape" of inputs to an instruction.
49 // Many instructions support multiple addressing modes. Addressing modes
50 // are encoded into the InstructionCode of the instruction and tell the
51 // code generator after register allocation which assembler method to call.
52 #define ADDRESSING_MODE_LIST(V) \
53 V(None) \
54 TARGET_ADDRESSING_MODE_LIST(V)
55
56 enum AddressingMode {
57 #define DECLARE_ADDRESSING_MODE(Name) kMode_##Name,
58 ADDRESSING_MODE_LIST(DECLARE_ADDRESSING_MODE)
59 #undef DECLARE_ADDRESSING_MODE
60 #define COUNT_ADDRESSING_MODE(Name) +1
61 kLastAddressingMode = -1 ADDRESSING_MODE_LIST(COUNT_ADDRESSING_MODE)
62 #undef COUNT_ADDRESSING_MODE
63 };
64
65 OStream& operator<<(OStream& os, const AddressingMode& am);
66
67 // The mode of the flags continuation (see below).
68 enum FlagsMode { kFlags_none = 0, kFlags_branch = 1, kFlags_set = 2 };
69
70 OStream& operator<<(OStream& os, const FlagsMode& fm);
71
72 // The condition of flags continuation (see below).
73 enum FlagsCondition {
74 kEqual,
75 kNotEqual,
76 kSignedLessThan,
77 kSignedGreaterThanOrEqual,
78 kSignedLessThanOrEqual,
79 kSignedGreaterThan,
80 kUnsignedLessThan,
81 kUnsignedGreaterThanOrEqual,
82 kUnsignedLessThanOrEqual,
83 kUnsignedGreaterThan,
84 kUnorderedEqual,
85 kUnorderedNotEqual,
86 kUnorderedLessThan,
87 kUnorderedGreaterThanOrEqual,
88 kUnorderedLessThanOrEqual,
89 kUnorderedGreaterThan
90 };
91
92 OStream& operator<<(OStream& os, const FlagsCondition& fc);
93
94 // The InstructionCode is an opaque, target-specific integer that encodes
95 // what code to emit for an instruction in the code generator. It is not
96 // interesting to the register allocator, as the inputs and flags on the
97 // instructions specify everything of interest.
98 typedef int32_t InstructionCode;
99
100 // Helpers for encoding / decoding InstructionCode into the fields needed
101 // for code generation. We encode the instruction, addressing mode, and flags
102 // continuation into a single InstructionCode which is stored as part of
103 // the instruction.
104 typedef BitField<ArchOpcode, 0, 7> ArchOpcodeField;
105 typedef BitField<AddressingMode, 7, 4> AddressingModeField;
106 typedef BitField<FlagsMode, 11, 2> FlagsModeField;
107 typedef BitField<FlagsCondition, 13, 4> FlagsConditionField;
108 typedef BitField<int, 13, 19> MiscField;
109
110 } // namespace compiler
111 } // namespace internal
112 } // namespace v8
113
114 #endif // V8_COMPILER_INSTRUCTION_CODES_H_
OLDNEW
« no previous file with comments | « src/compiler/instruction.cc ('k') | src/compiler/instruction-selector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698