From c1205eb809794881e248fd893e76ad12906fc889 Mon Sep 17 00:00:00 2001 From: Lioncache Date: Thu, 13 Jul 2023 15:07:54 -0400 Subject: [PATCH] Arm64/Emitter: Mark SVEMemOperand Type enum as enum class Now that we have helpers to make querying a little less verbose, we can mark the enum as an enum class to get rid of implicit conversions. --- .../Core/ArchHelpers/CodeEmitter/Emitter.h | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/External/FEXCore/Source/Interface/Core/ArchHelpers/CodeEmitter/Emitter.h b/External/FEXCore/Source/Interface/Core/ArchHelpers/CodeEmitter/Emitter.h index 9cf329969..f37b235e9 100644 --- a/External/FEXCore/Source/Interface/Core/ArchHelpers/CodeEmitter/Emitter.h +++ b/External/FEXCore/Source/Interface/Core/ArchHelpers/CodeEmitter/Emitter.h @@ -216,16 +216,16 @@ namespace FEXCore::ARMEmitter { MOD_NONE, }; - enum Type { - TYPE_SCALAR_SCALAR, - TYPE_SCALAR_IMM, - TYPE_SCALAR_VECTOR, - TYPE_VECTOR_IMM, + enum class Type { + ScalarPlusScalar, + ScalarPlusImm, + ScalarPlusVector, + VectorPlusImm, }; SVEMemOperand(XRegister rn, XRegister rm = XReg::zr) : rn {rn} - , MemType{TYPE_SCALAR_SCALAR} + , MemType{Type::ScalarPlusScalar} , MetaType { .ScalarScalarType { .rm = rm, @@ -233,7 +233,7 @@ namespace FEXCore::ARMEmitter { } {} SVEMemOperand(XRegister rn, int32_t imm = 0) : rn {rn} - , MemType{TYPE_SCALAR_IMM} + , MemType{Type::ScalarPlusImm} , MetaType { .ScalarImmType { .Imm = imm, @@ -241,7 +241,7 @@ namespace FEXCore::ARMEmitter { } {} SVEMemOperand(XRegister rn, ZRegister zm, ModType mod = ModType::MOD_NONE, uint8_t scale = 0) : rn{rn} - , MemType{TYPE_SCALAR_VECTOR} + , MemType{Type::ScalarPlusVector} , MetaType { .ScalarVectorType { .zm = zm, @@ -251,16 +251,16 @@ namespace FEXCore::ARMEmitter { } {} [[nodiscard]] bool IsScalarPlusScalar() const { - return MemType == TYPE_SCALAR_SCALAR; + return MemType == Type::ScalarPlusScalar; } [[nodiscard]] bool IsScalarPlusImm() const { - return MemType == TYPE_SCALAR_IMM; + return MemType == Type::ScalarPlusImm; } [[nodiscard]] bool IsScalarPlusVector() const { - return MemType == TYPE_SCALAR_VECTOR; + return MemType == Type::ScalarPlusVector; } [[nodiscard]] bool IsVectorPlusImm() const { - return MemType == TYPE_VECTOR_IMM; + return MemType == Type::VectorPlusImm; } union Data {