| OLD | NEW |
| 1 //===- subzero/src/assembler_ia32.cpp - Assembler for x86-32 -------------===// | 1 //===- subzero/src/assembler_ia32.cpp - Assembler for x86-32 -------------===// |
| 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 2294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2305 EmitUint8(0x0F); | 2305 EmitUint8(0x0F); |
| 2306 EmitUint8(0xAE); | 2306 EmitUint8(0xAE); |
| 2307 EmitUint8(0xF0); | 2307 EmitUint8(0xF0); |
| 2308 } | 2308 } |
| 2309 | 2309 |
| 2310 void AssemblerX86::lock() { | 2310 void AssemblerX86::lock() { |
| 2311 AssemblerBuffer::EnsureCapacity ensured(&buffer_); | 2311 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
| 2312 EmitUint8(0xF0); | 2312 EmitUint8(0xF0); |
| 2313 } | 2313 } |
| 2314 | 2314 |
| 2315 void AssemblerX86::cmpxchg(Type Ty, const Address &address, GPRRegister reg) { | 2315 void AssemblerX86::cmpxchg(Type Ty, const Address &address, GPRRegister reg, |
| 2316 bool Locked) { |
| 2316 AssemblerBuffer::EnsureCapacity ensured(&buffer_); | 2317 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
| 2317 if (Ty == IceType_i16) | 2318 if (Ty == IceType_i16) |
| 2318 EmitOperandSizeOverride(); | 2319 EmitOperandSizeOverride(); |
| 2320 if (Locked) |
| 2321 EmitUint8(0xF0); |
| 2319 EmitUint8(0x0F); | 2322 EmitUint8(0x0F); |
| 2320 if (isByteSizedArithType(Ty)) | 2323 if (isByteSizedArithType(Ty)) |
| 2321 EmitUint8(0xB0); | 2324 EmitUint8(0xB0); |
| 2322 else | 2325 else |
| 2323 EmitUint8(0xB1); | 2326 EmitUint8(0xB1); |
| 2324 EmitOperand(reg, address); | 2327 EmitOperand(reg, address); |
| 2325 } | 2328 } |
| 2326 | 2329 |
| 2327 void AssemblerX86::cmpxchg8b(const Address &address) { | 2330 void AssemblerX86::cmpxchg8b(const Address &address, bool Locked) { |
| 2328 AssemblerBuffer::EnsureCapacity ensured(&buffer_); | 2331 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
| 2332 if (Locked) |
| 2333 EmitUint8(0xF0); |
| 2329 EmitUint8(0x0F); | 2334 EmitUint8(0x0F); |
| 2330 EmitUint8(0xC7); | 2335 EmitUint8(0xC7); |
| 2331 EmitOperand(1, address); | 2336 EmitOperand(1, address); |
| 2332 } | 2337 } |
| 2333 | 2338 |
| 2334 void AssemblerX86::xadd(Type Ty, const Address &addr, GPRRegister reg) { | 2339 void AssemblerX86::xadd(Type Ty, const Address &addr, GPRRegister reg, |
| 2340 bool Locked) { |
| 2335 AssemblerBuffer::EnsureCapacity ensured(&buffer_); | 2341 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
| 2336 if (Ty == IceType_i16) | 2342 if (Ty == IceType_i16) |
| 2337 EmitOperandSizeOverride(); | 2343 EmitOperandSizeOverride(); |
| 2344 if (Locked) |
| 2345 EmitUint8(0xF0); |
| 2338 EmitUint8(0x0F); | 2346 EmitUint8(0x0F); |
| 2339 if (isByteSizedArithType(Ty)) | 2347 if (isByteSizedArithType(Ty)) |
| 2340 EmitUint8(0xC0); | 2348 EmitUint8(0xC0); |
| 2341 else | 2349 else |
| 2342 EmitUint8(0xC1); | 2350 EmitUint8(0xC1); |
| 2343 EmitOperand(reg, addr); | 2351 EmitOperand(reg, addr); |
| 2344 } | 2352 } |
| 2345 | 2353 |
| 2346 void AssemblerX86::xchg(Type Ty, const Address &addr, GPRRegister reg) { | 2354 void AssemblerX86::xchg(Type Ty, const Address &addr, GPRRegister reg) { |
| 2347 AssemblerBuffer::EnsureCapacity ensured(&buffer_); | 2355 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2506 assert(shifter == RegX8632::Encoded_Reg_ecx); | 2514 assert(shifter == RegX8632::Encoded_Reg_ecx); |
| 2507 (void)shifter; | 2515 (void)shifter; |
| 2508 if (Ty == IceType_i16) | 2516 if (Ty == IceType_i16) |
| 2509 EmitOperandSizeOverride(); | 2517 EmitOperandSizeOverride(); |
| 2510 EmitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3); | 2518 EmitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3); |
| 2511 EmitOperand(rm, operand); | 2519 EmitOperand(rm, operand); |
| 2512 } | 2520 } |
| 2513 | 2521 |
| 2514 } // end of namespace x86 | 2522 } // end of namespace x86 |
| 2515 } // end of namespace Ice | 2523 } // end of namespace Ice |
| OLD | NEW |