Flutter Engine
The Flutter Engine
constants_x86.h
Go to the documentation of this file.
1// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5#ifndef RUNTIME_VM_CONSTANTS_X86_H_
6#define RUNTIME_VM_CONSTANTS_X86_H_
7
8#include "platform/assert.h"
9
10namespace dart {
11
13 OVERFLOW = 0,
14 NO_OVERFLOW = 1,
15 BELOW = 2,
17 EQUAL = 4,
18 NOT_EQUAL = 5,
20 ABOVE = 7,
21 SIGN = 8,
25 LESS = 12,
26 GREATER_EQUAL = 13,
27 LESS_EQUAL = 14,
28 GREATER = 15,
29
30 ZERO = EQUAL,
36
37 // Platform-independent variants declared for all platforms
38 // EQUAL,
39 // NOT_EQUAL,
40 // LESS,
41 // LESS_EQUAL,
42 // GREATER_EQUAL,
43 // GREATER,
48
50};
51
62 return static_cast<Condition>(c ^ 1);
63}
64
65#define X86_ZERO_OPERAND_1_BYTE_INSTRUCTIONS(F) \
66 F(ret, 0xC3) \
67 F(leave, 0xC9) \
68 F(hlt, 0xF4) \
69 F(cld, 0xFC) \
70 F(std, 0xFD) \
71 F(int3, 0xCC) \
72 F(pushad, 0x60) \
73 F(popad, 0x61) \
74 F(pushfd, 0x9C) \
75 F(popfd, 0x9D) \
76 F(sahf, 0x9E) \
77 F(cdq, 0x99) \
78 F(fwait, 0x9B) \
79 F(movsb, 0xA4) \
80 F(movs, 0xA5) /* Size suffix added in code */ \
81 F(cmpsb, 0xA6) \
82 F(cmps, 0xA7) /* Size suffix added in code */
83
84// clang-format off
85#define X86_ALU_CODES(F) \
86 F(and, 4) \
87 F(or, 1) \
88 F(xor, 6) \
89 F(add, 0) \
90 F(adc, 2) \
91 F(sub, 5) \
92 F(sbb, 3) \
93 F(cmp, 7)
94
95#define XMM_ALU_CODES(F) \
96 F(bad0, 0) \
97 F(sqrt, 1) \
98 F(rsqrt, 2) \
99 F(rcp, 3) \
100 F(and, 4) \
101 F(bad1, 5) \
102 F(or, 6) \
103 F(xor, 7) \
104 F(add, 8) \
105 F(mul, 9) \
106 F(bad2, 0xA) \
107 F(bad3, 0xB) \
108 F(sub, 0xC) \
109 F(min, 0xD) \
110 F(div, 0xE) \
111 F(max, 0xF)
112// clang-format on
113
114// Table 3-1, first part
115#define XMM_CONDITIONAL_CODES(F) \
116 F(eq, 0) \
117 F(lt, 1) \
118 F(le, 2) \
119 F(unord, 3) \
120 F(neq, 4) \
121 F(nlt, 5) \
122 F(nle, 6) \
123 F(ord, 7)
124
125#define X86_CONDITIONAL_SUFFIXES(F) \
126 F(o, OVERFLOW) \
127 F(no, NO_OVERFLOW) \
128 F(c, CARRY) \
129 F(nc, NOT_CARRY) \
130 F(z, ZERO) \
131 F(nz, NOT_ZERO) \
132 F(na, BELOW_EQUAL) \
133 F(a, ABOVE) \
134 F(s, SIGN) \
135 F(ns, NOT_SIGN) \
136 F(pe, PARITY_EVEN) \
137 F(po, PARITY_ODD) \
138 F(l, LESS) \
139 F(ge, GREATER_EQUAL) \
140 F(le, LESS_EQUAL) \
141 F(g, GREATER) \
142 /* Some alternative names */ \
143 F(e, EQUAL) \
144 F(ne, NOT_EQUAL)
145
146} // namespace dart
147
148#endif // RUNTIME_VM_CONSTANTS_X86_H_
#define ASSERT(E)
Definition: dart_vm.cc:33
static Condition InvertCondition(Condition c)
@ OVERFLOW
@ GREATER_EQUAL
@ UNSIGNED_GREATER
@ kInvalidCondition
@ UNSIGNED_GREATER_EQUAL
@ NOT_CARRY
Definition: constants_x86.h:35
@ NOT_SIGN
Definition: constants_x86.h:22
@ NOT_ZERO
@ NO_OVERFLOW
@ NEGATIVE
Definition: constants_x86.h:32
@ LESS_EQUAL
@ BELOW_EQUAL
Definition: constants_x86.h:19
@ PARITY_ODD
Definition: constants_x86.h:24
@ UNSIGNED_LESS
@ NOT_EQUAL
@ ABOVE_EQUAL
Definition: constants_x86.h:16
@ POSITIVE
Definition: constants_x86.h:33
@ PARITY_EVEN
Definition: constants_x86.h:23
@ UNSIGNED_LESS_EQUAL
COMPILE_ASSERT(kUnreachableReference==WeakTable::kNoValue)