Use musttail attribute for Clang 13+

This commit is contained in:
Volodymyr Shymanskyy
2022-08-31 20:15:33 +03:00
parent 22fa923eef
commit 03a4652520
4 changed files with 15 additions and 4 deletions
+6
View File
@@ -82,6 +82,12 @@
# endif
# endif
# if defined(M3_COMPILER_CLANG) && __clang_major__ >= 13
# define M3_MUSTTAIL __attribute__((musttail))
# else
# define M3_MUSTTAIL
# endif
# ifndef M3_MIN
# define M3_MIN(A,B) (((A) < (B)) ? (A) : (B))
# endif
+2 -2
View File
@@ -47,10 +47,10 @@ d_m3BeginExternC
# if d_m3EnableOpProfiling
d_m3RetSig profileOp (d_m3OpSig, cstr_t i_operationName);
# define nextOp() return profileOp (d_m3OpAllArgs, __FUNCTION__)
# define nextOp() M3_MUSTTAIL return profileOp (d_m3OpAllArgs, __FUNCTION__)
# elif d_m3EnableOpTracing
d_m3RetSig debugOp (d_m3OpSig, cstr_t i_operationName);
# define nextOp() return debugOp (d_m3OpAllArgs, __FUNCTION__)
# define nextOp() M3_MUSTTAIL return debugOp (d_m3OpAllArgs, __FUNCTION__)
# else
# define nextOp() nextOpDirect()
# endif
+2 -2
View File
@@ -50,8 +50,8 @@ typedef m3ret_t (vectorcall * IM3Operation) (d_m3OpSig);
#define nextOpImpl() ((IM3Operation)(* _pc))(_pc + 1, d_m3OpArgs)
#define jumpOpImpl(PC) ((IM3Operation)(* PC))( PC + 1, d_m3OpArgs)
#define nextOpDirect() return nextOpImpl()
#define jumpOpDirect(PC) return jumpOpImpl((pc_t)(PC))
#define nextOpDirect() M3_MUSTTAIL return nextOpImpl()
#define jumpOpDirect(PC) M3_MUSTTAIL return jumpOpImpl((pc_t)(PC))
d_m3RetSig RunCode (d_m3OpSig)
{
+5
View File
@@ -267,6 +267,11 @@
# endif
# endif
/*
* Bit ops
*/
#define m3_isBitSet(val, pos) ((val & (1 << pos)) != 0)
/*
* Other
*/