Flutter Engine
The Flutter Engine
third_party
dart-lang
sdk
runtime
vm
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
10
namespace
dart
{
11
12
enum
Condition
{
13
OVERFLOW
= 0,
14
NO_OVERFLOW
= 1,
15
BELOW
= 2,
16
ABOVE_EQUAL
= 3,
17
EQUAL
= 4,
18
NOT_EQUAL
= 5,
19
BELOW_EQUAL
= 6,
20
ABOVE
= 7,
21
SIGN
= 8,
22
NOT_SIGN
= 9,
23
PARITY_EVEN
= 10,
24
PARITY_ODD
= 11,
25
LESS
= 12,
26
GREATER_EQUAL
= 13,
27
LESS_EQUAL
= 14,
28
GREATER
= 15,
29
30
ZERO
=
EQUAL
,
31
NOT_ZERO
=
NOT_EQUAL
,
32
NEGATIVE
=
SIGN
,
33
POSITIVE
=
NOT_SIGN
,
34
CARRY
=
BELOW
,
35
NOT_CARRY
=
ABOVE_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,
44
UNSIGNED_LESS
=
BELOW
,
45
UNSIGNED_LESS_EQUAL
=
BELOW_EQUAL
,
46
UNSIGNED_GREATER
=
ABOVE
,
47
UNSIGNED_GREATER_EQUAL
=
ABOVE_EQUAL
,
48
49
kInvalidCondition
= 16
50
};
51
52
static
inline
Condition
InvertCondition
(
Condition
c) {
53
COMPILE_ASSERT
((
OVERFLOW
^
NO_OVERFLOW
) == 1);
54
COMPILE_ASSERT
((
BELOW
^
ABOVE_EQUAL
) == 1);
55
COMPILE_ASSERT
((
EQUAL
^
NOT_EQUAL
) == 1);
56
COMPILE_ASSERT
((
BELOW_EQUAL
^
ABOVE
) == 1);
57
COMPILE_ASSERT
((
SIGN
^
NOT_SIGN
) == 1);
58
COMPILE_ASSERT
((
PARITY_EVEN
^
PARITY_ODD
) == 1);
59
COMPILE_ASSERT
((
LESS
^
GREATER_EQUAL
) == 1);
60
COMPILE_ASSERT
((
LESS_EQUAL
^
GREATER
) == 1);
61
ASSERT
(c !=
kInvalidCondition
);
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_
assert.h
ASSERT
#define ASSERT(E)
Definition:
entrypoints_verification_test.cc:25
dart
Definition:
dart_vm.cc:33
dart::InvertCondition
static Condition InvertCondition(Condition c)
Definition:
constants_arm.h:804
dart::Condition
Condition
Definition:
constants_arm.h:765
dart::CARRY
@ CARRY
Definition:
constants_x86.h:34
dart::OVERFLOW
@ OVERFLOW
Definition:
constants_arm.h:798
dart::GREATER_EQUAL
@ GREATER_EQUAL
Definition:
constants_arm.h:792
dart::UNSIGNED_GREATER
@ UNSIGNED_GREATER
Definition:
constants_arm.h:796
dart::kInvalidCondition
@ kInvalidCondition
Definition:
constants_arm.h:801
dart::UNSIGNED_GREATER_EQUAL
@ UNSIGNED_GREATER_EQUAL
Definition:
constants_arm.h:797
dart::NOT_CARRY
@ NOT_CARRY
Definition:
constants_x86.h:35
dart::NOT_SIGN
@ NOT_SIGN
Definition:
constants_x86.h:22
dart::NOT_ZERO
@ NOT_ZERO
Definition:
constants_arm.h:789
dart::GREATER
@ GREATER
Definition:
constants_arm.h:793
dart::SIGN
@ SIGN
Definition:
constants_x86.h:21
dart::NO_OVERFLOW
@ NO_OVERFLOW
Definition:
constants_arm.h:799
dart::BELOW
@ BELOW
Definition:
constants_x86.h:15
dart::NEGATIVE
@ NEGATIVE
Definition:
constants_x86.h:32
dart::LESS_EQUAL
@ LESS_EQUAL
Definition:
constants_arm.h:791
dart::BELOW_EQUAL
@ BELOW_EQUAL
Definition:
constants_x86.h:19
dart::EQUAL
@ EQUAL
Definition:
constants_arm.h:786
dart::PARITY_ODD
@ PARITY_ODD
Definition:
constants_x86.h:24
dart::UNSIGNED_LESS
@ UNSIGNED_LESS
Definition:
constants_arm.h:794
dart::NOT_EQUAL
@ NOT_EQUAL
Definition:
constants_arm.h:788
dart::ABOVE_EQUAL
@ ABOVE_EQUAL
Definition:
constants_x86.h:16
dart::ZERO
@ ZERO
Definition:
constants_arm.h:787
dart::LESS
@ LESS
Definition:
constants_arm.h:790
dart::POSITIVE
@ POSITIVE
Definition:
constants_x86.h:33
dart::PARITY_EVEN
@ PARITY_EVEN
Definition:
constants_x86.h:23
dart::UNSIGNED_LESS_EQUAL
@ UNSIGNED_LESS_EQUAL
Definition:
constants_arm.h:795
dart::ABOVE
@ ABOVE
Definition:
constants_x86.h:20
dart::COMPILE_ASSERT
COMPILE_ASSERT(kUnreachableReference==WeakTable::kNoValue)
Generated on Sun Jun 23 2024 21:55:39 for Flutter Engine by
1.9.4