Commit 36b66498 authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[liftoff] Minor fix to RegClass definition

It would be nice if unused {RegClass}es just equal {kNoReg} on all
platforms.
This CL adds the static asserts for that, and slightly modifies the
definition of the {RegClass} enum to fulfil that. Interestingly, this
only changes the values for the one configuration that is currently
unused :)

R=zhin@chromium.org

Change-Id: Ib1b2a663183ad34822f514d6168c65450c1d7f2e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1975753Reviewed-by: 's avatarZhi An Ng <zhin@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65527}
parent 5a299275
......@@ -22,15 +22,15 @@ static constexpr bool kNeedS128RegPair = !kSimpleFPAliasing;
enum RegClass : uint8_t {
kGpReg,
kFpReg,
kGpRegPair,
kFpRegPair = kGpRegPair + kNeedI64RegPair,
kGpRegPair = kFpReg + 1 + (kNeedS128RegPair && !kNeedI64RegPair),
kFpRegPair = kFpReg + 1 + kNeedI64RegPair,
kNoReg = kFpRegPair + kNeedS128RegPair,
// +------------------+-------------------------------+
// | | kNeedI64RegPair |
// +------------------+---------------+---------------+
// | kNeedS128RegPair | true | false |
// +------------------+---------------+---------------+
// | true | 0,1,2,3,4 (a) | 0,1,2,2,3 |
// | true | 0,1,2,3,4 (a) | 0,1,3,2,3 |
// | false | 0,1,2,3,3 (b) | 0,1,2,2,2 (c) |
// +------------------+---------------+---------------+
// (a) arm
......@@ -38,6 +38,11 @@ enum RegClass : uint8_t {
// (c) x64, arm64
};
static_assert(kNeedI64RegPair == (kGpRegPair != kNoReg),
"kGpRegPair equals kNoReg if unused");
static_assert(kNeedS128RegPair == (kFpRegPair != kNoReg),
"kFpRegPair equals kNoReg if unused");
enum RegPairHalf : uint8_t { kLowWord = 0, kHighWord = 1 };
static inline constexpr bool needs_reg_pair(ValueType type) {
......
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