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 |