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

Unified Diff: src/IceClFlags.cpp

Issue 1185703004: Add constant blinding/pooling option for X8632 code translation (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: reformat 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 side-by-side diff with in-line comments
Download patch
Index: src/IceClFlags.cpp
diff --git a/src/IceClFlags.cpp b/src/IceClFlags.cpp
index a433b9a7ee836a5d2f06075634e139a79909fc90..d1b9a52c808b0e5aed759e5aeabb49bd987df735 100644
--- a/src/IceClFlags.cpp
+++ b/src/IceClFlags.cpp
@@ -251,6 +251,19 @@ cl::opt<std::string> OutputFilename("o", cl::desc("Override output filename"),
Ice::IceString AppName;
+// Define the command line options for immediates pooling and randomization
+cl::opt<Ice::RandomizeAndPoolImmediatesEnum> RandomizeAndPoolImmediatesOption(
+ "randomize-pool-immediates",
+ cl::desc("Randomize or pooling the representation of immediates"),
+ cl::init(Ice::NoneImmediatesRandomizationPooling),
+ cl::values(clEnumValN(Ice::NoneImmediatesRandomizationPooling, "none",
+ "Do not randomize or pooling immediates (default)"),
+ clEnumValN(Ice::RandomizeImmediates, "constant-blinding",
Jim Stichnoth 2015/06/12 23:48:16 I suggest "blind" instead of "constant-blinding" a
qining 2015/06/17 04:28:52 Agree, but I think we should use 'randomize' inste
+ "Turn on immediate constants blinding"),
+ clEnumValN(Ice::PoolImmediates, "constant-pooling",
+ "Turn on immediate constants pooling"),
+ clEnumValEnd));
+
} // end of anonymous namespace
namespace Ice {
@@ -343,6 +356,10 @@ void ClFlags::getParsedClFlags(ClFlags &OutFlags) {
OutFlags.setMaxNopsPerInstruction(::MaxNopsPerInstruction);
OutFlags.setNopProbabilityAsPercentage(::NopProbabilityAsPercentage);
OutFlags.setVerbose(VMask);
+
+ // set for immediates randomization or pooling option
+ OutFlags.setRandomizeAndPoolImmediatesOption(
+ ::RandomizeAndPoolImmediatesOption);
}
void ClFlags::getParsedClFlagsExtra(ClFlagsExtra &OutFlagsExtra) {

Powered by Google App Engine
This is Rietveld 408576698