Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: src/x64/assembler-x64-inl.h

Issue 6366010: X64 Crankshaft: Added a bunch of operations. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge/build-x64
Patch Set: Address review comments. Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/x64/assembler-x64.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 rex_ |= rm_reg.high_bit(); 418 rex_ |= rm_reg.high_bit();
419 } 419 }
420 420
421 421
422 void Operand::set_sib(ScaleFactor scale, Register index, Register base) { 422 void Operand::set_sib(ScaleFactor scale, Register index, Register base) {
423 ASSERT(len_ == 1); 423 ASSERT(len_ == 1);
424 ASSERT(is_uint2(scale)); 424 ASSERT(is_uint2(scale));
425 // Use SIB with no index register only for base rsp or r12. Otherwise we 425 // Use SIB with no index register only for base rsp or r12. Otherwise we
426 // would skip the SIB byte entirely. 426 // would skip the SIB byte entirely.
427 ASSERT(!index.is(rsp) || base.is(rsp) || base.is(r12)); 427 ASSERT(!index.is(rsp) || base.is(rsp) || base.is(r12));
428 buf_[1] = scale << 6 | index.low_bits() << 3 | base.low_bits(); 428 buf_[1] = (scale << 6) | (index.low_bits() << 3) | base.low_bits();
429 rex_ |= index.high_bit() << 1 | base.high_bit(); 429 rex_ |= index.high_bit() << 1 | base.high_bit();
430 len_ = 2; 430 len_ = 2;
431 } 431 }
432 432
433 void Operand::set_disp8(int disp) { 433 void Operand::set_disp8(int disp) {
434 ASSERT(is_int8(disp)); 434 ASSERT(is_int8(disp));
435 ASSERT(len_ == 1 || len_ == 2); 435 ASSERT(len_ == 1 || len_ == 2);
436 int8_t* p = reinterpret_cast<int8_t*>(&buf_[len_]); 436 int8_t* p = reinterpret_cast<int8_t*>(&buf_[len_]);
437 *p = disp; 437 *p = disp;
438 len_ += sizeof(int8_t); 438 len_ += sizeof(int8_t);
439 } 439 }
440 440
441 void Operand::set_disp32(int disp) { 441 void Operand::set_disp32(int disp) {
442 ASSERT(len_ == 1 || len_ == 2); 442 ASSERT(len_ == 1 || len_ == 2);
443 int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]); 443 int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]);
444 *p = disp; 444 *p = disp;
445 len_ += sizeof(int32_t); 445 len_ += sizeof(int32_t);
446 } 446 }
447 447
448 448
449 } } // namespace v8::internal 449 } } // namespace v8::internal
450 450
451 #endif // V8_X64_ASSEMBLER_X64_INL_H_ 451 #endif // V8_X64_ASSEMBLER_X64_INL_H_
OLDNEW
« no previous file with comments | « src/x64/assembler-x64.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698