diff options
author | Serban Constantinescu <serban.constantinescu@arm.com> | 2015-02-22 20:51:33 +0000 |
---|---|---|
committer | Serban Constantinescu <serban.constantinescu@arm.com> | 2015-03-02 14:16:56 +0000 |
commit | 579885a26d761f5ba9550f2a1cd7f0f598c2e1e3 (patch) | |
tree | 58d144157b7a24bbdf7f8892631a15abeefa2c9f /runtime/arch/arm64 | |
parent | 2eb5168bd9e43b80452eaee5be32c063e124886e (diff) | |
download | art-579885a26d761f5ba9550f2a1cd7f0f598c2e1e3.zip art-579885a26d761f5ba9550f2a1cd7f0f598c2e1e3.tar.gz art-579885a26d761f5ba9550f2a1cd7f0f598c2e1e3.tar.bz2 |
Opt Compiler: ARM64: Enable explicit memory barriers over acquire/release
Implement remaining explicit memory barrier code paths and temporarily
enable the use of explicit memory barriers for testing.
This CL also enables the use of instruction set features in the ARM64
backend. kUseAcquireRelease has been replaced with PreferAcquireRelease(),
which for now is statically set to false (prefer explicit memory barriers).
Please note that we still prefer acquire-release for the ARM64 Optimizing
Compiler, but we would like to exercise the explicit memory barrier code
path too.
Change-Id: I84e047ecd43b6fbefc5b82cf532e3f5c59076458
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Diffstat (limited to 'runtime/arch/arm64')
-rw-r--r-- | runtime/arch/arm64/instruction_set_features_arm64.h | 9 | ||||
-rw-r--r-- | runtime/arch/arm64/instruction_set_features_arm64_test.cc | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/runtime/arch/arm64/instruction_set_features_arm64.h b/runtime/arch/arm64/instruction_set_features_arm64.h index b0c66b3..f6bfee7 100644 --- a/runtime/arch/arm64/instruction_set_features_arm64.h +++ b/runtime/arch/arm64/instruction_set_features_arm64.h @@ -61,6 +61,15 @@ class Arm64InstructionSetFeatures FINAL : public InstructionSetFeatures { return fix_cortex_a53_835769_; } + // TODO: Tune this on a per CPU basis. For now, we pessimistically assume + // that all ARM64 CPUs prefer explicit memory barriers over acquire-release. + // + // NOTE: This should not be the case! However we want to exercise the + // explicit memory barriers code paths in the Optimizing Compiler. + bool PreferAcquireRelease() const { + return false; + } + virtual ~Arm64InstructionSetFeatures() {} protected: diff --git a/runtime/arch/arm64/instruction_set_features_arm64_test.cc b/runtime/arch/arm64/instruction_set_features_arm64_test.cc index 027e59c..753107b 100644 --- a/runtime/arch/arm64/instruction_set_features_arm64_test.cc +++ b/runtime/arch/arm64/instruction_set_features_arm64_test.cc @@ -30,6 +30,8 @@ TEST(Arm64InstructionSetFeaturesTest, Arm64Features) { EXPECT_TRUE(arm64_features->Equals(arm64_features.get())); EXPECT_STREQ("smp,a53", arm64_features->GetFeatureString().c_str()); EXPECT_EQ(arm64_features->AsBitmap(), 3U); + // See the comments in instruction_set_features_arm64.h. + EXPECT_FALSE(arm64_features->AsArm64InstructionSetFeatures()->PreferAcquireRelease()); } } // namespace art |