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

Side by Side Diff: src/IceTargetLoweringX8664.cpp

Issue 1386593004: Subzero: Fix nondeterministic behavior in constant pool creation. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Update comment Created 5 years, 2 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/IceTargetLoweringX8632.cpp ('k') | src/IceTargetLoweringX86BaseImpl.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/IceTargetLoweringX8664.cpp - x86-64 lowering -----------===// 1 //===- subzero/src/IceTargetLoweringX8664.cpp - x86-64 lowering -----------===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 /// 9 ///
10 /// \file 10 /// \file
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 // Use memcpy() to copy bits from Value into RawValue in a way that avoids 766 // Use memcpy() to copy bits from Value into RawValue in a way that avoids
767 // breaking strict-aliasing rules. 767 // breaking strict-aliasing rules.
768 typename T::PrimitiveIntType RawValue; 768 typename T::PrimitiveIntType RawValue;
769 memcpy(&RawValue, &Value, sizeof(Value)); 769 memcpy(&RawValue, &Value, sizeof(Value));
770 char buf[30]; 770 char buf[30];
771 int CharsPrinted = 771 int CharsPrinted =
772 snprintf(buf, llvm::array_lengthof(buf), T::PrintfString, RawValue); 772 snprintf(buf, llvm::array_lengthof(buf), T::PrintfString, RawValue);
773 assert(CharsPrinted >= 0 && 773 assert(CharsPrinted >= 0 &&
774 (size_t)CharsPrinted < llvm::array_lengthof(buf)); 774 (size_t)CharsPrinted < llvm::array_lengthof(buf));
775 (void)CharsPrinted; // avoid warnings if asserts are disabled 775 (void)CharsPrinted; // avoid warnings if asserts are disabled
776 Const->emitPoolLabel(Str); 776 Const->emitPoolLabel(Str, Ctx);
777 Str << ":\n\t" << T::AsmTag << "\t" << buf << "\t# " << T::TypeName << " " 777 Str << ":\n\t" << T::AsmTag << "\t" << buf << "\t# " << T::TypeName << " "
778 << Value << "\n"; 778 << Value << "\n";
779 } 779 }
780 } 780 }
781 781
782 void TargetDataX8664::lowerConstants() { 782 void TargetDataX8664::lowerConstants() {
783 if (Ctx->getFlags().getDisableTranslation()) 783 if (Ctx->getFlags().getDisableTranslation())
784 return; 784 return;
785 // No need to emit constants from the int pool since (for x86) they are 785 // No need to emit constants from the int pool since (for x86) they are
786 // embedded as immediates in the instructions, just emit float/double. 786 // embedded as immediates in the instructions, just emit float/double.
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 // case the high-level table has extra entries. 957 // case the high-level table has extra entries.
958 #define X(tag, sizeLog2, align, elts, elty, str) \ 958 #define X(tag, sizeLog2, align, elts, elty, str) \
959 static_assert(_table1_##tag == _table2_##tag, \ 959 static_assert(_table1_##tag == _table2_##tag, \
960 "Inconsistency between ICETYPEX8664_TABLE and ICETYPE_TABLE"); 960 "Inconsistency between ICETYPEX8664_TABLE and ICETYPE_TABLE");
961 ICETYPE_TABLE 961 ICETYPE_TABLE
962 #undef X 962 #undef X
963 } // end of namespace dummy3 963 } // end of namespace dummy3
964 } // end of anonymous namespace 964 } // end of anonymous namespace
965 965
966 } // end of namespace Ice 966 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX8632.cpp ('k') | src/IceTargetLoweringX86BaseImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698