OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 const Register r10 = { kRegister_r10_Code }; | 195 const Register r10 = { kRegister_r10_Code }; |
196 const Register r11 = { kRegister_r11_Code }; | 196 const Register r11 = { kRegister_r11_Code }; |
197 const Register r12 = { kRegister_r12_Code }; | 197 const Register r12 = { kRegister_r12_Code }; |
198 const Register r13 = { kRegister_r13_Code }; | 198 const Register r13 = { kRegister_r13_Code }; |
199 const Register r14 = { kRegister_r14_Code }; | 199 const Register r14 = { kRegister_r14_Code }; |
200 const Register r15 = { kRegister_r15_Code }; | 200 const Register r15 = { kRegister_r15_Code }; |
201 const Register no_reg = { kRegister_no_reg_Code }; | 201 const Register no_reg = { kRegister_no_reg_Code }; |
202 | 202 |
203 | 203 |
204 struct XMMRegister { | 204 struct XMMRegister { |
205 static const int kNumRegisters = 16; | 205 static const int kMaxNumRegisters = 16; |
206 static const int kMaxNumAllocatableRegisters = 15; | 206 static const int kMaxNumAllocatableRegisters = 15; |
207 static int NumAllocatableRegisters() { | 207 static int NumAllocatableRegisters() { |
208 return kMaxNumAllocatableRegisters; | 208 return kMaxNumAllocatableRegisters; |
209 } | 209 } |
210 | 210 |
211 static int ToAllocationIndex(XMMRegister reg) { | 211 static int ToAllocationIndex(XMMRegister reg) { |
212 ASSERT(reg.code() != 0); | 212 ASSERT(reg.code() != 0); |
213 return reg.code() - 1; | 213 return reg.code() - 1; |
214 } | 214 } |
215 | 215 |
(...skipping 20 matching lines...) Expand all Loading... |
236 "xmm12", | 236 "xmm12", |
237 "xmm13", | 237 "xmm13", |
238 "xmm14", | 238 "xmm14", |
239 "xmm15" | 239 "xmm15" |
240 }; | 240 }; |
241 return names[index]; | 241 return names[index]; |
242 } | 242 } |
243 | 243 |
244 static XMMRegister from_code(int code) { | 244 static XMMRegister from_code(int code) { |
245 ASSERT(code >= 0); | 245 ASSERT(code >= 0); |
246 ASSERT(code < kNumRegisters); | 246 ASSERT(code < kMaxNumRegisters); |
247 XMMRegister r = { code }; | 247 XMMRegister r = { code }; |
248 return r; | 248 return r; |
249 } | 249 } |
250 bool is_valid() const { return 0 <= code_ && code_ < kNumRegisters; } | 250 bool is_valid() const { return 0 <= code_ && code_ < kMaxNumRegisters; } |
251 bool is(XMMRegister reg) const { return code_ == reg.code_; } | 251 bool is(XMMRegister reg) const { return code_ == reg.code_; } |
252 int code() const { | 252 int code() const { |
253 ASSERT(is_valid()); | 253 ASSERT(is_valid()); |
254 return code_; | 254 return code_; |
255 } | 255 } |
256 | 256 |
257 // Return the high bit of the register code as a 0 or 1. Used often | 257 // Return the high bit of the register code as a 0 or 1. Used often |
258 // when constructing the REX prefix byte. | 258 // when constructing the REX prefix byte. |
259 int high_bit() const { | 259 int high_bit() const { |
260 return code_ >> 3; | 260 return code_ >> 3; |
(...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1669 private: | 1669 private: |
1670 Assembler* assembler_; | 1670 Assembler* assembler_; |
1671 #ifdef DEBUG | 1671 #ifdef DEBUG |
1672 int space_before_; | 1672 int space_before_; |
1673 #endif | 1673 #endif |
1674 }; | 1674 }; |
1675 | 1675 |
1676 } } // namespace v8::internal | 1676 } } // namespace v8::internal |
1677 | 1677 |
1678 #endif // V8_X64_ASSEMBLER_X64_H_ | 1678 #endif // V8_X64_ASSEMBLER_X64_H_ |
OLD | NEW |