| 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 bacf7921b7df3c23ffe97cef4155388d6102f9be..203bf3a0bf44aa5b4c961508a6953b8303ef3cfb 100644
|
| --- a/src/compiler/arm64/instruction-selector-arm64.cc
|
| +++ b/src/compiler/arm64/instruction-selector-arm64.cc
|
| @@ -1111,7 +1111,7 @@ void InstructionSelector::VisitWord32Shr(Node* node) {
|
| if (m.left().IsWord32And() && m.right().HasValue()) {
|
| uint32_t lsb = m.right().Value() & 0x1f;
|
| Int32BinopMatcher mleft(m.left().node());
|
| - if (mleft.right().HasValue()) {
|
| + if (mleft.right().HasValue() && mleft.right().Value() != 0) {
|
| // Select Ubfx for Shr(And(x, mask), imm) where the result of the mask is
|
| // shifted into the least-significant bits.
|
| uint32_t mask = (mleft.right().Value() >> lsb) << lsb;
|
| @@ -1155,7 +1155,7 @@ void InstructionSelector::VisitWord64Shr(Node* node) {
|
| if (m.left().IsWord64And() && m.right().HasValue()) {
|
| uint32_t lsb = m.right().Value() & 0x3f;
|
| Int64BinopMatcher mleft(m.left().node());
|
| - if (mleft.right().HasValue()) {
|
| + if (mleft.right().HasValue() && mleft.right().Value() != 0) {
|
| // Select Ubfx for Shr(And(x, mask), imm) where the result of the mask is
|
| // shifted into the least-significant bits.
|
| uint64_t mask = (mleft.right().Value() >> lsb) << lsb;
|
|
|