summaryrefslogtreecommitdiff
path: root/runtime/arch/instruction_set_features.h
diff options
context:
space:
mode:
author Serban Constantinescu <serban.constantinescu@linaro.org> 2016-10-26 09:30:21 +0100
committer Scott Wakeling <scott.wakeling@linaro.org> 2017-01-13 15:41:34 +0000
commitd747c13e19763b295cde7dc29a2cc3ed8585e93d (patch)
treee86d7f3fa6a351f6145bfa11c9018e8642245599 /runtime/arch/instruction_set_features.h
parent7e25123127b0b02678a5101d0faa18b65895d723 (diff)
ARM: Update `ArmInstructionSetFeatures` to track ARMv8-A.
Some instructions introduced in ARMv8-A will be useful to improve the generated code. Also add a HasAtLeast() method to the InstructionSetFeatures class. (more info why this is needed in instruction_set_features.h). Test: mma test-art-target && mma test-art-host Change-Id: If42fa4f0b09d3255851c7b4d85271e7163f0b39c Signed-off-by: Alexandre Rames <alexandre.rames@linaro.org> Signed-off-by: Serban Constantinescu <serban.constantinescu@linaro.org>
Diffstat (limited to 'runtime/arch/instruction_set_features.h')
-rw-r--r--runtime/arch/instruction_set_features.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/runtime/arch/instruction_set_features.h b/runtime/arch/instruction_set_features.h
index b6c5c71818..5f1a507f7a 100644
--- a/runtime/arch/instruction_set_features.h
+++ b/runtime/arch/instruction_set_features.h
@@ -67,6 +67,24 @@ class InstructionSetFeatures {
// Are these features the same as the other given features?
virtual bool Equals(const InstructionSetFeatures* other) const = 0;
+ // For testing purposes we want to make sure that the system we run on has at
+ // least the options we claim it has. In this cases Equals() does not
+ // suffice and will cause the test to fail, since the runtime cpu feature
+ // detection claims more capabilities then statically specified from the
+ // build system.
+ //
+ // A good example of this is the armv8 ART test target that declares
+ // "CPU_VARIANT=generic". If the generic target is specified and the code
+ // is run on a platform with enhanced capabilities, the
+ // instruction_set_features test will fail if we resort to using Equals()
+ // between statically defined cpu features and runtime cpu features.
+ //
+ // For now we default this to Equals() in case the architecture does not
+ // provide it.
+ virtual bool HasAtLeast(const InstructionSetFeatures* other) const {
+ return Equals(other);
+ }
+
// Return the ISA these features relate to.
virtual InstructionSet GetInstructionSet() const = 0;