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

Side by Side Diff: src/assembler_ia32.cpp

Issue 737513008: Subzero: Simplify the constant pools. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Better fix for the int8/uint8 tests 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/PNaClTranslator.cpp ('k') | tests_lit/llvm2ice_tests/undef.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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 = Ctx->getConstantSym(Offset, StrBuf.str(), SuppressMangling);
64 Ctx->getConstantSym(Ty, Offset, StrBuf.str(), SuppressMangling);
65 AssemblerFixup *Fixup = x86::DisplacementRelocation::create( 64 AssemblerFixup *Fixup = x86::DisplacementRelocation::create(
66 Asm, FK_Abs_4, llvm::cast<ConstantRelocatable>(Sym)); 65 Asm, FK_Abs_4, llvm::cast<ConstantRelocatable>(Sym));
67 return x86::Address::Absolute(Fixup); 66 return x86::Address::Absolute(Fixup);
68 } 67 }
69 68
70 AssemblerX86::~AssemblerX86() { 69 AssemblerX86::~AssemblerX86() {
71 #ifndef NDEBUG 70 #ifndef NDEBUG
72 for (const Label *Label : CfgNodeLabels) { 71 for (const Label *Label : CfgNodeLabels) {
73 Label->FinalCheck(); 72 Label->FinalCheck();
74 } 73 }
(...skipping 2446 matching lines...) Expand 10 before | Expand all | Expand 10 after
2521 assert(shifter == RegX8632::Encoded_Reg_ecx); 2520 assert(shifter == RegX8632::Encoded_Reg_ecx);
2522 (void)shifter; 2521 (void)shifter;
2523 if (Ty == IceType_i16) 2522 if (Ty == IceType_i16)
2524 EmitOperandSizeOverride(); 2523 EmitOperandSizeOverride();
2525 EmitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3); 2524 EmitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3);
2526 EmitOperand(rm, operand); 2525 EmitOperand(rm, operand);
2527 } 2526 }
2528 2527
2529 } // end of namespace x86 2528 } // end of namespace x86
2530 } // end of namespace Ice 2529 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/PNaClTranslator.cpp ('k') | tests_lit/llvm2ice_tests/undef.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698