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

Unified Diff: runtime/vm/simulator_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_arm64.cc ('k') | tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/simulator_arm64.cc
diff --git a/runtime/vm/simulator_arm64.cc b/runtime/vm/simulator_arm64.cc
index 455bac6e80228a81c3d86dbb0bf4d64dce8b7cd7..6125bae52ac4fba69e5680780976a6192c5cf3f1 100644
--- a/runtime/vm/simulator_arm64.cc
+++ b/runtime/vm/simulator_arm64.cc
@@ -3251,33 +3251,52 @@ void Simulator::DecodeFPIntCvt(Instr* instr) {
const Register rd = instr->RdField();
const Register rn = instr->RnField();
- if ((instr->Bit(29) != 0) || (instr->Bits(22, 2) != 1) ||
- ((instr->SFField() == 0) && (instr->Bits(16, 5) != 2))) {
+ if (instr->Bit(29) != 0) {
UnimplementedInstruction(instr);
return;
}
- if (instr->Bits(16, 5) == 2) {
- // Format(instr, "scvtfd'sf 'vd, 'rn");
- const int64_t rn_val64 = get_register(rn, instr->RnMode());
- const int32_t rn_val32 = get_wregister(rn, instr->RnMode());
- const double vn_dbl = (instr->SFField() == 1)
- ? static_cast<double>(rn_val64)
- : static_cast<double>(rn_val32);
- set_vregisterd(vd, 0, bit_cast<int64_t, double>(vn_dbl));
- set_vregisterd(vd, 1, 0);
- } else if (instr->Bits(16, 5) == 6) {
- // Format(instr, "fmovrd'sf 'rd, 'vn");
- const int64_t vn_val = get_vregisterd(vn, 0);
- set_register(instr, rd, vn_val, R31IsZR);
- } else if (instr->Bits(16, 5) == 7) {
- // Format(instr, "fmovdr'sf 'vd, 'rn");
- const int64_t rn_val = get_register(rn, R31IsZR);
- set_vregisterd(vd, 0, rn_val);
- set_vregisterd(vd, 1, 0);
- } else if (instr->Bits(16, 5) == 24) {
- // Format(instr, "fcvtzds'sf 'rd, 'vn");
- const double vn_val = bit_cast<double, int64_t>(get_vregisterd(vn, 0));
- set_register(instr, rd, static_cast<int64_t>(vn_val), instr->RdMode());
+
+ if ((instr->SFField() == 0) && (instr->Bits(22, 2) == 0)) {
+ if (instr->Bits(16, 5) == 6) {
+ // Format(instr, "fmovrs'sf 'rd, 'vn");
+ const int32_t vn_val = get_vregisters(vn, 0);
+ set_wregister(rd, vn_val, R31IsZR);
+ } else if (instr->Bits(16, 5) == 7) {
+ // Format(instr, "fmovsr'sf 'vd, 'rn");
+ const int32_t rn_val = get_wregister(rn, R31IsZR);
+ set_vregisters(vd, 0, rn_val);
+ set_vregisters(vd, 1, 0);
+ set_vregisters(vd, 2, 0);
+ set_vregisters(vd, 3, 0);
+ } else {
+ UnimplementedInstruction(instr);
+ }
+ } else if (instr->Bits(22, 2) == 1) {
+ if (instr->Bits(16, 5) == 2) {
+ // Format(instr, "scvtfd'sf 'vd, 'rn");
+ const int64_t rn_val64 = get_register(rn, instr->RnMode());
+ const int32_t rn_val32 = get_wregister(rn, instr->RnMode());
+ const double vn_dbl = (instr->SFField() == 1)
+ ? static_cast<double>(rn_val64)
+ : static_cast<double>(rn_val32);
+ set_vregisterd(vd, 0, bit_cast<int64_t, double>(vn_dbl));
+ set_vregisterd(vd, 1, 0);
+ } else if (instr->Bits(16, 5) == 6) {
+ // Format(instr, "fmovrd'sf 'rd, 'vn");
+ const int64_t vn_val = get_vregisterd(vn, 0);
+ set_register(instr, rd, vn_val, R31IsZR);
+ } else if (instr->Bits(16, 5) == 7) {
+ // Format(instr, "fmovdr'sf 'vd, 'rn");
+ const int64_t rn_val = get_register(rn, R31IsZR);
+ set_vregisterd(vd, 0, rn_val);
+ set_vregisterd(vd, 1, 0);
+ } else if (instr->Bits(16, 5) == 24) {
+ // Format(instr, "fcvtzds'sf 'rd, 'vn");
+ const double vn_val = bit_cast<double, int64_t>(get_vregisterd(vn, 0));
+ set_register(instr, rd, static_cast<int64_t>(vn_val), instr->RdMode());
+ } else {
+ UnimplementedInstruction(instr);
+ }
} else {
UnimplementedInstruction(instr);
}
« no previous file with comments | « runtime/vm/intermediate_language_arm64.cc ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698