Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 //===- subzero/src/IceAssemblerX86BaseImpl.h - base x86 assembler -*- C++ -*-=// | 1 //===- subzero/src/IceAssemblerX86BaseImpl.h - base x86 assembler -*- C++ -*-=// |
| 2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 3 // for details. All rights reserved. Use of this source code is governed by a | 3 // for details. All rights reserved. Use of this source code is governed by a |
| 4 // BSD-style license that can be found in the LICENSE file. | 4 // BSD-style license that can be found in the LICENSE file. |
| 5 // | 5 // |
| 6 // Modified by the Subzero authors. | 6 // Modified by the Subzero authors. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // The Subzero Code Generator | 10 // The Subzero Code Generator |
| (...skipping 3386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3397 } else { | 3397 } else { |
| 3398 emitLabelLink(label); | 3398 emitLabelLink(label); |
| 3399 } | 3399 } |
| 3400 } | 3400 } |
| 3401 | 3401 |
| 3402 template <class Machine> | 3402 template <class Machine> |
| 3403 void AssemblerX86Base<Machine>::emitLabelLink(Label *Label) { | 3403 void AssemblerX86Base<Machine>::emitLabelLink(Label *Label) { |
| 3404 assert(!Label->isBound()); | 3404 assert(!Label->isBound()); |
| 3405 intptr_t Position = Buffer.size(); | 3405 intptr_t Position = Buffer.size(); |
| 3406 emitInt32(Label->Position); | 3406 emitInt32(Label->Position); |
| 3407 if (!getPreliminary()) | 3407 Label->linkTo(*this, Position); |
| 3408 Label->linkTo(Position); | |
| 3409 } | 3408 } |
| 3410 | 3409 |
| 3411 template <class Machine> | 3410 template <class Machine> |
| 3412 void AssemblerX86Base<Machine>::emitNearLabelLink(Label *label) { | 3411 void AssemblerX86Base<Machine>::emitNearLabelLink(Label *label) { |
|
Jim Stichnoth
2015/12/08 22:20:00
Change "label" to "Label", and "position" to "Posi
Karl
2015/12/08 22:39:32
Done.
| |
| 3413 assert(!label->isBound()); | 3412 assert(!label->isBound()); |
| 3414 intptr_t position = Buffer.size(); | 3413 intptr_t position = Buffer.size(); |
| 3415 emitUint8(0); | 3414 emitUint8(0); |
| 3416 if (!getPreliminary()) | 3415 label->nearLinkTo(*this, position); |
| 3417 label->nearLinkTo(position); | |
| 3418 } | 3416 } |
| 3419 | 3417 |
| 3420 template <class Machine> | 3418 template <class Machine> |
| 3421 void AssemblerX86Base<Machine>::emitGenericShift( | 3419 void AssemblerX86Base<Machine>::emitGenericShift( |
| 3422 int rm, Type Ty, typename Traits::GPRRegister reg, const Immediate &imm) { | 3420 int rm, Type Ty, typename Traits::GPRRegister reg, const Immediate &imm) { |
| 3423 AssemblerBuffer::EnsureCapacity ensured(&Buffer); | 3421 AssemblerBuffer::EnsureCapacity ensured(&Buffer); |
| 3424 // We don't assert that imm fits into 8 bits; instead, it gets masked below. | 3422 // We don't assert that imm fits into 8 bits; instead, it gets masked below. |
| 3425 // Note that we don't mask it further (e.g. to 5 bits) because we want the | 3423 // Note that we don't mask it further (e.g. to 5 bits) because we want the |
| 3426 // same processor behavior regardless of whether it's an immediate (masked to | 3424 // same processor behavior regardless of whether it's an immediate (masked to |
| 3427 // 8 bits) or in register cl (essentially ecx masked to 8 bits). | 3425 // 8 bits) or in register cl (essentially ecx masked to 8 bits). |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 3447 (void)shifter; | 3445 (void)shifter; |
| 3448 if (Ty == IceType_i16) | 3446 if (Ty == IceType_i16) |
| 3449 emitOperandSizeOverride(); | 3447 emitOperandSizeOverride(); |
| 3450 emitRexB(Ty, operand.rm()); | 3448 emitRexB(Ty, operand.rm()); |
| 3451 emitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3); | 3449 emitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3); |
| 3452 emitOperand(rm, operand); | 3450 emitOperand(rm, operand); |
| 3453 } | 3451 } |
| 3454 | 3452 |
| 3455 } // end of namespace X86Internal | 3453 } // end of namespace X86Internal |
| 3456 } // end of namespace Ice | 3454 } // end of namespace Ice |
| OLD | NEW |