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

Side by Side Diff: src/IceAssemblerX8632.cpp

Issue 1197863003: Subzero: Reduce the amount of #ifdef'd code. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Cleanup Created 5 years, 6 months 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/IceAssemblerX8632.h ('k') | src/IceBuildDefs.h » ('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/IceAssemblerX8632.cpp - Assembler for x86-32 ----------===// 1 //===- subzero/src/IceAssemblerX8632.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 14 matching lines...) Expand all
25 namespace Ice { 25 namespace Ice {
26 namespace X8632 { 26 namespace X8632 {
27 27
28 Address Address::ofConstPool(Assembler *Asm, const Constant *Imm) { 28 Address Address::ofConstPool(Assembler *Asm, const Constant *Imm) {
29 AssemblerFixup *Fixup = Asm->createFixup(llvm::ELF::R_386_32, Imm); 29 AssemblerFixup *Fixup = Asm->createFixup(llvm::ELF::R_386_32, Imm);
30 const RelocOffsetT Offset = 0; 30 const RelocOffsetT Offset = 0;
31 return Address::Absolute(Offset, Fixup); 31 return Address::Absolute(Offset, Fixup);
32 } 32 }
33 33
34 AssemblerX8632::~AssemblerX8632() { 34 AssemblerX8632::~AssemblerX8632() {
35 #ifndef NDEBUG 35 if (BuildDefs::asserts()) {
36 for (const Label *Label : CfgNodeLabels) { 36 for (const Label *Label : CfgNodeLabels) {
37 Label->FinalCheck(); 37 Label->FinalCheck();
38 }
39 for (const Label *Label : LocalLabels) {
40 Label->FinalCheck();
41 }
38 } 42 }
39 for (const Label *Label : LocalLabels) {
40 Label->FinalCheck();
41 }
42 #endif
43 } 43 }
44 44
45 void AssemblerX8632::alignFunction() { 45 void AssemblerX8632::alignFunction() {
46 SizeT Align = 1 << getBundleAlignLog2Bytes(); 46 SizeT Align = 1 << getBundleAlignLog2Bytes();
47 SizeT BytesNeeded = Utils::OffsetToAlignment(Buffer.getPosition(), Align); 47 SizeT BytesNeeded = Utils::OffsetToAlignment(Buffer.getPosition(), Align);
48 const SizeT HltSize = 1; 48 const SizeT HltSize = 1;
49 while (BytesNeeded > 0) { 49 while (BytesNeeded > 0) {
50 hlt(); 50 hlt();
51 BytesNeeded -= HltSize; 51 BytesNeeded -= HltSize;
52 } 52 }
(...skipping 2495 matching lines...) Expand 10 before | Expand all | Expand 10 after
2548 assert(shifter == RegX8632::Encoded_Reg_ecx); 2548 assert(shifter == RegX8632::Encoded_Reg_ecx);
2549 (void)shifter; 2549 (void)shifter;
2550 if (Ty == IceType_i16) 2550 if (Ty == IceType_i16)
2551 emitOperandSizeOverride(); 2551 emitOperandSizeOverride();
2552 emitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3); 2552 emitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3);
2553 emitOperand(rm, operand); 2553 emitOperand(rm, operand);
2554 } 2554 }
2555 2555
2556 } // end of namespace X8632 2556 } // end of namespace X8632
2557 } // end of namespace Ice 2557 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceAssemblerX8632.h ('k') | src/IceBuildDefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698