From 70bd453721eba5a22357b84a26bc5888bc7fa871 Mon Sep 17 00:00:00 2001 From: kobalicekp Date: Thu, 24 Apr 2014 02:13:51 +0200 Subject: [PATCH] Renamed const pool functions to be more descriptive and have less collisions. --- src/app/test/testx86.cpp | 5 ++--- src/asmjit/x86/x86compiler.h | 28 +++++++++++++++------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/app/test/testx86.cpp b/src/app/test/testx86.cpp index 75321d4..7eaff03 100644 --- a/src/app/test/testx86.cpp +++ b/src/app/test/testx86.cpp @@ -2361,8 +2361,8 @@ struct X86Test_ConstPoolBase : public X86Test { GpVar v0(c, kVarTypeInt32, "v0"); GpVar v1(c, kVarTypeInt32, "v1"); - Mem c0(c.newConst4(kConstScopeLocal, 200)); - Mem c1(c.newConst4(kConstScopeLocal, 33)); + Mem c0(c.newInt32Const(kConstScopeLocal, 200)); + Mem c1(c.newInt32Const(kConstScopeLocal, 33)); c.mov(v0, c0); c.mov(v1, c1); @@ -2386,7 +2386,6 @@ struct X86Test_ConstPoolBase : public X86Test { } }; - // ============================================================================ // [X86Test_Dummy] // ============================================================================ diff --git a/src/asmjit/x86/x86compiler.h b/src/asmjit/x86/x86compiler.h index be0b680..e65659d 100644 --- a/src/asmjit/x86/x86compiler.h +++ b/src/asmjit/x86/x86compiler.h @@ -1477,22 +1477,24 @@ struct X86X64Compiler : public BaseCompiler { return m; } - ASMJIT_INLINE Mem newConst1(uint32_t scope, uint8_t val) { return newConst(scope, &val, 1); } + ASMJIT_INLINE Mem newByteConst(uint32_t scope, uint8_t val) { return newConst(scope, &val, 1); } + ASMJIT_INLINE Mem newWordConst(uint32_t scope, uint16_t val) { return newConst(scope, &val, 2); } + ASMJIT_INLINE Mem newDWordConst(uint32_t scope, uint32_t val) { return newConst(scope, &val, 4); } + ASMJIT_INLINE Mem newQWordConst(uint32_t scope, uint64_t val) { return newConst(scope, &val, 8); } - ASMJIT_INLINE Mem newConst2(uint32_t scope, int16_t val) { return newConst(scope, &val, 2); } - ASMJIT_INLINE Mem newConst2(uint32_t scope, uint16_t val) { return newConst(scope, &val, 2); } + ASMJIT_INLINE Mem newInt16Const(uint32_t scope, int16_t val) { return newConst(scope, &val, 2); } + ASMJIT_INLINE Mem newUInt16Const(uint32_t scope, uint16_t val) { return newConst(scope, &val, 2); } + ASMJIT_INLINE Mem newInt32Const(uint32_t scope, int32_t val) { return newConst(scope, &val, 4); } + ASMJIT_INLINE Mem newUInt32Const(uint32_t scope, uint32_t val) { return newConst(scope, &val, 4); } + ASMJIT_INLINE Mem newInt64Const(uint32_t scope, int64_t val) { return newConst(scope, &val, 8); } + ASMJIT_INLINE Mem newUInt64Const(uint32_t scope, uint64_t val) { return newConst(scope, &val, 8); } - ASMJIT_INLINE Mem newConst4(uint32_t scope, int32_t val) { return newConst(scope, &val, 4); } - ASMJIT_INLINE Mem newConst4(uint32_t scope, uint32_t val) { return newConst(scope, &val, 4); } - ASMJIT_INLINE Mem newConst4(uint32_t scope, float val) { return newConst(scope, &val, 4); } + ASMJIT_INLINE Mem newFloatConst(uint32_t scope, float val) { return newConst(scope, &val, 4); } + ASMJIT_INLINE Mem newDoubleConst(uint32_t scope, double val) { return newConst(scope, &val, 8); } - ASMJIT_INLINE Mem newConst8(uint32_t scope, int64_t val) { return newConst(scope, &val, 8); } - ASMJIT_INLINE Mem newConst8(uint32_t scope, uint64_t val) { return newConst(scope, &val, 8); } - ASMJIT_INLINE Mem newConst8(uint32_t scope, double val) { return newConst(scope, &val, 8); } - ASMJIT_INLINE Mem newConst8(uint32_t scope, const Vec64Data& val) { return newConst(scope, &val, 8); } - - ASMJIT_INLINE Mem newConst16(uint32_t scope, const Vec128Data& val) { return newConst(scope, &val, 16); } - ASMJIT_INLINE Mem newConst32(uint32_t scope, const Vec256Data& val) { return newConst(scope, &val, 32); } + ASMJIT_INLINE Mem newMmConst(uint32_t scope, const Vec64Data& val) { return newConst(scope, &val, 8); } + ASMJIT_INLINE Mem newXmmConst(uint32_t scope, const Vec128Data& val) { return newConst(scope, &val, 16); } + ASMJIT_INLINE Mem newYmmConst(uint32_t scope, const Vec256Data& val) { return newConst(scope, &val, 32); } // -------------------------------------------------------------------------- // [Embed]