OLD | NEW |
---|---|
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
11 // with the distribution. | 11 // with the distribution. |
12 // * Neither the name of Google Inc. nor the names of its | 12 // * Neither the name of Google Inc. nor the names of its |
13 // contributors may be used to endorse or promote products derived | 13 // contributors may be used to endorse or promote products derived |
14 // from this software without specific prior written permission. | 14 // from this software without specific prior written permission. |
15 // | 15 // |
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #ifndef V8_X64_ASSEMBLER_X64_H_ | |
29 #define V8_X64_ASSEMBLER_X64_H_ | |
30 | |
31 // TODO(x64): This is a temporary stub, we will need to implement this code. | |
32 | |
33 namespace v8 { namespace internal { | |
34 | |
35 struct Register { | |
36 bool is_valid() const { return 0 <= code_ && code_ < 8; } | |
37 bool is(Register reg) const { return code_ == reg.code_; } | |
38 // eax, ebx, ecx and edx are byte registers, the rest are not. | |
39 bool is_byte_register() const { return code_ <= 3; } | |
40 int code() const { | |
41 ASSERT(is_valid()); | |
42 return code_; | |
43 } | |
44 int bit() const { | |
45 ASSERT(is_valid()); | |
46 return 1 << code_; | |
47 } | |
48 | |
49 // (unfortunately we can't make this private in a struct) | |
Kevin Millikin (Chromium)
2009/05/05 15:48:00
I've never liked this comment.
| |
50 int code_; | |
51 }; | |
52 | |
53 const int kNumRegisters = 8; | |
54 extern Register no_reg; | |
55 | |
56 enum Condition { | |
57 // any value < 0 is considered no_condition | |
58 no_condition = -1, | |
59 | |
60 overflow = 0, | |
61 no_overflow = 1, | |
62 below = 2, | |
63 above_equal = 3, | |
64 equal = 4, | |
65 not_equal = 5, | |
66 below_equal = 6, | |
67 above = 7, | |
68 negative = 8, | |
69 positive = 9, | |
70 parity_even = 10, | |
71 parity_odd = 11, | |
72 less = 12, | |
73 greater_equal = 13, | |
74 less_equal = 14, | |
75 greater = 15, | |
76 | |
77 // aliases | |
78 carry = below, | |
79 not_carry = above_equal, | |
80 zero = equal, | |
81 not_zero = not_equal, | |
82 sign = negative, | |
83 not_sign = positive | |
84 }; | |
85 | |
86 enum Hint { | |
87 no_hint = 0, | |
88 not_taken = 0x2e, | |
89 taken = 0x3e | |
90 }; | |
91 | |
92 } } // namespace v8::internal | |
93 | |
94 #endif // V8_X64_ASSEMBLER_X64_H_ | |
OLD | NEW |