Align opcodes

opam-2.0.0
Vova 3 years ago
parent 4916bc2065
commit c8337c44f8

@ -110,32 +110,30 @@ typedef int8_t i8;
# if defined (M3_COMPILER_MSVC) # if defined (M3_COMPILER_MSVC)
# define vectorcall // For MSVC, better not to specify any call convention # define vectorcall // For MSVC, better not to specify any call convention
# elif defined(__x86_64__)
# define vectorcall __attribute__((aligned(32)))
# elif defined(__MINGW32__) # elif defined(__MINGW32__)
# define vectorcall # define vectorcall
# elif defined(WIN32) # elif defined(WIN32)
# define vectorcall __vectorcall # define vectorcall __vectorcall
# elif defined (ESP8266) # elif defined (ESP8266)
# include <c_types.h> # include <c_types.h>
# define op_section //ICACHE_FLASH_ATTR # define vectorcall //ICACHE_FLASH_ATTR
# elif defined (ESP32) # elif defined (ESP32)
# if defined(M3_IN_IRAM) // the interpreter is in IRAM, attribute not needed # if defined(M3_IN_IRAM) // the interpreter is in IRAM, attribute not needed
# define op_section # define vectorcall
# else # else
# include "esp_system.h" # include "esp_system.h"
# define op_section IRAM_ATTR # define vectorcall IRAM_ATTR
# endif # endif
# elif defined (FOMU) # elif defined (FOMU)
# define op_section __attribute__((section(".ramtext"))) # define vectorcall __attribute__((section(".ramtext")))
# endif # endif
#ifndef vectorcall #ifndef vectorcall
#define vectorcall #define vectorcall
#endif #endif
#ifndef op_section
#define op_section
#endif
/* /*
* Device-specific defaults * Device-specific defaults

@ -45,7 +45,7 @@ d_m3BeginExternC
typedef m3ret_t (vectorcall * IM3Operation) (d_m3OpSig); typedef m3ret_t (vectorcall * IM3Operation) (d_m3OpSig);
#define d_m3RetSig static inline m3ret_t vectorcall #define d_m3RetSig static inline m3ret_t vectorcall
#define d_m3Op(NAME) M3_NO_UBSAN op_section d_m3RetSig op_##NAME (d_m3OpSig) #define d_m3Op(NAME) M3_NO_UBSAN d_m3RetSig op_##NAME (d_m3OpSig)
#define nextOpImpl() ((IM3Operation)(* _pc))(_pc + 1, d_m3OpArgs) #define nextOpImpl() ((IM3Operation)(* _pc))(_pc + 1, d_m3OpArgs)
#define jumpOpImpl(PC) ((IM3Operation)(* PC))( PC + 1, d_m3OpArgs) #define jumpOpImpl(PC) ((IM3Operation)(* PC))( PC + 1, d_m3OpArgs)
@ -53,6 +53,11 @@ typedef m3ret_t (vectorcall * IM3Operation) (d_m3OpSig);
#define nextOpDirect() return nextOpImpl() #define nextOpDirect() return nextOpImpl()
#define jumpOpDirect(PC) return jumpOpImpl((pc_t)(PC)) #define jumpOpDirect(PC) return jumpOpImpl((pc_t)(PC))
d_m3RetSig RunCode (d_m3OpSig)
{
nextOpDirect();
}
d_m3EndExternC d_m3EndExternC
#endif // m3_exec_defs_h #endif // m3_exec_defs_h

Loading…
Cancel
Save