[arm] Remove static Bit helpers on Instr

These are almost unused, except for 1 case of Bit, which is probably
incorrect. These static helpers can cause subtle error, e.g.
instr->Bit(1, 3) does not get you bits 1 to 3, but rather calls the
static method Bit(Instr, int).

An example of this bug was fixed in https://crrev.com/c/2157799.

Change-Id: I98c4464c4315af48b9d36472ffd6f16aa74aa18b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2158824
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67315}
This commit is contained in:
Ng Zhi An 2020-04-21 11:27:48 -07:00 committed by Commit Bot
parent 06559f4296
commit 50d53886ed
2 changed files with 1 additions and 18 deletions

View File

@ -459,23 +459,6 @@ class Instruction {
return InstructionBits() & (((2 << (hi - lo)) - 1) << lo);
}
// Static support.
// Extract a single bit from the instruction bits and return it as bit 0 in
// the result.
static inline int Bit(Instr instr, int nr) { return (instr >> nr) & 1; }
// Extract a bit field <hi:lo> from the instruction bits and return it in the
// least-significant bits of the result.
static inline int Bits(Instr instr, int hi, int lo) {
return (instr >> lo) & ((2 << (hi - lo)) - 1);
}
// Read a bit field <hi:lo>, leaving its position unchanged in the result.
static inline int BitField(Instr instr, int hi, int lo) {
return instr & (((2 << (hi - lo)) - 1) << lo);
}
// Accessors for the different named fields used in the ARM encoding.
// The naming of these accessor corresponds to figure A3-1.
//

View File

@ -4589,7 +4589,7 @@ void Simulator::DecodeSpecialCondition(Instruction* instr) {
case 0: {
// vmov.i32 Qd, #<imm>
int vd = instr->VFPDRegValue(kSimd128Precision);
uint64_t imm = instr->Bit(24, 24) << 7; // i
uint64_t imm = instr->Bit(24) << 7; // i
imm |= instr->Bits(18, 16) << 4; // imm3
imm |= instr->Bits(3, 0); // imm4
imm |= imm << 32;