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

Unified Diff: runtime/vm/intermediate_language_arm64.cc

Issue 2940883008: [arm, arm64] Implemented unaligned scalar float access. (Closed)
Patch Set: piecewise float64 Created 3 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
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/simulator_arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_arm64.cc
diff --git a/runtime/vm/intermediate_language_arm64.cc b/runtime/vm/intermediate_language_arm64.cc
index 8986f04fcbcb965addd2e62b72ad06e02645bfa6..bdd9de0699f963620d3611ae00132ff941ddc93e 100644
--- a/runtime/vm/intermediate_language_arm64.cc
+++ b/runtime/vm/intermediate_language_arm64.cc
@@ -1127,15 +1127,26 @@ void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
ASSERT(aligned());
case kTypedDataFloat32ArrayCid:
// Load single precision float.
- __ fldrs(result, element_address);
+ if (aligned()) {
+ __ fldrs(result, element_address);
+ } else {
+ __ LoadUnaligned(TMP, address, TMP2, kUnsignedWord);
+ __ fmovsr(result, TMP);
+ }
break;
case kTypedDataFloat64ArrayCid:
// Load double precision float.
- __ fldrd(result, element_address);
+ if (aligned()) {
+ __ fldrd(result, element_address);
+ } else {
+ __ LoadUnaligned(TMP, address, TMP2, kDoubleWord);
+ __ fmovdr(result, TMP);
+ }
break;
case kTypedDataFloat64x2ArrayCid:
case kTypedDataInt32x4ArrayCid:
case kTypedDataFloat32x4ArrayCid:
+ ASSERT(aligned());
__ fldrq(result, element_address);
break;
default:
@@ -1472,15 +1483,23 @@ void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
break;
}
case kTypedDataFloat32ArrayCid: {
- ASSERT(aligned());
const VRegister value_reg = locs()->in(2).fpu_reg();
- __ fstrs(value_reg, element_address);
+ if (aligned()) {
+ __ fstrs(value_reg, element_address);
+ } else {
+ __ fmovrs(TMP, value_reg);
+ __ StoreUnaligned(TMP, address, scratch, kWord);
+ }
break;
}
case kTypedDataFloat64ArrayCid: {
- ASSERT(aligned());
const VRegister value_reg = locs()->in(2).fpu_reg();
- __ fstrd(value_reg, element_address);
+ if (aligned()) {
+ __ fstrd(value_reg, element_address);
+ } else {
+ __ fmovrd(TMP, value_reg);
+ __ StoreUnaligned(TMP, address, scratch, kDoubleWord);
+ }
break;
}
case kTypedDataFloat64x2ArrayCid:
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/simulator_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698