Commit 2f8ad11f authored by ahaas's avatar ahaas Committed by Commit bot

[arm64] A shift of 0 is not allowed in ubfx.

R=bmeurer@chromium.org, v8-arm-ports@googlegroups.com
BUG=v8:5951

Review-Url: https://codereview.chromium.org/2685943003
Cr-Original-Commit-Position: refs/heads/master@{#43090}
Committed: https://chromium.googlesource.com/v8/v8/+/c46ccef921ee754d60283d132b9d19f64ae7b1ff
Review-Url: https://codereview.chromium.org/2685943003
Cr-Commit-Position: refs/heads/master@{#43199}
parent 94ac7850
......@@ -946,7 +946,8 @@ void InstructionSelector::VisitWord64And(Node* node) {
uint64_t mask = m.right().Value();
uint64_t mask_width = base::bits::CountPopulation64(mask);
uint64_t mask_msb = base::bits::CountLeadingZeros64(mask);
if ((mask_width != 0) && (mask_msb + mask_width == 64)) {
if ((mask_width != 0) && (mask_width != 64) &&
(mask_msb + mask_width == 64)) {
// The mask must be contiguous, and occupy the least-significant bits.
DCHECK_EQ(0u, base::bits::CountTrailingZeros64(mask));
......
......@@ -6730,6 +6730,14 @@ TEST(Regression5923) {
}
}
TEST(Regression5951) {
BufferedRawMachineAssemblerTester<int64_t> m(MachineType::Int64());
m.Return(m.Word64And(m.Word64Shr(m.Parameter(0), m.Int64Constant(0)),
m.Int64Constant(0xffffffffffffffffl)));
int64_t input = 1234;
CHECK_EQ(input, m.Call(input));
}
#endif // V8_TARGET_ARCH_64_BIT
} // namespace compiler
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment