Commit 5a299275 authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

[liftoff][wasm-simd] Use is_pair

For functions which check if a register pair is used, change them from
is_gp_pair to is_pair, since they do not care if the pair of register is
a gp pair or a fp pair.

Bug: v8:9909
Change-Id: I262108caadd616c64019b39ebbf6972a548112df
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1974833Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65526}
parent ce904d1d
......@@ -776,7 +776,7 @@ bool LiftoffAssembler::ValidateCacheState() const {
for (const VarState& var : cache_state_.stack_state) {
if (!var.is_reg()) continue;
LiftoffRegister reg = var.reg();
if (kNeedI64RegPair && reg.is_gp_pair()) {
if ((kNeedI64RegPair || kNeedS128RegPair) && reg.is_pair()) {
++register_use_count[reg.low().liftoff_code()];
++register_use_count[reg.high().liftoff_code()];
} else {
......
......@@ -179,7 +179,7 @@ class LiftoffAssembler : public TurboAssembler {
}
void inc_used(LiftoffRegister reg) {
if (reg.is_gp_pair()) {
if (reg.is_pair()) {
inc_used(reg.low());
inc_used(reg.high());
return;
......@@ -192,7 +192,7 @@ class LiftoffAssembler : public TurboAssembler {
// Returns whether this was the last use.
void dec_used(LiftoffRegister reg) {
DCHECK(is_used(reg));
if (reg.is_gp_pair()) {
if (reg.is_pair()) {
dec_used(reg.low());
dec_used(reg.high());
return;
......@@ -203,14 +203,14 @@ class LiftoffAssembler : public TurboAssembler {
}
bool is_used(LiftoffRegister reg) const {
if (reg.is_gp_pair()) return is_used(reg.low()) || is_used(reg.high());
if (reg.is_pair()) return is_used(reg.low()) || is_used(reg.high());
bool used = used_registers.has(reg);
DCHECK_EQ(used, register_use_count[reg.liftoff_code()] != 0);
return used;
}
uint32_t get_use_count(LiftoffRegister reg) const {
if (reg.is_gp_pair()) {
if (reg.is_pair()) {
DCHECK_EQ(register_use_count[reg.low().liftoff_code()],
register_use_count[reg.high().liftoff_code()]);
reg = reg.low();
......
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