Commit ce9ca524 authored by Peter Kasting's avatar Peter Kasting Committed by V8 LUCI CQ

Convert a few enum constants to constexprs.

This eliminates some "bitwise operation between different enumeration
types" warnings in c++20, where such ops are deprecated.

Bug: chromium:1284275
Change-Id: Ie7f1d5e9430029bc694cef0358d217871670a8d3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3791964Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82057}
parent 2e0f9c51
...@@ -468,53 +468,48 @@ enum SystemRegister { ...@@ -468,53 +468,48 @@ enum SystemRegister {
const uint32_t kUnallocatedInstruction = 0xffffffff; const uint32_t kUnallocatedInstruction = 0xffffffff;
// Generic fields. // Generic fields.
enum GenericInstrField : uint32_t { using GenericInstrField = uint32_t;
SixtyFourBits = 0x80000000, constexpr GenericInstrField SixtyFourBits = 0x80000000;
ThirtyTwoBits = 0x00000000, constexpr GenericInstrField ThirtyTwoBits = 0x00000000;
FP32 = 0x00000000, constexpr GenericInstrField FP32 = 0x00000000;
FP64 = 0x00400000 constexpr GenericInstrField FP64 = 0x00400000;
};
using NEONFormatField = uint32_t;
enum NEONFormatField : uint32_t { constexpr NEONFormatField NEONFormatFieldMask = 0x40C00000;
NEONFormatFieldMask = 0x40C00000, constexpr NEONFormatField NEON_Q = 0x40000000;
NEON_Q = 0x40000000, constexpr NEONFormatField NEON_8B = 0x00000000;
NEON_8B = 0x00000000, constexpr NEONFormatField NEON_16B = NEON_8B | NEON_Q;
NEON_16B = NEON_8B | NEON_Q, constexpr NEONFormatField NEON_4H = 0x00400000;
NEON_4H = 0x00400000, constexpr NEONFormatField NEON_8H = NEON_4H | NEON_Q;
NEON_8H = NEON_4H | NEON_Q, constexpr NEONFormatField NEON_2S = 0x00800000;
NEON_2S = 0x00800000, constexpr NEONFormatField NEON_4S = NEON_2S | NEON_Q;
NEON_4S = NEON_2S | NEON_Q, constexpr NEONFormatField NEON_1D = 0x00C00000;
NEON_1D = 0x00C00000, constexpr NEONFormatField NEON_2D = 0x00C00000 | NEON_Q;
NEON_2D = 0x00C00000 | NEON_Q
}; using NEONFPFormatField = uint32_t;
constexpr NEONFPFormatField NEONFPFormatFieldMask = 0x40400000;
enum NEONFPFormatField : uint32_t { constexpr NEONFPFormatField NEON_FP_2S = FP32;
NEONFPFormatFieldMask = 0x40400000, constexpr NEONFPFormatField NEON_FP_4S = FP32 | NEON_Q;
NEON_FP_2S = FP32, constexpr NEONFPFormatField NEON_FP_2D = FP64 | NEON_Q;
NEON_FP_4S = FP32 | NEON_Q,
NEON_FP_2D = FP64 | NEON_Q using NEONLSFormatField = uint32_t;
}; constexpr NEONLSFormatField NEONLSFormatFieldMask = 0x40000C00;
constexpr NEONLSFormatField LS_NEON_8B = 0x00000000;
enum NEONLSFormatField : uint32_t { constexpr NEONLSFormatField LS_NEON_16B = LS_NEON_8B | NEON_Q;
NEONLSFormatFieldMask = 0x40000C00, constexpr NEONLSFormatField LS_NEON_4H = 0x00000400;
LS_NEON_8B = 0x00000000, constexpr NEONLSFormatField LS_NEON_8H = LS_NEON_4H | NEON_Q;
LS_NEON_16B = LS_NEON_8B | NEON_Q, constexpr NEONLSFormatField LS_NEON_2S = 0x00000800;
LS_NEON_4H = 0x00000400, constexpr NEONLSFormatField LS_NEON_4S = LS_NEON_2S | NEON_Q;
LS_NEON_8H = LS_NEON_4H | NEON_Q, constexpr NEONLSFormatField LS_NEON_1D = 0x00000C00;
LS_NEON_2S = 0x00000800, constexpr NEONLSFormatField LS_NEON_2D = LS_NEON_1D | NEON_Q;
LS_NEON_4S = LS_NEON_2S | NEON_Q,
LS_NEON_1D = 0x00000C00, using NEONScalarFormatField = uint32_t;
LS_NEON_2D = LS_NEON_1D | NEON_Q constexpr NEONScalarFormatField NEONScalarFormatFieldMask = 0x00C00000;
}; constexpr NEONScalarFormatField NEONScalar = 0x10000000;
constexpr NEONScalarFormatField NEON_B = 0x00000000;
enum NEONScalarFormatField : uint32_t { constexpr NEONScalarFormatField NEON_H = 0x00400000;
NEONScalarFormatFieldMask = 0x00C00000, constexpr NEONScalarFormatField NEON_S = 0x00800000;
NEONScalar = 0x10000000, constexpr NEONScalarFormatField NEON_D = 0x00C00000;
NEON_B = 0x00000000,
NEON_H = 0x00400000,
NEON_S = 0x00800000,
NEON_D = 0x00C00000
};
// PC relative addressing. // PC relative addressing.
enum PCRelAddressingOp : uint32_t { enum PCRelAddressingOp : uint32_t {
......
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