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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 emitUint8(ByteSized ? 0xB6 : 0xB7); | 297 emitUint8(ByteSized ? 0xB6 : 0xB7); |
298 emitOperand(gprEncoding(dst), src); | 298 emitOperand(gprEncoding(dst), src); |
299 } | 299 } |
300 | 300 |
301 template <class Machine> | 301 template <class Machine> |
302 void AssemblerX86Base<Machine>::movsx(Type SrcTy, | 302 void AssemblerX86Base<Machine>::movsx(Type SrcTy, |
303 typename Traits::GPRRegister dst, | 303 typename Traits::GPRRegister dst, |
304 typename Traits::GPRRegister src) { | 304 typename Traits::GPRRegister src) { |
305 AssemblerBuffer::EnsureCapacity ensured(&Buffer); | 305 AssemblerBuffer::EnsureCapacity ensured(&Buffer); |
306 bool ByteSized = isByteSizedType(SrcTy); | 306 bool ByteSized = isByteSizedType(SrcTy); |
307 emitRexRB(IceType_ForceRexW, dst, SrcTy, src); | 307 emitRexRB(RexTypeForceRexW, dst, SrcTy, src); |
308 if (ByteSized || SrcTy == IceType_i16) { | 308 if (ByteSized || SrcTy == IceType_i16) { |
309 emitUint8(0x0F); | 309 emitUint8(0x0F); |
310 emitUint8(ByteSized ? 0xBE : 0xBF); | 310 emitUint8(ByteSized ? 0xBE : 0xBF); |
311 } else { | 311 } else { |
312 assert(Traits::Is64Bit && SrcTy == IceType_i32); | 312 assert(Traits::Is64Bit && SrcTy == IceType_i32); |
313 emitUint8(0x63); | 313 emitUint8(0x63); |
314 } | 314 } |
315 emitRegisterOperand(gprEncoding(dst), gprEncoding(src)); | 315 emitRegisterOperand(gprEncoding(dst), gprEncoding(src)); |
316 } | 316 } |
317 | 317 |
318 template <class Machine> | 318 template <class Machine> |
319 void AssemblerX86Base<Machine>::movsx(Type SrcTy, | 319 void AssemblerX86Base<Machine>::movsx(Type SrcTy, |
320 typename Traits::GPRRegister dst, | 320 typename Traits::GPRRegister dst, |
321 const typename Traits::Address &src) { | 321 const typename Traits::Address &src) { |
322 AssemblerBuffer::EnsureCapacity ensured(&Buffer); | 322 AssemblerBuffer::EnsureCapacity ensured(&Buffer); |
323 bool ByteSized = isByteSizedType(SrcTy); | 323 bool ByteSized = isByteSizedType(SrcTy); |
324 emitRex(SrcTy, src, IceType_ForceRexW, dst); | 324 emitRex(SrcTy, src, RexTypeForceRexW, dst); |
325 if (ByteSized || SrcTy == IceType_i16) { | 325 if (ByteSized || SrcTy == IceType_i16) { |
326 emitUint8(0x0F); | 326 emitUint8(0x0F); |
327 emitUint8(ByteSized ? 0xBE : 0xBF); | 327 emitUint8(ByteSized ? 0xBE : 0xBF); |
328 } else { | 328 } else { |
329 assert(Traits::Is64Bit && SrcTy == IceType_i32); | 329 assert(Traits::Is64Bit && SrcTy == IceType_i32); |
330 emitUint8(0x63); | 330 emitUint8(0x63); |
331 } | 331 } |
332 emitOperand(gprEncoding(dst), src); | 332 emitOperand(gprEncoding(dst), src); |
333 } | 333 } |
334 | 334 |
(...skipping 2941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3276 (void)shifter; | 3276 (void)shifter; |
3277 if (Ty == IceType_i16) | 3277 if (Ty == IceType_i16) |
3278 emitOperandSizeOverride(); | 3278 emitOperandSizeOverride(); |
3279 emitRexB(Ty, operand.rm()); | 3279 emitRexB(Ty, operand.rm()); |
3280 emitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3); | 3280 emitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3); |
3281 emitOperand(rm, operand); | 3281 emitOperand(rm, operand); |
3282 } | 3282 } |
3283 | 3283 |
3284 } // end of namespace X86Internal | 3284 } // end of namespace X86Internal |
3285 } // end of namespace Ice | 3285 } // end of namespace Ice |
OLD | NEW |