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

Side by Side Diff: src/assembler_ia32.cpp

Issue 695993004: Subzero: Switch to AT&T asm syntax. I give up. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Add opcode suffix to xchg. Use .L$ prefix for constant pool entries. Created 6 years, 1 month 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
« no previous file with comments | « src/IceTargetLoweringX8632.cpp ('k') | tests_lit/assembler/x86/immediate_encodings.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 }; 50 };
51 51
52 Address Address::ofConstPool(GlobalContext *Ctx, Assembler *Asm, 52 Address Address::ofConstPool(GlobalContext *Ctx, Assembler *Asm,
53 const Constant *Imm) { 53 const Constant *Imm) {
54 // We should make this much lighter-weight. E.g., just record the const pool 54 // We should make this much lighter-weight. E.g., just record the const pool
55 // entry ID. 55 // entry ID.
56 std::string Buffer; 56 std::string Buffer;
57 llvm::raw_string_ostream StrBuf(Buffer); 57 llvm::raw_string_ostream StrBuf(Buffer);
58 Type Ty = Imm->getType(); 58 Type Ty = Imm->getType();
59 assert(llvm::isa<ConstantFloat>(Imm) || llvm::isa<ConstantDouble>(Imm)); 59 assert(llvm::isa<ConstantFloat>(Imm) || llvm::isa<ConstantDouble>(Imm));
60 StrBuf << "L$" << Ty << "$" << Imm->getPoolEntryID(); 60 StrBuf << ".L$" << Ty << "$" << Imm->getPoolEntryID();
61 const RelocOffsetT Offset = 0; 61 const RelocOffsetT Offset = 0;
62 const bool SuppressMangling = true; 62 const bool SuppressMangling = true;
63 Constant *Sym = 63 Constant *Sym =
64 Ctx->getConstantSym(Ty, Offset, StrBuf.str(), SuppressMangling); 64 Ctx->getConstantSym(Ty, Offset, StrBuf.str(), SuppressMangling);
65 AssemblerFixup *Fixup = x86::DisplacementRelocation::create( 65 AssemblerFixup *Fixup = x86::DisplacementRelocation::create(
66 Asm, FK_Abs_4, llvm::cast<ConstantRelocatable>(Sym)); 66 Asm, FK_Abs_4, llvm::cast<ConstantRelocatable>(Sym));
67 return x86::Address::Absolute(Fixup); 67 return x86::Address::Absolute(Fixup);
68 } 68 }
69 69
70 AssemblerX86::~AssemblerX86() { 70 AssemblerX86::~AssemblerX86() {
(...skipping 2450 matching lines...) Expand 10 before | Expand all | Expand 10 after
2521 assert(shifter == RegX8632::Encoded_Reg_ecx); 2521 assert(shifter == RegX8632::Encoded_Reg_ecx);
2522 (void)shifter; 2522 (void)shifter;
2523 if (Ty == IceType_i16) 2523 if (Ty == IceType_i16)
2524 EmitOperandSizeOverride(); 2524 EmitOperandSizeOverride();
2525 EmitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3); 2525 EmitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3);
2526 EmitOperand(rm, operand); 2526 EmitOperand(rm, operand);
2527 } 2527 }
2528 2528
2529 } // end of namespace x86 2529 } // end of namespace x86
2530 } // end of namespace Ice 2530 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX8632.cpp ('k') | tests_lit/assembler/x86/immediate_encodings.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698