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

Unified Diff: src/trusted/validator_arm/baseline_classes.cc

Issue 11569019: Fix uses in ARM table media_instructions. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 8 years 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
« no previous file with comments | « src/trusted/validator_arm/baseline_classes.h ('k') | src/trusted/validator_arm/gen/arm32_decode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/validator_arm/baseline_classes.cc
===================================================================
--- src/trusted/validator_arm/baseline_classes.cc (revision 10465)
+++ src/trusted/validator_arm/baseline_classes.cc (working copy)
@@ -188,6 +188,25 @@
return RegisterList(Register::Pc());
}
+// Unary1RegisterBitRangeMsbGeLsb
+SafetyLevel Unary1RegisterBitRangeMsbGeLsb::safety(Instruction i) const {
+ if (d.reg(i).Equals(Register::Pc()) ||
+ msb.value(i) < lsb.value(i))
+ return UNPREDICTABLE;
+
+ // Note: We would restrict out PC as well for Rd in NaCl, but no need
+ // since the ARM restriction doesn't allow it anyway.
+ return MAY_BE_SAFE;
+}
+
+RegisterList Unary1RegisterBitRangeMsbGeLsb::defs(Instruction i) const {
+ return RegisterList(d.reg(i));
+}
+
+RegisterList Unary1RegisterBitRangeMsbGeLsb::uses(Instruction i) const {
+ return RegisterList(d.reg(i));
+}
+
// Binary2RegisterBitRangeMsbGeLsb
SafetyLevel Binary2RegisterBitRangeMsbGeLsb::safety(Instruction i) const {
return (d.reg(i).Equals(Register::Pc()) ||
@@ -200,6 +219,10 @@
return RegisterList(d.reg(i));
}
+RegisterList Binary2RegisterBitRangeMsbGeLsb::uses(Instruction i) const {
+ return RegisterList(n.reg(i)).Add(d.reg(i));
+}
+
// Binary2RegisterBitRangeNotRnIsPcBitfieldExtract
SafetyLevel Binary2RegisterBitRangeNotRnIsPcBitfieldExtract
::safety(Instruction i) const {
@@ -214,6 +237,11 @@
return RegisterList(d.reg(i));
}
+RegisterList Binary2RegisterBitRangeNotRnIsPcBitfieldExtract
+::uses(Instruction i) const {
+ return RegisterList(n.reg(i));
+}
+
// Binary2RegisterImmediateOp
SafetyLevel Binary2RegisterImmediateOp::safety(Instruction i) const {
if (d.reg(i).Equals(Register::Pc())) {
@@ -347,6 +375,8 @@
return UNPREDICTABLE;
}
+ // TODO(karl): This doesn't apply to all uses in rows in armv7.table.
+ // However, it doesn't really matter since we only accept version 7.
if ((ArchVersion() < 6) && m.reg(i).Equals(n.reg(i))) return UNPREDICTABLE;
// Note: We would restrict out PC as well for Rd in NaCl, but no need
« no previous file with comments | « src/trusted/validator_arm/baseline_classes.h ('k') | src/trusted/validator_arm/gen/arm32_decode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698