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

Unified Diff: src/compiler/arm64/instruction-selector-arm64.cc

Issue 2687373002: Revert of [arm64] A shift of 0 is not allowed in ubfx. (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | test/cctest/compiler/test-run-machops.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/arm64/instruction-selector-arm64.cc
diff --git a/src/compiler/arm64/instruction-selector-arm64.cc b/src/compiler/arm64/instruction-selector-arm64.cc
index 9e2e18e1111ffecfe1699f86e7bcfe1143e88ffd..2a7b9299c22dd63a009aff89eeef70d0c8442a1b 100644
--- a/src/compiler/arm64/instruction-selector-arm64.cc
+++ b/src/compiler/arm64/instruction-selector-arm64.cc
@@ -957,19 +957,17 @@
// Any shift value can match; int64 shifts use `value % 64`.
uint32_t lsb = static_cast<uint32_t>(mleft.right().Value() & 0x3f);
- if (lsb != 0) {
- // Ubfx cannot extract bits past the register size, however since
- // shifting the original value would have introduced some zeros we can
- // still use ubfx with a smaller mask and the remaining bits will be
- // zeros.
- if (lsb + mask_width > 64) mask_width = 64 - lsb;
-
- Emit(kArm64Ubfx, g.DefineAsRegister(node),
- g.UseRegister(mleft.left().node()),
- g.UseImmediateOrTemp(mleft.right().node(), lsb),
- g.TempImmediate(static_cast<int32_t>(mask_width)));
- return;
- }
+ // Ubfx cannot extract bits past the register size, however since
+ // shifting the original value would have introduced some zeros we can
+ // still use ubfx with a smaller mask and the remaining bits will be
+ // zeros.
+ if (lsb + mask_width > 64) mask_width = 64 - lsb;
+
+ Emit(kArm64Ubfx, g.DefineAsRegister(node),
+ g.UseRegister(mleft.left().node()),
+ g.UseImmediateOrTemp(mleft.right().node(), lsb),
+ g.TempImmediate(static_cast<int32_t>(mask_width)));
+ return;
}
// Other cases fall through to the normal And operation.
}
« no previous file with comments | « no previous file | test/cctest/compiler/test-run-machops.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698