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 | 5 // modification, are permitted provided that the following conditions |
6 // are met: | 6 // are 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 | 260 |
261 static DwVfpRegister from_code(int code) { | 261 static DwVfpRegister from_code(int code) { |
262 DwVfpRegister r = { code }; | 262 DwVfpRegister r = { code }; |
263 return r; | 263 return r; |
264 } | 264 } |
265 | 265 |
266 bool is_valid() const { | 266 bool is_valid() const { |
267 return 0 <= code_ && code_ < kMaxNumRegisters; | 267 return 0 <= code_ && code_ < kMaxNumRegisters; |
268 } | 268 } |
269 bool is(DwVfpRegister reg) const { return code_ == reg.code_; } | 269 bool is(DwVfpRegister reg) const { return code_ == reg.code_; } |
270 SwVfpRegister low() const { | |
271 ASSERT(code_ < 16); | |
272 SwVfpRegister reg; | |
273 reg.code_ = code_ * 2; | |
274 | |
275 ASSERT(reg.is_valid()); | |
276 return reg; | |
277 } | |
278 SwVfpRegister high() const { | |
279 ASSERT(code_ < 16); | |
280 SwVfpRegister reg; | |
281 reg.code_ = (code_ * 2) + 1; | |
282 | |
283 ASSERT(reg.is_valid()); | |
284 return reg; | |
285 } | |
286 int code() const { | 270 int code() const { |
287 ASSERT(is_valid()); | 271 ASSERT(is_valid()); |
288 return code_; | 272 return code_; |
289 } | 273 } |
290 int bit() const { | 274 int bit() const { |
291 ASSERT(is_valid()); | 275 ASSERT(is_valid()); |
292 return 1 << code_; | 276 return 1 << code_; |
293 } | 277 } |
294 void split_code(int* vm, int* m) const { | 278 void split_code(int* vm, int* m) const { |
295 ASSERT(is_valid()); | 279 ASSERT(is_valid()); |
296 *m = (code_ & 0x10) >> 4; | 280 *m = (code_ & 0x10) >> 4; |
297 *vm = code_ & 0x0F; | 281 *vm = code_ & 0x0F; |
298 } | 282 } |
299 | 283 |
300 int code_; | 284 int code_; |
301 }; | 285 }; |
302 | 286 |
303 | 287 |
304 typedef DwVfpRegister DoubleRegister; | 288 typedef DwVfpRegister DoubleRegister; |
305 | 289 |
306 | 290 |
| 291 // Double word VFP register d0-15. |
| 292 struct LowDwVfpRegister { |
| 293 public: |
| 294 static const int kMaxNumLowRegisters = 16; |
| 295 operator DwVfpRegister() const { |
| 296 DwVfpRegister r = { code_ }; |
| 297 return r; |
| 298 } |
| 299 static LowDwVfpRegister from_code(int code) { |
| 300 LowDwVfpRegister r = { code }; |
| 301 return r; |
| 302 } |
| 303 |
| 304 bool is_valid() const { |
| 305 return 0 <= code_ && code_ < kMaxNumLowRegisters; |
| 306 } |
| 307 bool is(DwVfpRegister reg) const { return code_ == reg.code_; } |
| 308 bool is(LowDwVfpRegister reg) const { return code_ == reg.code_; } |
| 309 int code() const { |
| 310 ASSERT(is_valid()); |
| 311 return code_; |
| 312 } |
| 313 SwVfpRegister low() const { |
| 314 SwVfpRegister reg; |
| 315 reg.code_ = code_ * 2; |
| 316 |
| 317 ASSERT(reg.is_valid()); |
| 318 return reg; |
| 319 } |
| 320 SwVfpRegister high() const { |
| 321 SwVfpRegister reg; |
| 322 reg.code_ = (code_ * 2) + 1; |
| 323 |
| 324 ASSERT(reg.is_valid()); |
| 325 return reg; |
| 326 } |
| 327 |
| 328 int code_; |
| 329 }; |
| 330 |
| 331 |
307 // Quad word NEON register. | 332 // Quad word NEON register. |
308 struct QwNeonRegister { | 333 struct QwNeonRegister { |
309 static const int kMaxNumRegisters = 16; | 334 static const int kMaxNumRegisters = 16; |
310 | 335 |
311 static QwNeonRegister from_code(int code) { | 336 static QwNeonRegister from_code(int code) { |
312 QwNeonRegister r = { code }; | 337 QwNeonRegister r = { code }; |
313 return r; | 338 return r; |
314 } | 339 } |
315 | 340 |
316 bool is_valid() const { | 341 bool is_valid() const { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 const SwVfpRegister s24 = { 24 }; | 388 const SwVfpRegister s24 = { 24 }; |
364 const SwVfpRegister s25 = { 25 }; | 389 const SwVfpRegister s25 = { 25 }; |
365 const SwVfpRegister s26 = { 26 }; | 390 const SwVfpRegister s26 = { 26 }; |
366 const SwVfpRegister s27 = { 27 }; | 391 const SwVfpRegister s27 = { 27 }; |
367 const SwVfpRegister s28 = { 28 }; | 392 const SwVfpRegister s28 = { 28 }; |
368 const SwVfpRegister s29 = { 29 }; | 393 const SwVfpRegister s29 = { 29 }; |
369 const SwVfpRegister s30 = { 30 }; | 394 const SwVfpRegister s30 = { 30 }; |
370 const SwVfpRegister s31 = { 31 }; | 395 const SwVfpRegister s31 = { 31 }; |
371 | 396 |
372 const DwVfpRegister no_dreg = { -1 }; | 397 const DwVfpRegister no_dreg = { -1 }; |
373 const DwVfpRegister d0 = { 0 }; | 398 const LowDwVfpRegister d0 = { 0 }; |
374 const DwVfpRegister d1 = { 1 }; | 399 const LowDwVfpRegister d1 = { 1 }; |
375 const DwVfpRegister d2 = { 2 }; | 400 const LowDwVfpRegister d2 = { 2 }; |
376 const DwVfpRegister d3 = { 3 }; | 401 const LowDwVfpRegister d3 = { 3 }; |
377 const DwVfpRegister d4 = { 4 }; | 402 const LowDwVfpRegister d4 = { 4 }; |
378 const DwVfpRegister d5 = { 5 }; | 403 const LowDwVfpRegister d5 = { 5 }; |
379 const DwVfpRegister d6 = { 6 }; | 404 const LowDwVfpRegister d6 = { 6 }; |
380 const DwVfpRegister d7 = { 7 }; | 405 const LowDwVfpRegister d7 = { 7 }; |
381 const DwVfpRegister d8 = { 8 }; | 406 const LowDwVfpRegister d8 = { 8 }; |
382 const DwVfpRegister d9 = { 9 }; | 407 const LowDwVfpRegister d9 = { 9 }; |
383 const DwVfpRegister d10 = { 10 }; | 408 const LowDwVfpRegister d10 = { 10 }; |
384 const DwVfpRegister d11 = { 11 }; | 409 const LowDwVfpRegister d11 = { 11 }; |
385 const DwVfpRegister d12 = { 12 }; | 410 const LowDwVfpRegister d12 = { 12 }; |
386 const DwVfpRegister d13 = { 13 }; | 411 const LowDwVfpRegister d13 = { 13 }; |
387 const DwVfpRegister d14 = { 14 }; | 412 const LowDwVfpRegister d14 = { 14 }; |
388 const DwVfpRegister d15 = { 15 }; | 413 const LowDwVfpRegister d15 = { 15 }; |
389 const DwVfpRegister d16 = { 16 }; | 414 const DwVfpRegister d16 = { 16 }; |
390 const DwVfpRegister d17 = { 17 }; | 415 const DwVfpRegister d17 = { 17 }; |
391 const DwVfpRegister d18 = { 18 }; | 416 const DwVfpRegister d18 = { 18 }; |
392 const DwVfpRegister d19 = { 19 }; | 417 const DwVfpRegister d19 = { 19 }; |
393 const DwVfpRegister d20 = { 20 }; | 418 const DwVfpRegister d20 = { 20 }; |
394 const DwVfpRegister d21 = { 21 }; | 419 const DwVfpRegister d21 = { 21 }; |
395 const DwVfpRegister d22 = { 22 }; | 420 const DwVfpRegister d22 = { 22 }; |
396 const DwVfpRegister d23 = { 23 }; | 421 const DwVfpRegister d23 = { 23 }; |
397 const DwVfpRegister d24 = { 24 }; | 422 const DwVfpRegister d24 = { 24 }; |
398 const DwVfpRegister d25 = { 25 }; | 423 const DwVfpRegister d25 = { 25 }; |
(...skipping 14 matching lines...) Expand all Loading... |
413 const QwNeonRegister q7 = { 7 }; | 438 const QwNeonRegister q7 = { 7 }; |
414 const QwNeonRegister q8 = { 8 }; | 439 const QwNeonRegister q8 = { 8 }; |
415 const QwNeonRegister q9 = { 9 }; | 440 const QwNeonRegister q9 = { 9 }; |
416 const QwNeonRegister q10 = { 10 }; | 441 const QwNeonRegister q10 = { 10 }; |
417 const QwNeonRegister q11 = { 11 }; | 442 const QwNeonRegister q11 = { 11 }; |
418 const QwNeonRegister q12 = { 12 }; | 443 const QwNeonRegister q12 = { 12 }; |
419 const QwNeonRegister q13 = { 13 }; | 444 const QwNeonRegister q13 = { 13 }; |
420 const QwNeonRegister q14 = { 14 }; | 445 const QwNeonRegister q14 = { 14 }; |
421 const QwNeonRegister q15 = { 15 }; | 446 const QwNeonRegister q15 = { 15 }; |
422 | 447 |
| 448 |
423 // Aliases for double registers. Defined using #define instead of | 449 // Aliases for double registers. Defined using #define instead of |
424 // "static const DwVfpRegister&" because Clang complains otherwise when a | 450 // "static const DwVfpRegister&" because Clang complains otherwise when a |
425 // compilation unit that includes this header doesn't use the variables. | 451 // compilation unit that includes this header doesn't use the variables. |
426 #define kFirstCalleeSavedDoubleReg d8 | 452 #define kFirstCalleeSavedDoubleReg d8 |
427 #define kLastCalleeSavedDoubleReg d15 | 453 #define kLastCalleeSavedDoubleReg d15 |
428 #define kDoubleRegZero d14 | 454 #define kDoubleRegZero d14 |
429 #define kScratchDoubleReg d15 | 455 #define kScratchDoubleReg d15 |
430 | 456 |
431 | 457 |
432 // Coprocessor register | 458 // Coprocessor register |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1102 void vmov(const SwVfpRegister dst, | 1128 void vmov(const SwVfpRegister dst, |
1103 const SwVfpRegister src, | 1129 const SwVfpRegister src, |
1104 const Condition cond = al); | 1130 const Condition cond = al); |
1105 void vmov(const DwVfpRegister dst, | 1131 void vmov(const DwVfpRegister dst, |
1106 const DwVfpRegister src, | 1132 const DwVfpRegister src, |
1107 const Condition cond = al); | 1133 const Condition cond = al); |
1108 void vmov(const DwVfpRegister dst, | 1134 void vmov(const DwVfpRegister dst, |
1109 const VmovIndex index, | 1135 const VmovIndex index, |
1110 const Register src, | 1136 const Register src, |
1111 const Condition cond = al); | 1137 const Condition cond = al); |
| 1138 void vmov(const Register dst, |
| 1139 const VmovIndex index, |
| 1140 const DwVfpRegister src, |
| 1141 const Condition cond = al); |
1112 void vmov(const DwVfpRegister dst, | 1142 void vmov(const DwVfpRegister dst, |
1113 const Register src1, | 1143 const Register src1, |
1114 const Register src2, | 1144 const Register src2, |
1115 const Condition cond = al); | 1145 const Condition cond = al); |
1116 void vmov(const Register dst1, | 1146 void vmov(const Register dst1, |
1117 const Register dst2, | 1147 const Register dst2, |
1118 const DwVfpRegister src, | 1148 const DwVfpRegister src, |
1119 const Condition cond = al); | 1149 const Condition cond = al); |
1120 void vmov(const SwVfpRegister dst, | 1150 void vmov(const SwVfpRegister dst, |
1121 const Register src, | 1151 const Register src, |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1547 public: | 1577 public: |
1548 explicit EnsureSpace(Assembler* assembler) { | 1578 explicit EnsureSpace(Assembler* assembler) { |
1549 assembler->CheckBuffer(); | 1579 assembler->CheckBuffer(); |
1550 } | 1580 } |
1551 }; | 1581 }; |
1552 | 1582 |
1553 | 1583 |
1554 } } // namespace v8::internal | 1584 } } // namespace v8::internal |
1555 | 1585 |
1556 #endif // V8_ARM_ASSEMBLER_ARM_H_ | 1586 #endif // V8_ARM_ASSEMBLER_ARM_H_ |
OLD | NEW |