Rizin
unix-like reverse engineering framework and cli tools
wasm.h File Reference
#include <rz_util.h>

Go to the source code of this file.

Classes

struct  WasmOp
 
struct  WasmOpDef
 

Enumerations

enum  WasmOpCodes {
  WASM_OP_TRAP = 0x00 , WASM_OP_NOP , WASM_OP_BLOCK , WASM_OP_LOOP ,
  WASM_OP_IF , WASM_OP_ELSE , WASM_OP_END = 0x0b , WASM_OP_BR ,
  WASM_OP_BRIF , WASM_OP_BRTABLE , WASM_OP_RETURN , WASM_OP_CALL = 0x10 ,
  WASM_OP_CALLINDIRECT , WASM_OP_DROP = 0x1a , WASM_OP_SELECT , WASM_OP_GETLOCAL = 0x20 ,
  WASM_OP_SETLOCAL , WASM_OP_TEELOCAL , WASM_OP_GETGLOBAL , WASM_OP_SETGLOBAL ,
  WASM_OP_I32LOAD = 0x28 , WASM_OP_I64LOAD , WASM_OP_F32LOAD , WASM_OP_F64LOAD ,
  WASM_OP_I32LOAD8S , WASM_OP_I32LOAD8U , WASM_OP_I32LOAD16S , WASM_OP_I32LOAD16U ,
  WASM_OP_I64LOAD8S , WASM_OP_I64LOAD8U , WASM_OP_I64LOAD16S , WASM_OP_I64LOAD16U ,
  WASM_OP_I64LOAD32S , WASM_OP_I64LOAD32U , WASM_OP_I32STORE , WASM_OP_I64STORE ,
  WASM_OP_F32STORE , WASM_OP_F64STORE , WASM_OP_I32STORE8 , WASM_OP_I32STORE16 ,
  WASM_OP_I64STORE8 , WASM_OP_I64STORE16 , WASM_OP_I64STORE32 , WASM_OP_CURRENTMEMORY ,
  WASM_OP_GROWMEMORY , WASM_OP_I32CONST , WASM_OP_I64CONST , WASM_OP_F32CONST ,
  WASM_OP_F64CONST , WASM_OP_I32EQZ , WASM_OP_I32EQ , WASM_OP_I32NE ,
  WASM_OP_I32LTS , WASM_OP_I32LTU , WASM_OP_I32GTS , WASM_OP_I32GTU ,
  WASM_OP_I32LES , WASM_OP_I32LEU , WASM_OP_I32GES , WASM_OP_I32GEU ,
  WASM_OP_I64EQZ , WASM_OP_I64EQ , WASM_OP_I64NE , WASM_OP_I64LTS ,
  WASM_OP_I64LTU , WASM_OP_I64GTS , WASM_OP_I64GTU , WASM_OP_I64LES ,
  WASM_OP_I64LEU , WASM_OP_I64GES , WASM_OP_I64GEU , WASM_OP_F32EQ ,
  WASM_OP_F32NE , WASM_OP_F32LT , WASM_OP_F32GT , WASM_OP_F32LE ,
  WASM_OP_F32GE , WASM_OP_F64EQ , WASM_OP_F64NE , WASM_OP_F64LT ,
  WASM_OP_F64GT , WASM_OP_F64LE , WASM_OP_F64GE , WASM_OP_I32CLZ ,
  WASM_OP_I32CTZ , WASM_OP_I32POPCNT , WASM_OP_I32ADD , WASM_OP_I32SUB ,
  WASM_OP_I32MUL , WASM_OP_I32DIVS , WASM_OP_I32DIVU , WASM_OP_I32REMS ,
  WASM_OP_I32REMU , WASM_OP_I32AND , WASM_OP_I32OR , WASM_OP_I32XOR ,
  WASM_OP_I32SHL , WASM_OP_I32SHRS , WASM_OP_I32SHRU , WASM_OP_I32ROTL ,
  WASM_OP_I32ROTR , WASM_OP_I64CLZ , WASM_OP_I64CTZ , WASM_OP_I64POPCNT ,
  WASM_OP_I64ADD , WASM_OP_I64SUB , WASM_OP_I64MUL , WASM_OP_I64DIVS ,
  WASM_OP_I64DIVU , WASM_OP_I64REMS , WASM_OP_I64REMU , WASM_OP_I64AND ,
  WASM_OP_I64OR , WASM_OP_I64XOR , WASM_OP_I64SHL , WASM_OP_I64SHRS ,
  WASM_OP_I64SHRU , WASM_OP_I64ROTL , WASM_OP_I64ROTR , WASM_OP_F32ABS ,
  WASM_OP_F32NEG , WASM_OP_F32CEIL , WASM_OP_F32FLOOR , WASM_OP_F32TRUNC ,
  WASM_OP_F32NEAREST , WASM_OP_F32SQRT , WASM_OP_F32ADD , WASM_OP_F32SUB ,
  WASM_OP_F32MUL , WASM_OP_F32DIV , WASM_OP_F32MIN , WASM_OP_F32MAX ,
  WASM_OP_F32COPYSIGN , WASM_OP_F64ABS , WASM_OP_F64NEG , WASM_OP_F64CEIL ,
  WASM_OP_F64FLOOR , WASM_OP_F64TRUNC , WASM_OP_F64NEAREST , WASM_OP_F64SQRT ,
  WASM_OP_F64ADD , WASM_OP_F64SUB , WASM_OP_F64MUL , WASM_OP_F64DIV ,
  WASM_OP_F64MIN , WASM_OP_F64MAX , WASM_OP_F64COPYSIGN , WASM_OP_I32WRAPI64 ,
  WASM_OP_I32TRUNCSF32 , WASM_OP_I32TRUNCUF32 , WASM_OP_I32TRUNCSF64 , WASM_OP_I32TRUNCUF64 ,
  WASM_OP_I64EXTENDSI32 , WASM_OP_I64EXTENDUI32 , WASM_OP_I64TRUNCSF32 , WASM_OP_I64TRUNCUF32 ,
  WASM_OP_I64TRUNCSF64 , WASM_OP_I64TRUNCUF64 , WASM_OP_F32CONVERTSI32 , WASM_OP_F32CONVERTUI32 ,
  WASM_OP_F32CONVERTSI64 , WASM_OP_F32CONVERTUI64 , WASM_OP_F32DEMOTEF64 , WASM_OP_F64CONVERTSI32 ,
  WASM_OP_F64CONVERTUI32 , WASM_OP_F64CONVERTSI64 , WASM_OP_F64CONVERTUI64 , WASM_OP_F64PROMOTEF32 ,
  WASM_OP_I32REINTERPRETF32 , WASM_OP_I64REINTERPRETF64 , WASM_OP_F32REINTERPRETI32 , WASM_OP_F64REINTERPRETI64
}
 
enum  WasmOpAtomicCodes {
  WASM_OP_ATOMICNOTIFY = 0x00 , WASM_OP_I32ATOMICWAIT , WASM_OP_I64ATOMICWAIT , WASM_OP_I32ATOMICLOAD = 0x10 ,
  WASM_OP_I64ATOMICLOAD , WASM_OP_I32ATOMICLOAD8U , WASM_OP_I32ATOMICLOAD16U , WASM_OP_I64ATOMICLOAD8U ,
  WASM_OP_I64ATOMICLOAD16U , WASM_OP_I64ATOMICLOAD32U , WASM_OP_I32ATOMICSTORE = 0x17 , WASM_OP_I64ATOMICSTORE ,
  WASM_OP_I32ATOMICSTORE8 , WASM_OP_I32ATOMICSTORE16 , WASM_OP_I64ATOMICSTORE8 , WASM_OP_I64ATOMICSTORE16 ,
  WASM_OP_I64ATOMICSTORE32 , WASM_OP_I32ATOMICRMWADD = 0x1e , WASM_OP_I64ATOMICRMWADD , WASM_OP_I32ATOMICRMW8UADD ,
  WASM_OP_I32ATOMICRMW16UADD , WASM_OP_I64ATOMICRMW8UADD , WASM_OP_I64ATOMICRMW16UADD , WASM_OP_I64ATOMICRMW32UADD ,
  WASM_OP_I32ATOMICRMW8USUB = 0x25 , WASM_OP_I32ATOMICRMW16USUB , WASM_OP_I32ATOMICRMWSUB , WASM_OP_I64ATOMICRMW8USUB ,
  WASM_OP_I64ATOMICRMW16USUB , WASM_OP_I64ATOMICRMW32USUB , WASM_OP_I64ATOMICRMWSUB , WASM_OP_I32ATOMICRMWAND = 0x2c ,
  WASM_OP_I64ATOMICRMWAND , WASM_OP_I32ATOMICRMW8UAND , WASM_OP_I32ATOMICRMW16UAND , WASM_OP_I64ATOMICRMW8UAND ,
  WASM_OP_I64ATOMICRMW16UAND , WASM_OP_I64ATOMICRMW32UAND , WASM_OP_I32ATOMICRMWOR = 0x33 , WASM_OP_I64ATOMICRMWOR ,
  WASM_OP_I32ATOMICRMW8UOR , WASM_OP_I32ATOMICRMW16UOR , WASM_OP_I64ATOMICRMW8UOR , WASM_OP_I64ATOMICRMW16UOR ,
  WASM_OP_I64ATOMICRMW32UOR , WASM_OP_I32ATOMICRMWXOR = 0x3a , WASM_OP_I64ATOMICRMWXOR , WASM_OP_I32ATOMICRMW8UXOR ,
  WASM_OP_I32ATOMICRMW16UXOR , WASM_OP_I64ATOMICRMW8UXOR , WASM_OP_I64ATOMICRMW16UXOR , WASM_OP_I64ATOMICRMW32UXOR ,
  WASM_OP_I32ATOMICRMWXCHG = 0x41 , WASM_OP_I64ATOMICRMWXCHG , WASM_OP_I32ATOMICRMW8UXCHG , WASM_OP_I32ATOMICRMW16UXCHG ,
  WASM_OP_I64ATOMICRMW8UXCHG , WASM_OP_I64ATOMICRMW16UXCHG , WASM_OP_I64ATOMICRMW32UXCHG , WASM_OP_I32ATOMICRMWCMPXCHG = 0x48 ,
  WASM_OP_I64ATOMICRMWCMPXCHG , WASM_OP_I32ATOMICRMW8UCMPXCHG , WASM_OP_I32ATOMICRMW16UCMPXCHG , WASM_OP_I64ATOMICRMW8UCMPXCHG ,
  WASM_OP_I64ATOMICRMW16UCMPXCHG , WASM_OP_I64ATOMICRMW32UCMPXCHG
}
 
enum  WasmOpSimdCodes {
  WASM_OP_V128LOAD = 0x00 , WASM_OP_I16X8LOAD8X8S = 0x01 , WASM_OP_I16X8LOAD8X8U = 0x02 , WASM_OP_I32X4LOAD16X4S = 0x03 ,
  WASM_OP_I32X4LOAD16X4U = 0x04 , WASM_OP_I64X2LOAD32X2S = 0x05 , WASM_OP_I64X2LOAD32X2U = 0x06 , WASM_OP_V8X16LOADSPLAT = 0x07 ,
  WASM_OP_V16X8LOADSPLAT = 0x08 , WASM_OP_V32X4LOADSPLAT = 0x09 , WASM_OP_V64X2LOADSPLAT = 0x0a , WASM_OP_V128STORE = 0x0b ,
  WASM_OP_V128CONST = 0x0c , WASM_OP_V8X16SHUFFLE = 0x0d , WASM_OP_V8X16SWIZZLE = 0x0e , WASM_OP_I8X16SPLAT = 0x0f ,
  WASM_OP_I16X8SPLAT = 0x10 , WASM_OP_I32X4SPLAT = 0x11 , WASM_OP_I64X2SPLAT = 0x12 , WASM_OP_F32X4SPLAT = 0x13 ,
  WASM_OP_F64X2SPLAT = 0x14 , WASM_OP_I8X16EXTRACTLANES = 0x15 , WASM_OP_I8X16EXTRACTLANEU = 0x16 , WASM_OP_I8X16REPLACELANE = 0x17 ,
  WASM_OP_I16X8EXTRACTLANES = 0x18 , WASM_OP_I16X8EXTRACTLANEU = 0x19 , WASM_OP_I16X8REPLACELANE = 0x1a , WASM_OP_I32X4EXTRACTLANE = 0x1b ,
  WASM_OP_I32X4REPLACELANE = 0x1c , WASM_OP_I64X2EXTRACTLANE = 0x1d , WASM_OP_I64X2REPLACELANE = 0x1e , WASM_OP_F32X4EXTRACTLANE = 0x1f ,
  WASM_OP_F32X4REPLACELANE = 0x20 , WASM_OP_F64X2EXTRACTLANE = 0x21 , WASM_OP_F64X2REPLACELANE = 0x22 , WASM_OP_I8X16EQ = 0x23 ,
  WASM_OP_I8X16NE = 0x24 , WASM_OP_I8X16LTS = 0x25 , WASM_OP_I8X16LTU = 0x26 , WASM_OP_I8X16GTS = 0x27 ,
  WASM_OP_I8X16GTU = 0x28 , WASM_OP_I8X16LES = 0x29 , WASM_OP_I8X16LEU = 0x2a , WASM_OP_I8X16GES = 0x2b ,
  WASM_OP_I8X16GEU = 0x2c , WASM_OP_I16X8EQ = 0x2d , WASM_OP_I16X8NE = 0x2e , WASM_OP_I16X8LTS = 0x2f ,
  WASM_OP_I16X8LTU = 0x30 , WASM_OP_I16X8GTS = 0x31 , WASM_OP_I16X8GTU = 0x32 , WASM_OP_I16X8LES = 0x33 ,
  WASM_OP_I16X8LEU = 0x34 , WASM_OP_I16X8GES = 0x35 , WASM_OP_I16X8GEU = 0x36 , WASM_OP_I32X4EQ = 0x37 ,
  WASM_OP_I32X4NE = 0x38 , WASM_OP_I32X4LTS = 0x39 , WASM_OP_I32X4LTU = 0x3a , WASM_OP_I32X4GTS = 0x3b ,
  WASM_OP_I32X4GTU = 0x3c , WASM_OP_I32X4LES = 0x3d , WASM_OP_I32X4LEU = 0x3e , WASM_OP_I32X4GES = 0x3f ,
  WASM_OP_I32X4GEU = 0x40 , WASM_OP_F32X4EQ = 0x41 , WASM_OP_F32X4NE = 0x42 , WASM_OP_F32X4LT = 0x43 ,
  WASM_OP_F32X4GT = 0x44 , WASM_OP_F32X4LE = 0x45 , WASM_OP_F32X4GE = 0x46 , WASM_OP_F64X2EQ = 0x47 ,
  WASM_OP_F64X2NE = 0x48 , WASM_OP_F64X2LT = 0x49 , WASM_OP_F64X2GT = 0x4a , WASM_OP_F64X2LE = 0x4b ,
  WASM_OP_F64X2GE = 0x4c , WASM_OP_V128NOT = 0x4d , WASM_OP_V128AND = 0x4e , WASM_OP_V128ANDNOT = 0x4f ,
  WASM_OP_V128OR = 0x50 , WASM_OP_V128XOR = 0x51 , WASM_OP_V128BITSELECT = 0x52 , WASM_OP_I8X16ABS = 0x60 ,
  WASM_OP_I8X16NEG = 0x61 , WASM_OP_I8X16ANYTRUE = 0x62 , WASM_OP_I8X16ALLTRUE = 0x63 , WASM_OP_I8X16NARROWI16X8S = 0x65 ,
  WASM_OP_I8X16NARROWI16X8U = 0x66 , WASM_OP_I8X16SHL = 0x6b , WASM_OP_I8X16SHRS = 0x6c , WASM_OP_I8X16SHRU = 0x6d ,
  WASM_OP_I8X16ADD = 0x6e , WASM_OP_I8X16ADDSATURATES = 0x6f , WASM_OP_I8X16ADDSATURATEU = 0x70 , WASM_OP_I8X16SUB = 0x71 ,
  WASM_OP_I8X16SUBSATURATES = 0x72 , WASM_OP_I8X16SUBSATURATEU = 0x73 , WASM_OP_I8X16MINS = 0x76 , WASM_OP_I8X16MINU = 0x77 ,
  WASM_OP_I8X16MAXS = 0x78 , WASM_OP_I8X16MAXU = 0x79 , WASM_OP_I8X16AVGRU = 0x7b , WASM_OP_I16X8ABS = 0x80 ,
  WASM_OP_I16X8NEG = 0x81 , WASM_OP_I16X8ANYTRUE = 0x82 , WASM_OP_I16X8ALLTRUE = 0x83 , WASM_OP_I16X8NARROWI32X4S = 0x85 ,
  WASM_OP_I16X8NARROWI32X4U = 0x86 , WASM_OP_I16X8WIDENLOWI8X16S = 0x87 , WASM_OP_I16X8WIDENHIGHI8X16S = 0x88 , WASM_OP_I16X8WIDENLOWI8X16U = 0x89 ,
  WASM_OP_I16X8WIDENHIGHI8X16U = 0x8a , WASM_OP_I16X8SHL = 0x8b , WASM_OP_I16X8SHRS = 0x8c , WASM_OP_I16X8SHRU = 0x8d ,
  WASM_OP_I16X8ADD = 0x8e , WASM_OP_I16X8ADDSATURATES = 0x8f , WASM_OP_I16X8ADDSATURATEU = 0x90 , WASM_OP_I16X8SUB = 0x91 ,
  WASM_OP_I16X8SUBSATURATES = 0x92 , WASM_OP_I16X8SUBSATURATEU = 0x93 , WASM_OP_I16X8MUL = 0x95 , WASM_OP_I16X8MINS = 0x96 ,
  WASM_OP_I16X8MINU = 0x97 , WASM_OP_I16X8MAXS = 0x98 , WASM_OP_I16X8MAXU = 0x99 , WASM_OP_I16X8AVGRU = 0x9b ,
  WASM_OP_I32X4ABS = 0xa0 , WASM_OP_I32X4NEG = 0xa1 , WASM_OP_I32X4ANYTRUE = 0xa2 , WASM_OP_I32X4ALLTRUE = 0xa3 ,
  WASM_OP_I32X4WIDENLOWI16X8S = 0xa7 , WASM_OP_I32X4WIDENHIGHI16X8S = 0xa8 , WASM_OP_I32X4WIDENLOWI16X8U = 0xa9 , WASM_OP_I32X4WIDENHIGHI16X8U = 0xaa ,
  WASM_OP_I32X4SHL = 0xab , WASM_OP_I32X4SHRS = 0xac , WASM_OP_I32X4SHRU = 0xad , WASM_OP_I32X4ADD = 0xae ,
  WASM_OP_I32X4SUB = 0xb1 , WASM_OP_I32X4MUL = 0xb5 , WASM_OP_I32X4MINS = 0xb6 , WASM_OP_I32X4MINU = 0xb7 ,
  WASM_OP_I32X4MAXS = 0xb8 , WASM_OP_I32X4MAXU = 0xb9 , WASM_OP_I64X2NEG = 0xc1 , WASM_OP_I64X2SHL = 0xcb ,
  WASM_OP_I64X2SHRS = 0xcc , WASM_OP_I64X2SHRU = 0xcd , WASM_OP_I64X2ADD = 0xce , WASM_OP_I64X2SUB = 0xd1 ,
  WASM_OP_I64X2MUL = 0xd5 , WASM_OP_F32X4ABS = 0xe0 , WASM_OP_F32X4NEG = 0xe1 , WASM_OP_F32X4SQRT = 0xe3 ,
  WASM_OP_F32X4ADD = 0xe4 , WASM_OP_F32X4SUB = 0xe5 , WASM_OP_F32X4MUL = 0xe6 , WASM_OP_F32X4DIV = 0xe7 ,
  WASM_OP_F32X4MIN = 0xe8 , WASM_OP_F32X4MAX = 0xe9 , WASM_OP_F64X2ABS = 0xec , WASM_OP_F64X2NEG = 0xed ,
  WASM_OP_F64X2SQRT = 0xef , WASM_OP_F64X2ADD = 0xf0 , WASM_OP_F64X2SUB = 0xf1 , WASM_OP_F64X2MUL = 0xf2 ,
  WASM_OP_F64X2DIV = 0xf3 , WASM_OP_F64X2MIN = 0xf4 , WASM_OP_F64X2MAX = 0xf5 , WASM_OP_I32X4TRUNCSATF32X4S = 0xf8 ,
  WASM_OP_I32X4TRUNCSATF32X4U = 0xf9 , WASM_OP_F32X4CONVERTI32X4S = 0xfa , WASM_OP_F32X4CONVERTI32X4U = 0xfb
}
 
enum  WasmTypeOp { WASM_TYPE_OP_CORE , WASM_TYPE_OP_ATOMIC , WASM_TYPE_OP_SIMD }
 

Functions

RZ_IPI int wasm_asm (const char *str, unsigned char *buf, int buf_len)
 
RZ_IPI int wasm_dis (WasmOp *op, const unsigned char *buf, int buf_len)
 

Enumeration Type Documentation

◆ WasmOpAtomicCodes

Enumerator
WASM_OP_ATOMICNOTIFY 
WASM_OP_I32ATOMICWAIT 
WASM_OP_I64ATOMICWAIT 
WASM_OP_I32ATOMICLOAD 
WASM_OP_I64ATOMICLOAD 
WASM_OP_I32ATOMICLOAD8U 
WASM_OP_I32ATOMICLOAD16U 
WASM_OP_I64ATOMICLOAD8U 
WASM_OP_I64ATOMICLOAD16U 
WASM_OP_I64ATOMICLOAD32U 
WASM_OP_I32ATOMICSTORE 
WASM_OP_I64ATOMICSTORE 
WASM_OP_I32ATOMICSTORE8 
WASM_OP_I32ATOMICSTORE16 
WASM_OP_I64ATOMICSTORE8 
WASM_OP_I64ATOMICSTORE16 
WASM_OP_I64ATOMICSTORE32 
WASM_OP_I32ATOMICRMWADD 
WASM_OP_I64ATOMICRMWADD 
WASM_OP_I32ATOMICRMW8UADD 
WASM_OP_I32ATOMICRMW16UADD 
WASM_OP_I64ATOMICRMW8UADD 
WASM_OP_I64ATOMICRMW16UADD 
WASM_OP_I64ATOMICRMW32UADD 
WASM_OP_I32ATOMICRMW8USUB 
WASM_OP_I32ATOMICRMW16USUB 
WASM_OP_I32ATOMICRMWSUB 
WASM_OP_I64ATOMICRMW8USUB 
WASM_OP_I64ATOMICRMW16USUB 
WASM_OP_I64ATOMICRMW32USUB 
WASM_OP_I64ATOMICRMWSUB 
WASM_OP_I32ATOMICRMWAND 
WASM_OP_I64ATOMICRMWAND 
WASM_OP_I32ATOMICRMW8UAND 
WASM_OP_I32ATOMICRMW16UAND 
WASM_OP_I64ATOMICRMW8UAND 
WASM_OP_I64ATOMICRMW16UAND 
WASM_OP_I64ATOMICRMW32UAND 
WASM_OP_I32ATOMICRMWOR 
WASM_OP_I64ATOMICRMWOR 
WASM_OP_I32ATOMICRMW8UOR 
WASM_OP_I32ATOMICRMW16UOR 
WASM_OP_I64ATOMICRMW8UOR 
WASM_OP_I64ATOMICRMW16UOR 
WASM_OP_I64ATOMICRMW32UOR 
WASM_OP_I32ATOMICRMWXOR 
WASM_OP_I64ATOMICRMWXOR 
WASM_OP_I32ATOMICRMW8UXOR 
WASM_OP_I32ATOMICRMW16UXOR 
WASM_OP_I64ATOMICRMW8UXOR 
WASM_OP_I64ATOMICRMW16UXOR 
WASM_OP_I64ATOMICRMW32UXOR 
WASM_OP_I32ATOMICRMWXCHG 
WASM_OP_I64ATOMICRMWXCHG 
WASM_OP_I32ATOMICRMW8UXCHG 
WASM_OP_I32ATOMICRMW16UXCHG 
WASM_OP_I64ATOMICRMW8UXCHG 
WASM_OP_I64ATOMICRMW16UXCHG 
WASM_OP_I64ATOMICRMW32UXCHG 
WASM_OP_I32ATOMICRMWCMPXCHG 
WASM_OP_I64ATOMICRMWCMPXCHG 
WASM_OP_I32ATOMICRMW8UCMPXCHG 
WASM_OP_I32ATOMICRMW16UCMPXCHG 
WASM_OP_I64ATOMICRMW8UCMPXCHG 
WASM_OP_I64ATOMICRMW16UCMPXCHG 
WASM_OP_I64ATOMICRMW32UCMPXCHG 

Definition at line 210 of file wasm.h.

210  {
211 
212  // Wait and notify
213  WASM_OP_ATOMICNOTIFY = 0x00,
216 
217  // Load/Store
218  WASM_OP_I32ATOMICLOAD = 0x10,
225  WASM_OP_I32ATOMICSTORE = 0x17,
232 
233  // Read-Modify-Write
255  WASM_OP_I32ATOMICRMWOR = 0x33,
276 
277  // Compare exchange
285 
WasmOpAtomicCodes
Definition: wasm.h:210
@ WASM_OP_I32ATOMICRMWSUB
Definition: wasm.h:243
@ WASM_OP_I32ATOMICRMW16UOR
Definition: wasm.h:258
@ WASM_OP_I32ATOMICWAIT
Definition: wasm.h:214
@ WASM_OP_I64ATOMICLOAD16U
Definition: wasm.h:223
@ WASM_OP_I32ATOMICRMW16USUB
Definition: wasm.h:242
@ WASM_OP_I64ATOMICLOAD32U
Definition: wasm.h:224
@ WASM_OP_I32ATOMICRMW8UAND
Definition: wasm.h:250
@ WASM_OP_I64ATOMICLOAD8U
Definition: wasm.h:222
@ WASM_OP_I32ATOMICRMW8UXOR
Definition: wasm.h:264
@ WASM_OP_I64ATOMICRMW32UOR
Definition: wasm.h:261
@ WASM_OP_I64ATOMICRMW32UCMPXCHG
Definition: wasm.h:284
@ WASM_OP_I32ATOMICRMW8UOR
Definition: wasm.h:257
@ WASM_OP_I64ATOMICRMW8UAND
Definition: wasm.h:252
@ WASM_OP_I64ATOMICRMW8UOR
Definition: wasm.h:259
@ WASM_OP_I64ATOMICRMW16UADD
Definition: wasm.h:239
@ WASM_OP_I32ATOMICRMWOR
Definition: wasm.h:255
@ WASM_OP_I64ATOMICRMW32UADD
Definition: wasm.h:240
@ WASM_OP_I32ATOMICSTORE16
Definition: wasm.h:228
@ WASM_OP_I32ATOMICRMW8UADD
Definition: wasm.h:236
@ WASM_OP_I64ATOMICLOAD
Definition: wasm.h:219
@ WASM_OP_I64ATOMICSTORE32
Definition: wasm.h:231
@ WASM_OP_ATOMICNOTIFY
Definition: wasm.h:213
@ WASM_OP_I32ATOMICRMW16UCMPXCHG
Definition: wasm.h:281
@ WASM_OP_I64ATOMICRMW8UXCHG
Definition: wasm.h:273
@ WASM_OP_I32ATOMICRMW8USUB
Definition: wasm.h:241
@ WASM_OP_I32ATOMICSTORE
Definition: wasm.h:225
@ WASM_OP_I32ATOMICRMWXOR
Definition: wasm.h:262
@ WASM_OP_I32ATOMICRMW16UADD
Definition: wasm.h:237
@ WASM_OP_I64ATOMICSTORE8
Definition: wasm.h:229
@ WASM_OP_I64ATOMICRMW32UXOR
Definition: wasm.h:268
@ WASM_OP_I32ATOMICLOAD16U
Definition: wasm.h:221
@ WASM_OP_I64ATOMICRMWXCHG
Definition: wasm.h:270
@ WASM_OP_I32ATOMICLOAD8U
Definition: wasm.h:220
@ WASM_OP_I32ATOMICRMW8UCMPXCHG
Definition: wasm.h:280
@ WASM_OP_I64ATOMICRMW16UAND
Definition: wasm.h:253
@ WASM_OP_I64ATOMICRMW32UAND
Definition: wasm.h:254
@ WASM_OP_I64ATOMICRMW16UXOR
Definition: wasm.h:267
@ WASM_OP_I32ATOMICRMWXCHG
Definition: wasm.h:269
@ WASM_OP_I64ATOMICRMWOR
Definition: wasm.h:256
@ WASM_OP_I64ATOMICRMWAND
Definition: wasm.h:249
@ WASM_OP_I32ATOMICSTORE8
Definition: wasm.h:227
@ WASM_OP_I64ATOMICSTORE16
Definition: wasm.h:230
@ WASM_OP_I32ATOMICRMW16UAND
Definition: wasm.h:251
@ WASM_OP_I64ATOMICRMWCMPXCHG
Definition: wasm.h:279
@ WASM_OP_I64ATOMICRMW8UADD
Definition: wasm.h:238
@ WASM_OP_I32ATOMICRMWAND
Definition: wasm.h:248
@ WASM_OP_I64ATOMICSTORE
Definition: wasm.h:226
@ WASM_OP_I32ATOMICRMW16UXCHG
Definition: wasm.h:272
@ WASM_OP_I64ATOMICRMW16UOR
Definition: wasm.h:260
@ WASM_OP_I32ATOMICLOAD
Definition: wasm.h:218
@ WASM_OP_I64ATOMICRMW16UXCHG
Definition: wasm.h:274
@ WASM_OP_I32ATOMICRMW8UXCHG
Definition: wasm.h:271
@ WASM_OP_I64ATOMICRMW32USUB
Definition: wasm.h:246
@ WASM_OP_I64ATOMICRMW32UXCHG
Definition: wasm.h:275
@ WASM_OP_I64ATOMICRMW8USUB
Definition: wasm.h:244
@ WASM_OP_I32ATOMICRMW16UXOR
Definition: wasm.h:265
@ WASM_OP_I64ATOMICRMW8UXOR
Definition: wasm.h:266
@ WASM_OP_I64ATOMICRMW16UCMPXCHG
Definition: wasm.h:283
@ WASM_OP_I32ATOMICRMWADD
Definition: wasm.h:234
@ WASM_OP_I32ATOMICRMWCMPXCHG
Definition: wasm.h:278
@ WASM_OP_I64ATOMICRMW8UCMPXCHG
Definition: wasm.h:282
@ WASM_OP_I64ATOMICWAIT
Definition: wasm.h:215
@ WASM_OP_I64ATOMICRMWSUB
Definition: wasm.h:247
@ WASM_OP_I64ATOMICRMWADD
Definition: wasm.h:235
@ WASM_OP_I64ATOMICRMWXOR
Definition: wasm.h:263
@ WASM_OP_I64ATOMICRMW16USUB
Definition: wasm.h:245

◆ WasmOpCodes

Enumerator
WASM_OP_TRAP 
WASM_OP_NOP 
WASM_OP_BLOCK 
WASM_OP_LOOP 
WASM_OP_IF 
WASM_OP_ELSE 
WASM_OP_END 
WASM_OP_BR 
WASM_OP_BRIF 
WASM_OP_BRTABLE 
WASM_OP_RETURN 
WASM_OP_CALL 
WASM_OP_CALLINDIRECT 
WASM_OP_DROP 
WASM_OP_SELECT 
WASM_OP_GETLOCAL 
WASM_OP_SETLOCAL 
WASM_OP_TEELOCAL 
WASM_OP_GETGLOBAL 
WASM_OP_SETGLOBAL 
WASM_OP_I32LOAD 
WASM_OP_I64LOAD 
WASM_OP_F32LOAD 
WASM_OP_F64LOAD 
WASM_OP_I32LOAD8S 
WASM_OP_I32LOAD8U 
WASM_OP_I32LOAD16S 
WASM_OP_I32LOAD16U 
WASM_OP_I64LOAD8S 
WASM_OP_I64LOAD8U 
WASM_OP_I64LOAD16S 
WASM_OP_I64LOAD16U 
WASM_OP_I64LOAD32S 
WASM_OP_I64LOAD32U 
WASM_OP_I32STORE 
WASM_OP_I64STORE 
WASM_OP_F32STORE 
WASM_OP_F64STORE 
WASM_OP_I32STORE8 
WASM_OP_I32STORE16 
WASM_OP_I64STORE8 
WASM_OP_I64STORE16 
WASM_OP_I64STORE32 
WASM_OP_CURRENTMEMORY 
WASM_OP_GROWMEMORY 
WASM_OP_I32CONST 
WASM_OP_I64CONST 
WASM_OP_F32CONST 
WASM_OP_F64CONST 
WASM_OP_I32EQZ 
WASM_OP_I32EQ 
WASM_OP_I32NE 
WASM_OP_I32LTS 
WASM_OP_I32LTU 
WASM_OP_I32GTS 
WASM_OP_I32GTU 
WASM_OP_I32LES 
WASM_OP_I32LEU 
WASM_OP_I32GES 
WASM_OP_I32GEU 
WASM_OP_I64EQZ 
WASM_OP_I64EQ 
WASM_OP_I64NE 
WASM_OP_I64LTS 
WASM_OP_I64LTU 
WASM_OP_I64GTS 
WASM_OP_I64GTU 
WASM_OP_I64LES 
WASM_OP_I64LEU 
WASM_OP_I64GES 
WASM_OP_I64GEU 
WASM_OP_F32EQ 
WASM_OP_F32NE 
WASM_OP_F32LT 
WASM_OP_F32GT 
WASM_OP_F32LE 
WASM_OP_F32GE 
WASM_OP_F64EQ 
WASM_OP_F64NE 
WASM_OP_F64LT 
WASM_OP_F64GT 
WASM_OP_F64LE 
WASM_OP_F64GE 
WASM_OP_I32CLZ 
WASM_OP_I32CTZ 
WASM_OP_I32POPCNT 
WASM_OP_I32ADD 
WASM_OP_I32SUB 
WASM_OP_I32MUL 
WASM_OP_I32DIVS 
WASM_OP_I32DIVU 
WASM_OP_I32REMS 
WASM_OP_I32REMU 
WASM_OP_I32AND 
WASM_OP_I32OR 
WASM_OP_I32XOR 
WASM_OP_I32SHL 
WASM_OP_I32SHRS 
WASM_OP_I32SHRU 
WASM_OP_I32ROTL 
WASM_OP_I32ROTR 
WASM_OP_I64CLZ 
WASM_OP_I64CTZ 
WASM_OP_I64POPCNT 
WASM_OP_I64ADD 
WASM_OP_I64SUB 
WASM_OP_I64MUL 
WASM_OP_I64DIVS 
WASM_OP_I64DIVU 
WASM_OP_I64REMS 
WASM_OP_I64REMU 
WASM_OP_I64AND 
WASM_OP_I64OR 
WASM_OP_I64XOR 
WASM_OP_I64SHL 
WASM_OP_I64SHRS 
WASM_OP_I64SHRU 
WASM_OP_I64ROTL 
WASM_OP_I64ROTR 
WASM_OP_F32ABS 
WASM_OP_F32NEG 
WASM_OP_F32CEIL 
WASM_OP_F32FLOOR 
WASM_OP_F32TRUNC 
WASM_OP_F32NEAREST 
WASM_OP_F32SQRT 
WASM_OP_F32ADD 
WASM_OP_F32SUB 
WASM_OP_F32MUL 
WASM_OP_F32DIV 
WASM_OP_F32MIN 
WASM_OP_F32MAX 
WASM_OP_F32COPYSIGN 
WASM_OP_F64ABS 
WASM_OP_F64NEG 
WASM_OP_F64CEIL 
WASM_OP_F64FLOOR 
WASM_OP_F64TRUNC 
WASM_OP_F64NEAREST 
WASM_OP_F64SQRT 
WASM_OP_F64ADD 
WASM_OP_F64SUB 
WASM_OP_F64MUL 
WASM_OP_F64DIV 
WASM_OP_F64MIN 
WASM_OP_F64MAX 
WASM_OP_F64COPYSIGN 
WASM_OP_I32WRAPI64 
WASM_OP_I32TRUNCSF32 
WASM_OP_I32TRUNCUF32 
WASM_OP_I32TRUNCSF64 
WASM_OP_I32TRUNCUF64 
WASM_OP_I64EXTENDSI32 
WASM_OP_I64EXTENDUI32 
WASM_OP_I64TRUNCSF32 
WASM_OP_I64TRUNCUF32 
WASM_OP_I64TRUNCSF64 
WASM_OP_I64TRUNCUF64 
WASM_OP_F32CONVERTSI32 
WASM_OP_F32CONVERTUI32 
WASM_OP_F32CONVERTSI64 
WASM_OP_F32CONVERTUI64 
WASM_OP_F32DEMOTEF64 
WASM_OP_F64CONVERTSI32 
WASM_OP_F64CONVERTUI32 
WASM_OP_F64CONVERTSI64 
WASM_OP_F64CONVERTUI64 
WASM_OP_F64PROMOTEF32 
WASM_OP_I32REINTERPRETF32 
WASM_OP_I64REINTERPRETF64 
WASM_OP_F32REINTERPRETI32 
WASM_OP_F64REINTERPRETI64 

Definition at line 11 of file wasm.h.

11  {
12 
13  // Control flow operators
14  WASM_OP_TRAP = 0x00,
18  WASM_OP_IF,
20  WASM_OP_END = 0x0b,
21  WASM_OP_BR,
25 
26  // Call operators
27  WASM_OP_CALL = 0x10,
29 
30  // Parametric operators
31  WASM_OP_DROP = 0x1a,
33 
34  // Variable access
35  WASM_OP_GETLOCAL = 0x20,
40 
41  // Memory-related operators
42  WASM_OP_I32LOAD = 0x28,
67 
68  // Constants
73 
74  // Comparison operators
109 
110  // Numeric operators
175 
176  // Conversions
198 
199  // Reinterpretations
204 
205 } WasmOpCodes;
WasmOpCodes
Definition: wasm.h:11
@ WASM_OP_CALL
Definition: wasm.h:27
@ WASM_OP_F32LOAD
Definition: wasm.h:44
@ WASM_OP_I32TRUNCUF64
Definition: wasm.h:181
@ WASM_OP_I64LES
Definition: wasm.h:93
@ WASM_OP_F64CONVERTUI32
Definition: wasm.h:194
@ WASM_OP_LOOP
Definition: wasm.h:17
@ WASM_OP_I32REMU
Definition: wasm.h:120
@ WASM_OP_I64EQ
Definition: wasm.h:87
@ WASM_OP_SELECT
Definition: wasm.h:32
@ WASM_OP_F32SUB
Definition: wasm.h:155
@ WASM_OP_I64LOAD
Definition: wasm.h:43
@ WASM_OP_I32LOAD16S
Definition: wasm.h:48
@ WASM_OP_GROWMEMORY
Definition: wasm.h:66
@ WASM_OP_I64DIVU
Definition: wasm.h:136
@ WASM_OP_I64GTU
Definition: wasm.h:92
@ WASM_OP_F32NEG
Definition: wasm.h:148
@ WASM_OP_I64LTS
Definition: wasm.h:89
@ WASM_OP_I64LOAD8S
Definition: wasm.h:50
@ WASM_OP_I32GTS
Definition: wasm.h:80
@ WASM_OP_F32EQ
Definition: wasm.h:97
@ WASM_OP_F64REINTERPRETI64
Definition: wasm.h:203
@ WASM_OP_I64STORE
Definition: wasm.h:57
@ WASM_OP_I64LOAD32U
Definition: wasm.h:55
@ WASM_OP_I64SHL
Definition: wasm.h:142
@ WASM_OP_BLOCK
Definition: wasm.h:16
@ WASM_OP_F32REINTERPRETI32
Definition: wasm.h:202
@ WASM_OP_I64ROTR
Definition: wasm.h:146
@ WASM_OP_F32FLOOR
Definition: wasm.h:150
@ WASM_OP_TRAP
Definition: wasm.h:14
@ WASM_OP_I64ROTL
Definition: wasm.h:145
@ WASM_OP_F64FLOOR
Definition: wasm.h:164
@ WASM_OP_F64LOAD
Definition: wasm.h:45
@ WASM_OP_F64GT
Definition: wasm.h:106
@ WASM_OP_I32SUB
Definition: wasm.h:115
@ WASM_OP_BRIF
Definition: wasm.h:22
@ WASM_OP_F32MIN
Definition: wasm.h:158
@ WASM_OP_I32MUL
Definition: wasm.h:116
@ WASM_OP_SETGLOBAL
Definition: wasm.h:39
@ WASM_OP_I32LTS
Definition: wasm.h:78
@ WASM_OP_F32ADD
Definition: wasm.h:154
@ WASM_OP_I32LOAD16U
Definition: wasm.h:49
@ WASM_OP_F64SUB
Definition: wasm.h:169
@ WASM_OP_F32CONVERTUI32
Definition: wasm.h:189
@ WASM_OP_F32CONVERTSI32
Definition: wasm.h:188
@ WASM_OP_I64DIVS
Definition: wasm.h:135
@ WASM_OP_I32POPCNT
Definition: wasm.h:113
@ WASM_OP_I32EQ
Definition: wasm.h:76
@ WASM_OP_I32CONST
Definition: wasm.h:69
@ WASM_OP_I32GES
Definition: wasm.h:84
@ WASM_OP_ELSE
Definition: wasm.h:19
@ WASM_OP_F32CEIL
Definition: wasm.h:149
@ WASM_OP_F64CONVERTSI32
Definition: wasm.h:193
@ WASM_OP_I32GTU
Definition: wasm.h:81
@ WASM_OP_I64STORE16
Definition: wasm.h:63
@ WASM_OP_F64MUL
Definition: wasm.h:170
@ WASM_OP_I64REINTERPRETF64
Definition: wasm.h:201
@ WASM_OP_I64REMS
Definition: wasm.h:137
@ WASM_OP_I64LOAD16U
Definition: wasm.h:53
@ WASM_OP_F64STORE
Definition: wasm.h:59
@ WASM_OP_I64AND
Definition: wasm.h:139
@ WASM_OP_I32AND
Definition: wasm.h:121
@ WASM_OP_F32DIV
Definition: wasm.h:157
@ WASM_OP_CURRENTMEMORY
Definition: wasm.h:65
@ WASM_OP_F32DEMOTEF64
Definition: wasm.h:192
@ WASM_OP_I32LOAD8S
Definition: wasm.h:46
@ WASM_OP_I64EXTENDUI32
Definition: wasm.h:183
@ WASM_OP_F32TRUNC
Definition: wasm.h:151
@ WASM_OP_F32NEAREST
Definition: wasm.h:152
@ WASM_OP_I32EQZ
Definition: wasm.h:75
@ WASM_OP_END
Definition: wasm.h:20
@ WASM_OP_I64SUB
Definition: wasm.h:133
@ WASM_OP_I64SHRU
Definition: wasm.h:144
@ WASM_OP_I32LOAD8U
Definition: wasm.h:47
@ WASM_OP_GETLOCAL
Definition: wasm.h:35
@ WASM_OP_I64CONST
Definition: wasm.h:70
@ WASM_OP_CALLINDIRECT
Definition: wasm.h:28
@ WASM_OP_F64SQRT
Definition: wasm.h:167
@ WASM_OP_GETGLOBAL
Definition: wasm.h:38
@ WASM_OP_I64LOAD32S
Definition: wasm.h:54
@ WASM_OP_I32STORE8
Definition: wasm.h:60
@ WASM_OP_I32NE
Definition: wasm.h:77
@ WASM_OP_I32LEU
Definition: wasm.h:83
@ WASM_OP_I32TRUNCUF32
Definition: wasm.h:179
@ WASM_OP_F32LE
Definition: wasm.h:101
@ WASM_OP_I32ROTR
Definition: wasm.h:128
@ WASM_OP_I64SHRS
Definition: wasm.h:143
@ WASM_OP_I32TRUNCSF64
Definition: wasm.h:180
@ WASM_OP_F32GT
Definition: wasm.h:100
@ WASM_OP_F64CEIL
Definition: wasm.h:163
@ WASM_OP_I64NE
Definition: wasm.h:88
@ WASM_OP_F32CONVERTUI64
Definition: wasm.h:191
@ WASM_OP_I32CTZ
Definition: wasm.h:112
@ WASM_OP_I64GES
Definition: wasm.h:95
@ WASM_OP_I32ROTL
Definition: wasm.h:127
@ WASM_OP_I32LOAD
Definition: wasm.h:42
@ WASM_OP_NOP
Definition: wasm.h:15
@ WASM_OP_F64CONST
Definition: wasm.h:72
@ WASM_OP_F64LE
Definition: wasm.h:107
@ WASM_OP_I64GEU
Definition: wasm.h:96
@ WASM_OP_I64TRUNCUF32
Definition: wasm.h:185
@ WASM_OP_I32OR
Definition: wasm.h:122
@ WASM_OP_I32ADD
Definition: wasm.h:114
@ WASM_OP_I64TRUNCSF64
Definition: wasm.h:186
@ WASM_OP_F32CONST
Definition: wasm.h:71
@ WASM_OP_I32SHRS
Definition: wasm.h:125
@ WASM_OP_F64NEG
Definition: wasm.h:162
@ WASM_OP_F32SQRT
Definition: wasm.h:153
@ WASM_OP_I64MUL
Definition: wasm.h:134
@ WASM_OP_F32STORE
Definition: wasm.h:58
@ WASM_OP_F32GE
Definition: wasm.h:102
@ WASM_OP_I64REMU
Definition: wasm.h:138
@ WASM_OP_F32ABS
Definition: wasm.h:147
@ WASM_OP_F64NE
Definition: wasm.h:104
@ WASM_OP_F64PROMOTEF32
Definition: wasm.h:197
@ WASM_OP_I64STORE8
Definition: wasm.h:62
@ WASM_OP_I32REMS
Definition: wasm.h:119
@ WASM_OP_F64CONVERTSI64
Definition: wasm.h:195
@ WASM_OP_F64EQ
Definition: wasm.h:103
@ WASM_OP_I32CLZ
Definition: wasm.h:111
@ WASM_OP_I32XOR
Definition: wasm.h:123
@ WASM_OP_SETLOCAL
Definition: wasm.h:36
@ WASM_OP_F64ADD
Definition: wasm.h:168
@ WASM_OP_BRTABLE
Definition: wasm.h:23
@ WASM_OP_I32REINTERPRETF32
Definition: wasm.h:200
@ WASM_OP_F32MAX
Definition: wasm.h:159
@ WASM_OP_F64DIV
Definition: wasm.h:171
@ WASM_OP_F64LT
Definition: wasm.h:105
@ WASM_OP_I32STORE16
Definition: wasm.h:61
@ WASM_OP_BR
Definition: wasm.h:21
@ WASM_OP_I32STORE
Definition: wasm.h:56
@ WASM_OP_F32LT
Definition: wasm.h:99
@ WASM_OP_I64CTZ
Definition: wasm.h:130
@ WASM_OP_I64ADD
Definition: wasm.h:132
@ WASM_OP_I64LEU
Definition: wasm.h:94
@ WASM_OP_I32LTU
Definition: wasm.h:79
@ WASM_OP_I64POPCNT
Definition: wasm.h:131
@ WASM_OP_I64TRUNCSF32
Definition: wasm.h:184
@ WASM_OP_F32MUL
Definition: wasm.h:156
@ WASM_OP_I32DIVS
Definition: wasm.h:117
@ WASM_OP_I64STORE32
Definition: wasm.h:64
@ WASM_OP_F64ABS
Definition: wasm.h:161
@ WASM_OP_F32NE
Definition: wasm.h:98
@ WASM_OP_I32TRUNCSF32
Definition: wasm.h:178
@ WASM_OP_F64MAX
Definition: wasm.h:173
@ WASM_OP_I64GTS
Definition: wasm.h:91
@ WASM_OP_I64TRUNCUF64
Definition: wasm.h:187
@ WASM_OP_I32LES
Definition: wasm.h:82
@ WASM_OP_F64GE
Definition: wasm.h:108
@ WASM_OP_I32DIVU
Definition: wasm.h:118
@ WASM_OP_F64MIN
Definition: wasm.h:172
@ WASM_OP_I32GEU
Definition: wasm.h:85
@ WASM_OP_I32SHRU
Definition: wasm.h:126
@ WASM_OP_F64NEAREST
Definition: wasm.h:166
@ WASM_OP_I64LOAD16S
Definition: wasm.h:52
@ WASM_OP_I64OR
Definition: wasm.h:140
@ WASM_OP_I64EXTENDSI32
Definition: wasm.h:182
@ WASM_OP_I64LTU
Definition: wasm.h:90
@ WASM_OP_DROP
Definition: wasm.h:31
@ WASM_OP_I64XOR
Definition: wasm.h:141
@ WASM_OP_I32WRAPI64
Definition: wasm.h:177
@ WASM_OP_TEELOCAL
Definition: wasm.h:37
@ WASM_OP_F32COPYSIGN
Definition: wasm.h:160
@ WASM_OP_I64EQZ
Definition: wasm.h:86
@ WASM_OP_F32CONVERTSI64
Definition: wasm.h:190
@ WASM_OP_I64LOAD8U
Definition: wasm.h:51
@ WASM_OP_I64CLZ
Definition: wasm.h:129
@ WASM_OP_F64TRUNC
Definition: wasm.h:165
@ WASM_OP_F64COPYSIGN
Definition: wasm.h:174
@ WASM_OP_IF
Definition: wasm.h:18
@ WASM_OP_F64CONVERTUI64
Definition: wasm.h:196
@ WASM_OP_I32SHL
Definition: wasm.h:124
@ WASM_OP_RETURN
Definition: wasm.h:24

◆ WasmOpSimdCodes

Enumerator
WASM_OP_V128LOAD 
WASM_OP_I16X8LOAD8X8S 
WASM_OP_I16X8LOAD8X8U 
WASM_OP_I32X4LOAD16X4S 
WASM_OP_I32X4LOAD16X4U 
WASM_OP_I64X2LOAD32X2S 
WASM_OP_I64X2LOAD32X2U 
WASM_OP_V8X16LOADSPLAT 
WASM_OP_V16X8LOADSPLAT 
WASM_OP_V32X4LOADSPLAT 
WASM_OP_V64X2LOADSPLAT 
WASM_OP_V128STORE 
WASM_OP_V128CONST 
WASM_OP_V8X16SHUFFLE 
WASM_OP_V8X16SWIZZLE 
WASM_OP_I8X16SPLAT 
WASM_OP_I16X8SPLAT 
WASM_OP_I32X4SPLAT 
WASM_OP_I64X2SPLAT 
WASM_OP_F32X4SPLAT 
WASM_OP_F64X2SPLAT 
WASM_OP_I8X16EXTRACTLANES 
WASM_OP_I8X16EXTRACTLANEU 
WASM_OP_I8X16REPLACELANE 
WASM_OP_I16X8EXTRACTLANES 
WASM_OP_I16X8EXTRACTLANEU 
WASM_OP_I16X8REPLACELANE 
WASM_OP_I32X4EXTRACTLANE 
WASM_OP_I32X4REPLACELANE 
WASM_OP_I64X2EXTRACTLANE 
WASM_OP_I64X2REPLACELANE 
WASM_OP_F32X4EXTRACTLANE 
WASM_OP_F32X4REPLACELANE 
WASM_OP_F64X2EXTRACTLANE 
WASM_OP_F64X2REPLACELANE 
WASM_OP_I8X16EQ 
WASM_OP_I8X16NE 
WASM_OP_I8X16LTS 
WASM_OP_I8X16LTU 
WASM_OP_I8X16GTS 
WASM_OP_I8X16GTU 
WASM_OP_I8X16LES 
WASM_OP_I8X16LEU 
WASM_OP_I8X16GES 
WASM_OP_I8X16GEU 
WASM_OP_I16X8EQ 
WASM_OP_I16X8NE 
WASM_OP_I16X8LTS 
WASM_OP_I16X8LTU 
WASM_OP_I16X8GTS 
WASM_OP_I16X8GTU 
WASM_OP_I16X8LES 
WASM_OP_I16X8LEU 
WASM_OP_I16X8GES 
WASM_OP_I16X8GEU 
WASM_OP_I32X4EQ 
WASM_OP_I32X4NE 
WASM_OP_I32X4LTS 
WASM_OP_I32X4LTU 
WASM_OP_I32X4GTS 
WASM_OP_I32X4GTU 
WASM_OP_I32X4LES 
WASM_OP_I32X4LEU 
WASM_OP_I32X4GES 
WASM_OP_I32X4GEU 
WASM_OP_F32X4EQ 
WASM_OP_F32X4NE 
WASM_OP_F32X4LT 
WASM_OP_F32X4GT 
WASM_OP_F32X4LE 
WASM_OP_F32X4GE 
WASM_OP_F64X2EQ 
WASM_OP_F64X2NE 
WASM_OP_F64X2LT 
WASM_OP_F64X2GT 
WASM_OP_F64X2LE 
WASM_OP_F64X2GE 
WASM_OP_V128NOT 
WASM_OP_V128AND 
WASM_OP_V128ANDNOT 
WASM_OP_V128OR 
WASM_OP_V128XOR 
WASM_OP_V128BITSELECT 
WASM_OP_I8X16ABS 
WASM_OP_I8X16NEG 
WASM_OP_I8X16ANYTRUE 
WASM_OP_I8X16ALLTRUE 
WASM_OP_I8X16NARROWI16X8S 
WASM_OP_I8X16NARROWI16X8U 
WASM_OP_I8X16SHL 
WASM_OP_I8X16SHRS 
WASM_OP_I8X16SHRU 
WASM_OP_I8X16ADD 
WASM_OP_I8X16ADDSATURATES 
WASM_OP_I8X16ADDSATURATEU 
WASM_OP_I8X16SUB 
WASM_OP_I8X16SUBSATURATES 
WASM_OP_I8X16SUBSATURATEU 
WASM_OP_I8X16MINS 
WASM_OP_I8X16MINU 
WASM_OP_I8X16MAXS 
WASM_OP_I8X16MAXU 
WASM_OP_I8X16AVGRU 
WASM_OP_I16X8ABS 
WASM_OP_I16X8NEG 
WASM_OP_I16X8ANYTRUE 
WASM_OP_I16X8ALLTRUE 
WASM_OP_I16X8NARROWI32X4S 
WASM_OP_I16X8NARROWI32X4U 
WASM_OP_I16X8WIDENLOWI8X16S 
WASM_OP_I16X8WIDENHIGHI8X16S 
WASM_OP_I16X8WIDENLOWI8X16U 
WASM_OP_I16X8WIDENHIGHI8X16U 
WASM_OP_I16X8SHL 
WASM_OP_I16X8SHRS 
WASM_OP_I16X8SHRU 
WASM_OP_I16X8ADD 
WASM_OP_I16X8ADDSATURATES 
WASM_OP_I16X8ADDSATURATEU 
WASM_OP_I16X8SUB 
WASM_OP_I16X8SUBSATURATES 
WASM_OP_I16X8SUBSATURATEU 
WASM_OP_I16X8MUL 
WASM_OP_I16X8MINS 
WASM_OP_I16X8MINU 
WASM_OP_I16X8MAXS 
WASM_OP_I16X8MAXU 
WASM_OP_I16X8AVGRU 
WASM_OP_I32X4ABS 
WASM_OP_I32X4NEG 
WASM_OP_I32X4ANYTRUE 
WASM_OP_I32X4ALLTRUE 
WASM_OP_I32X4WIDENLOWI16X8S 
WASM_OP_I32X4WIDENHIGHI16X8S 
WASM_OP_I32X4WIDENLOWI16X8U 
WASM_OP_I32X4WIDENHIGHI16X8U 
WASM_OP_I32X4SHL 
WASM_OP_I32X4SHRS 
WASM_OP_I32X4SHRU 
WASM_OP_I32X4ADD 
WASM_OP_I32X4SUB 
WASM_OP_I32X4MUL 
WASM_OP_I32X4MINS 
WASM_OP_I32X4MINU 
WASM_OP_I32X4MAXS 
WASM_OP_I32X4MAXU 
WASM_OP_I64X2NEG 
WASM_OP_I64X2SHL 
WASM_OP_I64X2SHRS 
WASM_OP_I64X2SHRU 
WASM_OP_I64X2ADD 
WASM_OP_I64X2SUB 
WASM_OP_I64X2MUL 
WASM_OP_F32X4ABS 
WASM_OP_F32X4NEG 
WASM_OP_F32X4SQRT 
WASM_OP_F32X4ADD 
WASM_OP_F32X4SUB 
WASM_OP_F32X4MUL 
WASM_OP_F32X4DIV 
WASM_OP_F32X4MIN 
WASM_OP_F32X4MAX 
WASM_OP_F64X2ABS 
WASM_OP_F64X2NEG 
WASM_OP_F64X2SQRT 
WASM_OP_F64X2ADD 
WASM_OP_F64X2SUB 
WASM_OP_F64X2MUL 
WASM_OP_F64X2DIV 
WASM_OP_F64X2MIN 
WASM_OP_F64X2MAX 
WASM_OP_I32X4TRUNCSATF32X4S 
WASM_OP_I32X4TRUNCSATF32X4U 
WASM_OP_F32X4CONVERTI32X4S 
WASM_OP_F32X4CONVERTI32X4U 

Definition at line 291 of file wasm.h.

291  {
292  // load ops
293  WASM_OP_V128LOAD = 0x00,
294  WASM_OP_I16X8LOAD8X8S = 0x01,
295  WASM_OP_I16X8LOAD8X8U = 0x02,
296  WASM_OP_I32X4LOAD16X4S = 0x03,
297  WASM_OP_I32X4LOAD16X4U = 0x04,
298  WASM_OP_I64X2LOAD32X2S = 0x05,
299  WASM_OP_I64X2LOAD32X2U = 0x06,
300  WASM_OP_V8X16LOADSPLAT = 0x07,
301  WASM_OP_V16X8LOADSPLAT = 0x08,
302  WASM_OP_V32X4LOADSPLAT = 0x09,
303  WASM_OP_V64X2LOADSPLAT = 0x0a,
304  WASM_OP_V128STORE = 0x0b,
305  WASM_OP_V128CONST = 0x0c,
306 
307  // lane ops
308  WASM_OP_V8X16SHUFFLE = 0x0d,
309  WASM_OP_V8X16SWIZZLE = 0x0e,
310  WASM_OP_I8X16SPLAT = 0x0f,
311  WASM_OP_I16X8SPLAT = 0x10,
312  WASM_OP_I32X4SPLAT = 0x11,
313  WASM_OP_I64X2SPLAT = 0x12,
314  WASM_OP_F32X4SPLAT = 0x13,
315  WASM_OP_F64X2SPLAT = 0x14,
330 
331  // cmp ops
332  WASM_OP_I8X16EQ = 0x23,
333  WASM_OP_I8X16NE = 0x24,
334  WASM_OP_I8X16LTS = 0x25,
335  WASM_OP_I8X16LTU = 0x26,
336  WASM_OP_I8X16GTS = 0x27,
337  WASM_OP_I8X16GTU = 0x28,
338  WASM_OP_I8X16LES = 0x29,
339  WASM_OP_I8X16LEU = 0x2a,
340  WASM_OP_I8X16GES = 0x2b,
341  WASM_OP_I8X16GEU = 0x2c,
342  WASM_OP_I16X8EQ = 0x2d,
343  WASM_OP_I16X8NE = 0x2e,
344  WASM_OP_I16X8LTS = 0x2f,
345  WASM_OP_I16X8LTU = 0x30,
346  WASM_OP_I16X8GTS = 0x31,
347  WASM_OP_I16X8GTU = 0x32,
348  WASM_OP_I16X8LES = 0x33,
349  WASM_OP_I16X8LEU = 0x34,
350  WASM_OP_I16X8GES = 0x35,
351  WASM_OP_I16X8GEU = 0x36,
352  WASM_OP_I32X4EQ = 0x37,
353  WASM_OP_I32X4NE = 0x38,
354  WASM_OP_I32X4LTS = 0x39,
355  WASM_OP_I32X4LTU = 0x3a,
356  WASM_OP_I32X4GTS = 0x3b,
357  WASM_OP_I32X4GTU = 0x3c,
358  WASM_OP_I32X4LES = 0x3d,
359  WASM_OP_I32X4LEU = 0x3e,
360  WASM_OP_I32X4GES = 0x3f,
361  WASM_OP_I32X4GEU = 0x40,
362  WASM_OP_F32X4EQ = 0x41,
363  WASM_OP_F32X4NE = 0x42,
364  WASM_OP_F32X4LT = 0x43,
365  WASM_OP_F32X4GT = 0x44,
366  WASM_OP_F32X4LE = 0x45,
367  WASM_OP_F32X4GE = 0x46,
368  WASM_OP_F64X2EQ = 0x47,
369  WASM_OP_F64X2NE = 0x48,
370  WASM_OP_F64X2LT = 0x49,
371  WASM_OP_F64X2GT = 0x4a,
372  WASM_OP_F64X2LE = 0x4b,
373  WASM_OP_F64X2GE = 0x4c,
374 
375  // bitwise
376  WASM_OP_V128NOT = 0x4d,
377  WASM_OP_V128AND = 0x4e,
378  WASM_OP_V128ANDNOT = 0x4f,
379  WASM_OP_V128OR = 0x50,
380  WASM_OP_V128XOR = 0x51,
381  WASM_OP_V128BITSELECT = 0x52,
382 
383  // arithmetic
384  WASM_OP_I8X16ABS = 0x60,
385  WASM_OP_I8X16NEG = 0x61,
386  WASM_OP_I8X16ANYTRUE = 0x62,
387  WASM_OP_I8X16ALLTRUE = 0x63,
390  WASM_OP_I8X16SHL = 0x6b,
391  WASM_OP_I8X16SHRS = 0x6c,
392  WASM_OP_I8X16SHRU = 0x6d,
393  WASM_OP_I8X16ADD = 0x6e,
396  WASM_OP_I8X16SUB = 0x71,
399  WASM_OP_I8X16MINS = 0x76,
400  WASM_OP_I8X16MINU = 0x77,
401  WASM_OP_I8X16MAXS = 0x78,
402  WASM_OP_I8X16MAXU = 0x79,
403  WASM_OP_I8X16AVGRU = 0x7b,
404  WASM_OP_I16X8ABS = 0x80,
405  WASM_OP_I16X8NEG = 0x81,
406  WASM_OP_I16X8ANYTRUE = 0x82,
407  WASM_OP_I16X8ALLTRUE = 0x83,
414  WASM_OP_I16X8SHL = 0x8b,
415  WASM_OP_I16X8SHRS = 0x8c,
416  WASM_OP_I16X8SHRU = 0x8d,
417  WASM_OP_I16X8ADD = 0x8e,
420  WASM_OP_I16X8SUB = 0x91,
423  WASM_OP_I16X8MUL = 0x95,
424  WASM_OP_I16X8MINS = 0x96,
425  WASM_OP_I16X8MINU = 0x97,
426  WASM_OP_I16X8MAXS = 0x98,
427  WASM_OP_I16X8MAXU = 0x99,
428  WASM_OP_I16X8AVGRU = 0x9b,
429  WASM_OP_I32X4ABS = 0xa0,
430  WASM_OP_I32X4NEG = 0xa1,
431  WASM_OP_I32X4ANYTRUE = 0xa2,
432  WASM_OP_I32X4ALLTRUE = 0xa3,
437  WASM_OP_I32X4SHL = 0xab,
438  WASM_OP_I32X4SHRS = 0xac,
439  WASM_OP_I32X4SHRU = 0xad,
440  WASM_OP_I32X4ADD = 0xae,
441  WASM_OP_I32X4SUB = 0xb1,
442  WASM_OP_I32X4MUL = 0xb5,
443  WASM_OP_I32X4MINS = 0xb6,
444  WASM_OP_I32X4MINU = 0xb7,
445  WASM_OP_I32X4MAXS = 0xb8,
446  WASM_OP_I32X4MAXU = 0xb9,
447  WASM_OP_I64X2NEG = 0xc1,
448  WASM_OP_I64X2SHL = 0xcb,
449  WASM_OP_I64X2SHRS = 0xcc,
450  WASM_OP_I64X2SHRU = 0xcd,
451  WASM_OP_I64X2ADD = 0xce,
452  WASM_OP_I64X2SUB = 0xd1,
453  WASM_OP_I64X2MUL = 0xd5,
454  WASM_OP_F32X4ABS = 0xe0,
455  WASM_OP_F32X4NEG = 0xe1,
456  WASM_OP_F32X4SQRT = 0xe3,
457  WASM_OP_F32X4ADD = 0xe4,
458  WASM_OP_F32X4SUB = 0xe5,
459  WASM_OP_F32X4MUL = 0xe6,
460  WASM_OP_F32X4DIV = 0xe7,
461  WASM_OP_F32X4MIN = 0xe8,
462  WASM_OP_F32X4MAX = 0xe9,
463  WASM_OP_F64X2ABS = 0xec,
464  WASM_OP_F64X2NEG = 0xed,
465  WASM_OP_F64X2SQRT = 0xef,
466  WASM_OP_F64X2ADD = 0xf0,
467  WASM_OP_F64X2SUB = 0xf1,
468  WASM_OP_F64X2MUL = 0xf2,
469  WASM_OP_F64X2DIV = 0xf3,
470  WASM_OP_F64X2MIN = 0xf4,
471  WASM_OP_F64X2MAX = 0xf5,
472 
473  // conversion
WasmOpSimdCodes
Definition: wasm.h:291
@ WASM_OP_I16X8ADDSATURATEU
Definition: wasm.h:419
@ WASM_OP_I8X16SUBSATURATEU
Definition: wasm.h:398
@ WASM_OP_F64X2SPLAT
Definition: wasm.h:315
@ WASM_OP_I32X4MAXS
Definition: wasm.h:445
@ WASM_OP_I32X4WIDENLOWI16X8U
Definition: wasm.h:435
@ WASM_OP_I16X8GTU
Definition: wasm.h:347
@ WASM_OP_I32X4MINU
Definition: wasm.h:444
@ WASM_OP_I32X4ADD
Definition: wasm.h:440
@ WASM_OP_I16X8SHL
Definition: wasm.h:414
@ WASM_OP_I32X4SHRU
Definition: wasm.h:439
@ WASM_OP_I64X2NEG
Definition: wasm.h:447
@ WASM_OP_V128BITSELECT
Definition: wasm.h:381
@ WASM_OP_F32X4SPLAT
Definition: wasm.h:314
@ WASM_OP_I8X16LTU
Definition: wasm.h:335
@ WASM_OP_F32X4GT
Definition: wasm.h:365
@ WASM_OP_I16X8NARROWI32X4U
Definition: wasm.h:409
@ WASM_OP_F64X2NE
Definition: wasm.h:369
@ WASM_OP_I8X16SPLAT
Definition: wasm.h:310
@ WASM_OP_I32X4MINS
Definition: wasm.h:443
@ WASM_OP_V128STORE
Definition: wasm.h:304
@ WASM_OP_F32X4MUL
Definition: wasm.h:459
@ WASM_OP_I8X16GEU
Definition: wasm.h:341
@ WASM_OP_I32X4SUB
Definition: wasm.h:441
@ WASM_OP_I16X8LOAD8X8U
Definition: wasm.h:295
@ WASM_OP_F32X4ADD
Definition: wasm.h:457
@ WASM_OP_F64X2MUL
Definition: wasm.h:468
@ WASM_OP_V32X4LOADSPLAT
Definition: wasm.h:302
@ WASM_OP_V128AND
Definition: wasm.h:377
@ WASM_OP_I8X16EXTRACTLANES
Definition: wasm.h:316
@ WASM_OP_I64X2EXTRACTLANE
Definition: wasm.h:324
@ WASM_OP_I8X16ANYTRUE
Definition: wasm.h:386
@ WASM_OP_I16X8SUB
Definition: wasm.h:420
@ WASM_OP_I32X4ALLTRUE
Definition: wasm.h:432
@ WASM_OP_F64X2NEG
Definition: wasm.h:464
@ WASM_OP_I32X4GEU
Definition: wasm.h:361
@ WASM_OP_I64X2SHRS
Definition: wasm.h:449
@ WASM_OP_F32X4ABS
Definition: wasm.h:454
@ WASM_OP_I8X16SHL
Definition: wasm.h:390
@ WASM_OP_F32X4CONVERTI32X4U
Definition: wasm.h:477
@ WASM_OP_F64X2REPLACELANE
Definition: wasm.h:329
@ WASM_OP_I8X16EXTRACTLANEU
Definition: wasm.h:317
@ WASM_OP_I16X8ABS
Definition: wasm.h:404
@ WASM_OP_F64X2SQRT
Definition: wasm.h:465
@ WASM_OP_V16X8LOADSPLAT
Definition: wasm.h:301
@ WASM_OP_V128CONST
Definition: wasm.h:305
@ WASM_OP_F32X4NE
Definition: wasm.h:363
@ WASM_OP_V8X16LOADSPLAT
Definition: wasm.h:300
@ WASM_OP_F64X2MAX
Definition: wasm.h:471
@ WASM_OP_I32X4ABS
Definition: wasm.h:429
@ WASM_OP_I8X16LTS
Definition: wasm.h:334
@ WASM_OP_I8X16AVGRU
Definition: wasm.h:403
@ WASM_OP_I16X8ANYTRUE
Definition: wasm.h:406
@ WASM_OP_F32X4DIV
Definition: wasm.h:460
@ WASM_OP_I32X4LTU
Definition: wasm.h:355
@ WASM_OP_V8X16SHUFFLE
Definition: wasm.h:308
@ WASM_OP_F32X4MAX
Definition: wasm.h:462
@ WASM_OP_I16X8WIDENLOWI8X16S
Definition: wasm.h:410
@ WASM_OP_I8X16NEG
Definition: wasm.h:385
@ WASM_OP_I16X8AVGRU
Definition: wasm.h:428
@ WASM_OP_I32X4ANYTRUE
Definition: wasm.h:431
@ WASM_OP_F32X4CONVERTI32X4S
Definition: wasm.h:476
@ WASM_OP_I64X2SHL
Definition: wasm.h:448
@ WASM_OP_I32X4TRUNCSATF32X4S
Definition: wasm.h:474
@ WASM_OP_I8X16GES
Definition: wasm.h:340
@ WASM_OP_V128LOAD
Definition: wasm.h:293
@ WASM_OP_I8X16EQ
Definition: wasm.h:332
@ WASM_OP_V128NOT
Definition: wasm.h:376
@ WASM_OP_I16X8EXTRACTLANEU
Definition: wasm.h:320
@ WASM_OP_I16X8MAXU
Definition: wasm.h:427
@ WASM_OP_I64X2REPLACELANE
Definition: wasm.h:325
@ WASM_OP_I32X4MAXU
Definition: wasm.h:446
@ WASM_OP_F32X4SQRT
Definition: wasm.h:456
@ WASM_OP_I32X4SHL
Definition: wasm.h:437
@ WASM_OP_F64X2ABS
Definition: wasm.h:463
@ WASM_OP_I32X4SHRS
Definition: wasm.h:438
@ WASM_OP_F32X4SUB
Definition: wasm.h:458
@ WASM_OP_F32X4EQ
Definition: wasm.h:362
@ WASM_OP_I16X8MINS
Definition: wasm.h:424
@ WASM_OP_I16X8ALLTRUE
Definition: wasm.h:407
@ WASM_OP_I64X2LOAD32X2U
Definition: wasm.h:299
@ WASM_OP_I8X16NARROWI16X8S
Definition: wasm.h:388
@ WASM_OP_F64X2LT
Definition: wasm.h:370
@ WASM_OP_I64X2SUB
Definition: wasm.h:452
@ WASM_OP_I64X2LOAD32X2S
Definition: wasm.h:298
@ WASM_OP_I8X16ADD
Definition: wasm.h:393
@ WASM_OP_I8X16ADDSATURATES
Definition: wasm.h:394
@ WASM_OP_I32X4TRUNCSATF32X4U
Definition: wasm.h:475
@ WASM_OP_F32X4REPLACELANE
Definition: wasm.h:327
@ WASM_OP_I16X8SPLAT
Definition: wasm.h:311
@ WASM_OP_I8X16NARROWI16X8U
Definition: wasm.h:389
@ WASM_OP_I16X8ADD
Definition: wasm.h:417
@ WASM_OP_I32X4WIDENHIGHI16X8U
Definition: wasm.h:436
@ WASM_OP_F64X2MIN
Definition: wasm.h:470
@ WASM_OP_I16X8SHRU
Definition: wasm.h:416
@ WASM_OP_I64X2SHRU
Definition: wasm.h:450
@ WASM_OP_F64X2LE
Definition: wasm.h:372
@ WASM_OP_F64X2SUB
Definition: wasm.h:467
@ WASM_OP_I32X4LTS
Definition: wasm.h:354
@ WASM_OP_I32X4REPLACELANE
Definition: wasm.h:323
@ WASM_OP_I32X4MUL
Definition: wasm.h:442
@ WASM_OP_I32X4NEG
Definition: wasm.h:430
@ WASM_OP_I16X8SUBSATURATEU
Definition: wasm.h:422
@ WASM_OP_I16X8EXTRACTLANES
Definition: wasm.h:319
@ WASM_OP_I8X16SHRU
Definition: wasm.h:392
@ WASM_OP_I8X16ADDSATURATEU
Definition: wasm.h:395
@ WASM_OP_F32X4NEG
Definition: wasm.h:455
@ WASM_OP_I32X4GTU
Definition: wasm.h:357
@ WASM_OP_F64X2DIV
Definition: wasm.h:469
@ WASM_OP_I16X8LEU
Definition: wasm.h:349
@ WASM_OP_I32X4GES
Definition: wasm.h:360
@ WASM_OP_V128XOR
Definition: wasm.h:380
@ WASM_OP_I16X8GEU
Definition: wasm.h:351
@ WASM_OP_I8X16SUBSATURATES
Definition: wasm.h:397
@ WASM_OP_I16X8NEG
Definition: wasm.h:405
@ WASM_OP_I16X8MINU
Definition: wasm.h:425
@ WASM_OP_I32X4LOAD16X4U
Definition: wasm.h:297
@ WASM_OP_V64X2LOADSPLAT
Definition: wasm.h:303
@ WASM_OP_I32X4LOAD16X4S
Definition: wasm.h:296
@ WASM_OP_I16X8GES
Definition: wasm.h:350
@ WASM_OP_I16X8LTU
Definition: wasm.h:345
@ WASM_OP_I8X16ALLTRUE
Definition: wasm.h:387
@ WASM_OP_I64X2ADD
Definition: wasm.h:451
@ WASM_OP_I16X8WIDENHIGHI8X16S
Definition: wasm.h:411
@ WASM_OP_I8X16GTS
Definition: wasm.h:336
@ WASM_OP_I8X16REPLACELANE
Definition: wasm.h:318
@ WASM_OP_I32X4EQ
Definition: wasm.h:352
@ WASM_OP_I16X8LES
Definition: wasm.h:348
@ WASM_OP_I16X8LOAD8X8S
Definition: wasm.h:294
@ WASM_OP_V8X16SWIZZLE
Definition: wasm.h:309
@ WASM_OP_I32X4WIDENLOWI16X8S
Definition: wasm.h:433
@ WASM_OP_I16X8GTS
Definition: wasm.h:346
@ WASM_OP_I32X4SPLAT
Definition: wasm.h:312
@ WASM_OP_I16X8MAXS
Definition: wasm.h:426
@ WASM_OP_F64X2GE
Definition: wasm.h:373
@ WASM_OP_I16X8WIDENLOWI8X16U
Definition: wasm.h:412
@ WASM_OP_I16X8ADDSATURATES
Definition: wasm.h:418
@ WASM_OP_I8X16NE
Definition: wasm.h:333
@ WASM_OP_I64X2SPLAT
Definition: wasm.h:313
@ WASM_OP_I8X16LEU
Definition: wasm.h:339
@ WASM_OP_F32X4GE
Definition: wasm.h:367
@ WASM_OP_I8X16SHRS
Definition: wasm.h:391
@ WASM_OP_I32X4GTS
Definition: wasm.h:356
@ WASM_OP_V128ANDNOT
Definition: wasm.h:378
@ WASM_OP_I32X4WIDENHIGHI16X8S
Definition: wasm.h:434
@ WASM_OP_I16X8SUBSATURATES
Definition: wasm.h:421
@ WASM_OP_I8X16LES
Definition: wasm.h:338
@ WASM_OP_F64X2EQ
Definition: wasm.h:368
@ WASM_OP_V128OR
Definition: wasm.h:379
@ WASM_OP_F32X4LE
Definition: wasm.h:366
@ WASM_OP_I32X4LEU
Definition: wasm.h:359
@ WASM_OP_I8X16GTU
Definition: wasm.h:337
@ WASM_OP_F64X2GT
Definition: wasm.h:371
@ WASM_OP_F32X4MIN
Definition: wasm.h:461
@ WASM_OP_I16X8WIDENHIGHI8X16U
Definition: wasm.h:413
@ WASM_OP_F64X2EXTRACTLANE
Definition: wasm.h:328
@ WASM_OP_F32X4EXTRACTLANE
Definition: wasm.h:326
@ WASM_OP_I8X16MAXS
Definition: wasm.h:401
@ WASM_OP_I32X4LES
Definition: wasm.h:358
@ WASM_OP_I8X16MINU
Definition: wasm.h:400
@ WASM_OP_I8X16MINS
Definition: wasm.h:399
@ WASM_OP_I16X8LTS
Definition: wasm.h:344
@ WASM_OP_F64X2ADD
Definition: wasm.h:466
@ WASM_OP_I32X4NE
Definition: wasm.h:353
@ WASM_OP_I16X8MUL
Definition: wasm.h:423
@ WASM_OP_I32X4EXTRACTLANE
Definition: wasm.h:322
@ WASM_OP_F32X4LT
Definition: wasm.h:364
@ WASM_OP_I8X16MAXU
Definition: wasm.h:402
@ WASM_OP_I16X8REPLACELANE
Definition: wasm.h:321
@ WASM_OP_I8X16ABS
Definition: wasm.h:384
@ WASM_OP_I64X2MUL
Definition: wasm.h:453
@ WASM_OP_I8X16SUB
Definition: wasm.h:396
@ WASM_OP_I16X8EQ
Definition: wasm.h:342
@ WASM_OP_I16X8SHRS
Definition: wasm.h:415
@ WASM_OP_I16X8NE
Definition: wasm.h:343
@ WASM_OP_I16X8NARROWI32X4S
Definition: wasm.h:408

◆ WasmTypeOp

enum WasmTypeOp
Enumerator
WASM_TYPE_OP_CORE 
WASM_TYPE_OP_ATOMIC 
WASM_TYPE_OP_SIMD 

Definition at line 480 of file wasm.h.

480  {
484 } WasmTypeOp;
WasmTypeOp
Definition: wasm.h:480
@ WASM_TYPE_OP_ATOMIC
Definition: wasm.h:482
@ WASM_TYPE_OP_SIMD
Definition: wasm.h:483
@ WASM_TYPE_OP_CORE
Definition: wasm.h:481

Function Documentation

◆ wasm_asm()

RZ_IPI int wasm_asm ( const char *  str,
unsigned char *  buf,
int  buf_len 
)

Referenced by assemble().

◆ wasm_dis()

RZ_IPI int wasm_dis ( WasmOp op,
const unsigned char *  buf,
int  buf_len 
)

Definition at line 479 of file wasm.c.

479  {
480  RzStrBuf *sb = rz_strbuf_new("");
481  int id = buf[0];
482  if (id < 0xc0) {
483  op->type = WASM_TYPE_OP_CORE;
484  op->op.core = id;
485  op->len = 1;
486  WasmOpDef *opdef = &opcodes[id];
487  switch (id) {
488  case WASM_OP_TRAP:
489  case WASM_OP_NOP:
490  case WASM_OP_ELSE:
491  case WASM_OP_RETURN:
492  case WASM_OP_DROP:
493  case WASM_OP_SELECT:
494  case WASM_OP_I32EQZ:
495  case WASM_OP_I32EQ:
496  case WASM_OP_I32NE:
497  case WASM_OP_I32LTS:
498  case WASM_OP_I32LTU:
499  case WASM_OP_I32GTS:
500  case WASM_OP_I32GTU:
501  case WASM_OP_I32LES:
502  case WASM_OP_I32LEU:
503  case WASM_OP_I32GES:
504  case WASM_OP_I32GEU:
505  case WASM_OP_I64EQZ:
506  case WASM_OP_I64EQ:
507  case WASM_OP_I64NE:
508  case WASM_OP_I64LTS:
509  case WASM_OP_I64LTU:
510  case WASM_OP_I64GTS:
511  case WASM_OP_I64GTU:
512  case WASM_OP_I64LES:
513  case WASM_OP_I64LEU:
514  case WASM_OP_I64GES:
515  case WASM_OP_I64GEU:
516  case WASM_OP_F32EQ:
517  case WASM_OP_F32NE:
518  case WASM_OP_F32LT:
519  case WASM_OP_F32GT:
520  case WASM_OP_F32LE:
521  case WASM_OP_F32GE:
522  case WASM_OP_F64EQ:
523  case WASM_OP_F64NE:
524  case WASM_OP_F64LT:
525  case WASM_OP_F64GT:
526  case WASM_OP_F64LE:
527  case WASM_OP_F64GE:
528  case WASM_OP_I32CLZ:
529  case WASM_OP_I32CTZ:
530  case WASM_OP_I32POPCNT:
531  case WASM_OP_I32ADD:
532  case WASM_OP_I32SUB:
533  case WASM_OP_I32MUL:
534  case WASM_OP_I32DIVS:
535  case WASM_OP_I32DIVU:
536  case WASM_OP_I32REMS:
537  case WASM_OP_I32REMU:
538  case WASM_OP_I32AND:
539  case WASM_OP_I32OR:
540  case WASM_OP_I32XOR:
541  case WASM_OP_I32SHL:
542  case WASM_OP_I32SHRS:
543  case WASM_OP_I32SHRU:
544  case WASM_OP_I32ROTL:
545  case WASM_OP_I32ROTR:
546  case WASM_OP_I64CLZ:
547  case WASM_OP_I64CTZ:
548  case WASM_OP_I64POPCNT:
549  case WASM_OP_I64ADD:
550  case WASM_OP_I64SUB:
551  case WASM_OP_I64MUL:
552  case WASM_OP_I64DIVS:
553  case WASM_OP_I64DIVU:
554  case WASM_OP_I64REMS:
555  case WASM_OP_I64REMU:
556  case WASM_OP_I64AND:
557  case WASM_OP_I64OR:
558  case WASM_OP_I64XOR:
559  case WASM_OP_I64SHL:
560  case WASM_OP_I64SHRS:
561  case WASM_OP_I64SHRU:
562  case WASM_OP_I64ROTL:
563  case WASM_OP_I64ROTR:
564  case WASM_OP_F32ABS:
565  case WASM_OP_F32NEG:
566  case WASM_OP_F32CEIL:
567  case WASM_OP_F32FLOOR:
568  case WASM_OP_F32TRUNC:
569  case WASM_OP_F32NEAREST:
570  case WASM_OP_F32SQRT:
571  case WASM_OP_F32ADD:
572  case WASM_OP_F32SUB:
573  case WASM_OP_F32MUL:
574  case WASM_OP_F32DIV:
575  case WASM_OP_F32MIN:
576  case WASM_OP_F32MAX:
577  case WASM_OP_F32COPYSIGN:
578  case WASM_OP_F64ABS:
579  case WASM_OP_F64NEG:
580  case WASM_OP_F64CEIL:
581  case WASM_OP_F64FLOOR:
582  case WASM_OP_F64TRUNC:
583  case WASM_OP_F64NEAREST:
584  case WASM_OP_F64SQRT:
585  case WASM_OP_F64ADD:
586  case WASM_OP_F64SUB:
587  case WASM_OP_F64MUL:
588  case WASM_OP_F64DIV:
589  case WASM_OP_F64MIN:
590  case WASM_OP_F64MAX:
591  case WASM_OP_F64COPYSIGN:
592  case WASM_OP_I32WRAPI64:
617  case WASM_OP_END: {
618  rz_strbuf_set(sb, opdef->txt);
619  } break;
620  case WASM_OP_BLOCK:
621  case WASM_OP_LOOP:
622  case WASM_OP_IF: {
623  st32 val = 0;
624  size_t n = read_i32_leb128(buf + 1, buf + buf_len, &val);
625  if (!(n > 0 && n < buf_len)) {
626  goto err;
627  }
628  switch (0x80 - val) {
630  rz_strbuf_set(sb, opdef->txt);
631  break;
633  rz_strbuf_setf(sb, "%s (result i32)", opdef->txt);
634  break;
636  rz_strbuf_setf(sb, "%s (result i64)", opdef->txt);
637  break;
639  rz_strbuf_setf(sb, "%s (result f32)", opdef->txt);
640  break;
642  rz_strbuf_setf(sb, "%s (result f64)", opdef->txt);
643  break;
645  rz_strbuf_setf(sb, "%s (result v128)", opdef->txt);
646  break;
647  default:
648  rz_strbuf_setf(sb, "%s (result ?)", opdef->txt);
649  break;
650  }
651  op->len += n;
652  } break;
653  case WASM_OP_BR:
654  case WASM_OP_BRIF:
655  case WASM_OP_CALL: {
656  ut32 val = 0;
657  size_t n = read_u32_leb128(buf + 1, buf + buf_len, &val);
658  if (!(n > 0 && n < buf_len)) {
659  goto err;
660  }
661  rz_strbuf_setf(sb, "%s %d", opdef->txt, val);
662  op->len += n;
663  } break;
664  case WASM_OP_BRTABLE: {
665  ut32 count = 0, *table = NULL, def = 0;
666  size_t n = read_u32_leb128(buf + 1, buf + buf_len, &count);
667  if (!(n > 0 && n < buf_len && count < 0xffff)) {
668  goto err;
669  }
670  if (!(table = calloc(count, sizeof(ut32)))) {
671  goto err;
672  }
673  int i = 0;
674  op->len += n;
675  for (i = 0; i < count; i++) {
676  n = read_u32_leb128(buf + op->len, buf + buf_len, &table[i]);
677  if (!(op->len + n <= buf_len)) {
678  goto beach;
679  }
680  if (n < 1) {
681  break;
682  }
683  op->len += n;
684  }
685  n = read_u32_leb128(buf + op->len, buf + buf_len, &def);
686  if (!(n > 0 && n + op->len < buf_len)) {
687  goto beach;
688  }
689  op->len += n;
690  rz_strbuf_setf(sb, "%s %d ", opdef->txt, count);
691  for (i = 0; i < count; i++) {
692  rz_strbuf_appendf(sb, "%d ", table[i]);
693  }
694  rz_strbuf_appendf(sb, "%d", def);
695  free(table);
696  break;
697  beach:
698  free(table);
699  goto err;
700  } break;
701  case WASM_OP_CALLINDIRECT: {
702  ut32 val = 0, reserved = 0;
703  size_t n = read_u32_leb128(buf + 1, buf + buf_len, &val);
704  if (!(n > 0 && n < buf_len)) {
705  goto err;
706  }
707  op->len += n;
708  n = read_u32_leb128(buf + op->len, buf + buf_len, &reserved);
709  if (!(n == 1 && op->len + n <= buf_len)) {
710  goto err;
711  }
712  reserved &= 0x1;
713  rz_strbuf_setf(sb, "%s %d %d", opdef->txt, val, reserved);
714  op->len += n;
715  } break;
716  case WASM_OP_GETLOCAL:
717  case WASM_OP_SETLOCAL:
718  case WASM_OP_TEELOCAL:
719  case WASM_OP_GETGLOBAL:
720  case WASM_OP_SETGLOBAL: {
721  ut32 val = 0;
722  size_t n = read_u32_leb128(buf + 1, buf + buf_len, &val);
723  if (!(n > 0 && n < buf_len)) {
724  goto err;
725  }
726  rz_strbuf_setf(sb, "%s %d", opdef->txt, val);
727  op->len += n;
728  } break;
729  case WASM_OP_I32LOAD:
730  case WASM_OP_I64LOAD:
731  case WASM_OP_F32LOAD:
732  case WASM_OP_F64LOAD:
733  case WASM_OP_I32LOAD8S:
734  case WASM_OP_I32LOAD8U:
735  case WASM_OP_I32LOAD16S:
736  case WASM_OP_I32LOAD16U:
737  case WASM_OP_I64LOAD8S:
738  case WASM_OP_I64LOAD8U:
739  case WASM_OP_I64LOAD16S:
740  case WASM_OP_I64LOAD16U:
741  case WASM_OP_I64LOAD32S:
742  case WASM_OP_I64LOAD32U:
743  case WASM_OP_I32STORE:
744  case WASM_OP_I64STORE:
745  case WASM_OP_F32STORE:
746  case WASM_OP_F64STORE:
747  case WASM_OP_I32STORE8:
748  case WASM_OP_I32STORE16:
749  case WASM_OP_I64STORE8:
750  case WASM_OP_I64STORE16:
751  case WASM_OP_I64STORE32: {
752  ut32 flag = 0, offset = 0;
753  size_t n = read_u32_leb128(buf + 1, buf + buf_len, &flag);
754  if (!(n > 0 && n < buf_len)) {
755  goto err;
756  }
757  op->len += n;
758  n = read_u32_leb128(buf + op->len, buf + buf_len, &offset);
759  if (!(n > 0 && op->len + n <= buf_len)) {
760  goto err;
761  }
762  rz_strbuf_setf(sb, "%s %d %d", opdef->txt, flag, offset);
763  op->len += n;
764  } break;
766  case WASM_OP_GROWMEMORY: {
767  ut32 reserved = 0;
768  size_t n = read_u32_leb128(buf + 1, buf + buf_len, &reserved);
769  if (!(n == 1 && n < buf_len)) {
770  goto err;
771  }
772  reserved &= 0x1;
773  rz_strbuf_setf(sb, "%s %d", opdef->txt, reserved);
774  op->len += n;
775  } break;
776  case WASM_OP_I32CONST: {
777  st32 val = 0;
778  size_t n = read_i32_leb128(buf + 1, buf + buf_len, &val);
779  if (!(n > 0 && n < buf_len)) {
780  goto err;
781  }
782  rz_strbuf_setf(sb, "%s %" PFMT32d, opdef->txt, val);
783  op->len += n;
784  } break;
785  case WASM_OP_I64CONST: {
786  st64 val = 0;
787  size_t n = read_i64_leb128(buf + 1, buf + buf_len, &val);
788  if (!(n > 0 && n < buf_len)) {
789  goto err;
790  }
791  rz_strbuf_setf(sb, "%s %" PFMT64d, opdef->txt, val);
792  op->len += n;
793  } break;
794  case WASM_OP_F32CONST:
795  if (buf_len > 4) {
796  union fi {
797  ut32 v;
798  float f;
799  } u;
800  u.v = rz_read_at_le32(buf, 1);
801  rz_strbuf_setf(sb, "%s %f", opdef->txt, u.f);
802  op->len += 4;
803  } else {
804  goto err;
805  }
806  break;
807  case WASM_OP_F64CONST:
808  if (buf_len > 8) {
809  union di {
810  ut64 v;
811  double f;
812  } u;
813  u.v = rz_read_at_le64(buf, 1);
814  rz_strbuf_setf(sb, "%s %f", opdef->txt, u.f);
815  op->len += 8;
816  } else {
817  goto err;
818  }
819  break;
820  default:
821  goto err;
822  }
823  } else if (id == 0xfe) {
824  op->type = WASM_TYPE_OP_ATOMIC;
825  if (buf_len < 2)
826  goto err;
827  op->len = 2;
828  id = buf[1]; // skip 0xfe
829  op->op.atomic = id;
830  WasmOpDef *opdef = &opcodes_threads[id];
831  switch (id) {
888  ut32 flag = 0, offset = 0;
889  size_t n = read_u32_leb128(buf + 2, buf + buf_len, &flag);
890  if (!(n > 0 && n < buf_len)) {
891  goto err;
892  }
893  op->len += n;
894  n = read_u32_leb128(buf + op->len, buf + buf_len, &offset);
895  if (!(n > 0 && op->len + n <= buf_len)) {
896  goto err;
897  }
898  rz_strbuf_setf(sb, "%s %d %d", opdef->txt, flag, offset);
899  op->len += n;
900  } break;
901  default:
902  goto err;
903  }
904  } else if (id == 0xfd) {
905  if (buf_len < 2) {
906  goto err;
907  }
908  ut32 simdop;
909  op->type = WASM_TYPE_OP_SIMD;
910  size_t simdop_size = read_u32_leb128(buf + 1, buf + buf_len, &simdop);
911  if (simdop_size > buf_len) {
912  goto err;
913  }
914  op->len = 1 + simdop_size;
915  op->op.simd = simdop;
916  id = simdop; // this isn't great because we're losing the sign
917  // but it should never cause problems
918  WasmOpDef *opdef = &opcodes_simd[id];
919  switch (id) {
920  case WASM_OP_I8X16SPLAT:
921  case WASM_OP_I16X8SPLAT:
922  case WASM_OP_I32X4SPLAT:
923  case WASM_OP_I64X2SPLAT:
924  case WASM_OP_F32X4SPLAT:
925  case WASM_OP_F64X2SPLAT:
926  case WASM_OP_I8X16EQ:
927  case WASM_OP_I8X16NE:
928  case WASM_OP_I8X16LTS:
929  case WASM_OP_I8X16LTU:
930  case WASM_OP_I8X16GTS:
931  case WASM_OP_I8X16GTU:
932  case WASM_OP_I8X16LES:
933  case WASM_OP_I8X16LEU:
934  case WASM_OP_I8X16GES:
935  case WASM_OP_I8X16GEU:
936  case WASM_OP_I16X8EQ:
937  case WASM_OP_I16X8NE:
938  case WASM_OP_I16X8LTS:
939  case WASM_OP_I16X8LTU:
940  case WASM_OP_I16X8GTS:
941  case WASM_OP_I16X8GTU:
942  case WASM_OP_I16X8LES:
943  case WASM_OP_I16X8LEU:
944  case WASM_OP_I16X8GES:
945  case WASM_OP_I16X8GEU:
946  case WASM_OP_I32X4EQ:
947  case WASM_OP_I32X4NE:
948  case WASM_OP_I32X4LTS:
949  case WASM_OP_I32X4LTU:
950  case WASM_OP_I32X4GTS:
951  case WASM_OP_I32X4GTU:
952  case WASM_OP_I32X4LES:
953  case WASM_OP_I32X4LEU:
954  case WASM_OP_I32X4GES:
955  case WASM_OP_I32X4GEU:
956  case WASM_OP_F32X4EQ:
957  case WASM_OP_F32X4NE:
958  case WASM_OP_F32X4LT:
959  case WASM_OP_F32X4GT:
960  case WASM_OP_F32X4LE:
961  case WASM_OP_F32X4GE:
962  case WASM_OP_F64X2EQ:
963  case WASM_OP_F64X2NE:
964  case WASM_OP_F64X2LT:
965  case WASM_OP_F64X2GT:
966  case WASM_OP_F64X2LE:
967  case WASM_OP_F64X2GE:
968  case WASM_OP_V128NOT:
969  case WASM_OP_V128AND:
970  case WASM_OP_V128OR:
971  case WASM_OP_V128XOR:
973  case WASM_OP_I8X16NEG:
976  case WASM_OP_I8X16SHL:
977  case WASM_OP_I8X16SHRS:
978  case WASM_OP_I8X16SHRU:
979  case WASM_OP_I8X16ADD:
982  case WASM_OP_I8X16SUB:
985  case WASM_OP_I8X16MINS:
986  case WASM_OP_I8X16MINU:
987  case WASM_OP_I8X16MAXS:
988  case WASM_OP_I8X16MAXU:
989  case WASM_OP_I16X8NEG:
992  case WASM_OP_I16X8SHL:
993  case WASM_OP_I16X8SHRS:
994  case WASM_OP_I16X8SHRU:
995  case WASM_OP_I16X8ADD:
998  case WASM_OP_I16X8SUB:
1001  case WASM_OP_I16X8MUL:
1002  case WASM_OP_I16X8MINS:
1003  case WASM_OP_I16X8MINU:
1004  case WASM_OP_I16X8MAXS:
1005  case WASM_OP_I16X8MAXU:
1006  case WASM_OP_I32X4NEG:
1007  case WASM_OP_I32X4ANYTRUE:
1008  case WASM_OP_I32X4ALLTRUE:
1009  case WASM_OP_I32X4SHL:
1010  case WASM_OP_I32X4SHRS:
1011  case WASM_OP_I32X4SHRU:
1012  case WASM_OP_I32X4ADD:
1013  case WASM_OP_I32X4SUB:
1014  case WASM_OP_I32X4MUL:
1015  case WASM_OP_I32X4MINS:
1016  case WASM_OP_I32X4MINU:
1017  case WASM_OP_I32X4MAXS:
1018  case WASM_OP_I32X4MAXU:
1019  case WASM_OP_I64X2NEG:
1020  case WASM_OP_I64X2SHL:
1021  case WASM_OP_I64X2SHRS:
1022  case WASM_OP_I64X2SHRU:
1023  case WASM_OP_I64X2ADD:
1024  case WASM_OP_I64X2SUB:
1025  case WASM_OP_I64X2MUL:
1026  case WASM_OP_F32X4ABS:
1027  case WASM_OP_F32X4NEG:
1028  case WASM_OP_F32X4SQRT:
1029  case WASM_OP_F32X4ADD:
1030  case WASM_OP_F32X4SUB:
1031  case WASM_OP_F32X4MUL:
1032  case WASM_OP_F32X4DIV:
1033  case WASM_OP_F32X4MIN:
1034  case WASM_OP_F32X4MAX:
1035  case WASM_OP_F64X2ABS:
1036  case WASM_OP_F64X2NEG:
1037  case WASM_OP_F64X2SQRT:
1038  case WASM_OP_F64X2ADD:
1039  case WASM_OP_F64X2SUB:
1040  case WASM_OP_F64X2MUL:
1041  case WASM_OP_F64X2DIV:
1042  case WASM_OP_F64X2MIN:
1043  case WASM_OP_F64X2MAX:
1048  case WASM_OP_V8X16SWIZZLE:
1061  case WASM_OP_V128ANDNOT:
1062  case WASM_OP_I8X16AVGRU:
1063  case WASM_OP_I16X8AVGRU:
1064  case WASM_OP_I8X16ABS:
1065  case WASM_OP_I16X8ABS:
1066  case WASM_OP_I32X4ABS: {
1067  rz_strbuf_set(sb, opdef->txt);
1068  } break;
1069  case WASM_OP_V128LOAD:
1070  case WASM_OP_I16X8LOAD8X8S:
1071  case WASM_OP_I16X8LOAD8X8U:
1080  case WASM_OP_V128STORE: {
1081  ut32 offset = 0, align = 0;
1082  size_t n = read_u32_leb128(buf + 1 + simdop_size, buf + buf_len, &offset);
1083  op->len += n;
1084  if (!(n > 0 && n < buf_len)) {
1085  goto err;
1086  }
1087  n = read_u32_leb128(buf + 1 + simdop_size + n, buf + buf_len, &align);
1088  op->len += n;
1089  if (!(n > 0 && n < buf_len)) {
1090  goto err;
1091  }
1092  rz_strbuf_setf(sb, "%s o:%d a:2^%d", opdef->txt, offset, align);
1093  } break;
1094  case WASM_OP_V128CONST:
1095  case WASM_OP_V8X16SHUFFLE: {
1096  if (buf_len < 18) {
1097  goto err;
1098  }
1099  op->len += 16;
1100  unsigned char bytes[16] = { 0 };
1101  int i;
1102  for (i = 0; i < 16; ++i) {
1103  bytes[i] = buf[i + 1 + simdop_size];
1104  }
1105  rz_strbuf_setf(sb, "%s %02x %02x %02x %02x %02x %02x %02x "
1106  "%02x %02x %02x %02x %02x %02x %02x %02x %02x",
1107  opdef->txt, bytes[0], bytes[1], bytes[2], bytes[3],
1108  bytes[4], bytes[5], bytes[6], bytes[7], bytes[8],
1109  bytes[9], bytes[10], bytes[11], bytes[12], bytes[13],
1110  bytes[14], bytes[15]);
1111  } break;
1125  case WASM_OP_F64X2REPLACELANE: {
1126  if (buf_len < 3) {
1127  goto err;
1128  }
1129  unsigned char lane = buf[1 + simdop_size];
1130  ++op->len;
1131  rz_strbuf_setf(sb, "%s %d", opdef->txt, lane);
1132  } break;
1133  }
1134  } else {
1135  goto err;
1136  }
1137  op->txt = rz_strbuf_drain(sb);
1138  return op->len;
1139 
1140 err:
1141  op->len = 1;
1142  rz_strbuf_set(sb, "invalid");
1143  op->txt = rz_strbuf_drain(sb);
1144  return op->len;
1145 }
lzma_index ** i
Definition: index.h:629
ut16 val
Definition: armass64_const.h:6
static bool err
Definition: armass.c:435
static WasmOpDef opcodes[256]
Definition: wasm.c:14
static WasmOpDef opcodes_threads[256]
Definition: wasm.c:189
static WasmOpDef opcodes_simd[256]
Definition: wasm.c:257
static ut8 bytes[32]
Definition: asm_arc.c:23
static int buf_len
Definition: asm_arc.c:22
@ RZ_BIN_WASM_VALUETYPE_v128
Definition: wasm.h:39
@ RZ_BIN_WASM_VALUETYPE_i32
Definition: wasm.h:35
@ RZ_BIN_WASM_VALUETYPE_f64
Definition: wasm.h:38
@ RZ_BIN_WASM_VALUETYPE_f32
Definition: wasm.h:37
@ RZ_BIN_WASM_VALUETYPE_i64
Definition: wasm.h:36
@ RZ_BIN_WASM_VALUETYPE_EMPTY
Definition: wasm.h:42
static SblHeader sb
Definition: bin_mbn.c:26
#define NULL
Definition: cris-opc.c:27
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
Definition: sflib.h:98
uint32_t ut32
const char * v
Definition: dsignal.c:12
RZ_API void Ht_() free(HtName_(Ht) *ht)
Definition: ht_inc.c:130
voidpf uLong offset
Definition: ioapi.h:144
voidpf void * buf
Definition: ioapi.h:138
void * calloc(size_t number, size_t size)
Definition: malloc.c:102
@ reserved
Definition: lm32_isa.h:94
int n
Definition: mipsasm.c:19
int id
Definition: op.c:540
static ut64 rz_read_at_le64(const void *src, size_t offset)
Definition: rz_endian.h:272
static ut32 rz_read_at_le32(const void *src, size_t offset)
Definition: rz_endian.h:248
RZ_API RZ_OWN char * rz_strbuf_drain(RzStrBuf *sb)
Definition: strbuf.c:342
RZ_API const char * rz_strbuf_set(RzStrBuf *sb, const char *s)
Definition: strbuf.c:153
RZ_API const char * rz_strbuf_setf(RzStrBuf *sb, const char *fmt,...) RZ_PRINTF_CHECK(2
RZ_API RzStrBuf * rz_strbuf_new(const char *s)
Definition: strbuf.c:8
RZ_API bool rz_strbuf_appendf(RzStrBuf *sb, const char *fmt,...) RZ_PRINTF_CHECK(2
#define PFMT64d
Definition: rz_types.h:394
#define PFMT32d
Definition: rz_types.h:408
#define st64
Definition: rz_types_base.h:10
#define st32
Definition: rz_types_base.h:12
RZ_API size_t read_i32_leb128(const ut8 *p, const ut8 *max, st32 *out_val)
Definition: uleb128.c:211
RZ_API size_t read_i64_leb128(const ut8 *p, const ut8 *max, st64 *out_val)
Definition: uleb128.c:282
RZ_API size_t read_u32_leb128(const ut8 *p, const ut8 *max, ut32 *out_val)
Definition: uleb128.c:186
#define f(i)
Definition: sha256.c:46
const char * txt
Definition: wasm.h:498
Definition: dis.c:32
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
int def(FILE *source, FILE *dest, int level)
Definition: zpipe.c:36

References buf_len, bytes, calloc(), count, def(), err, f, free(), i, id, n, NULL, opcodes, opcodes_simd, opcodes_threads, PFMT32d, PFMT64d, read_i32_leb128(), read_i64_leb128(), read_u32_leb128(), reserved, RZ_BIN_WASM_VALUETYPE_EMPTY, RZ_BIN_WASM_VALUETYPE_f32, RZ_BIN_WASM_VALUETYPE_f64, RZ_BIN_WASM_VALUETYPE_i32, RZ_BIN_WASM_VALUETYPE_i64, RZ_BIN_WASM_VALUETYPE_v128, rz_read_at_le32(), rz_read_at_le64(), rz_strbuf_appendf(), rz_strbuf_drain(), rz_strbuf_new(), rz_strbuf_set(), rz_strbuf_setf(), sb, st32, st64, WasmOpDef::txt, ut64(), v, val, WASM_OP_BLOCK, WASM_OP_BR, WASM_OP_BRIF, WASM_OP_BRTABLE, WASM_OP_CALL, WASM_OP_CALLINDIRECT, WASM_OP_CURRENTMEMORY, WASM_OP_DROP, WASM_OP_ELSE, WASM_OP_END, WASM_OP_F32ABS, WASM_OP_F32ADD, WASM_OP_F32CEIL, WASM_OP_F32CONST, WASM_OP_F32CONVERTSI32, WASM_OP_F32CONVERTSI64, WASM_OP_F32CONVERTUI32, WASM_OP_F32CONVERTUI64, WASM_OP_F32COPYSIGN, WASM_OP_F32DEMOTEF64, WASM_OP_F32DIV, WASM_OP_F32EQ, WASM_OP_F32FLOOR, WASM_OP_F32GE, WASM_OP_F32GT, WASM_OP_F32LE, WASM_OP_F32LOAD, WASM_OP_F32LT, WASM_OP_F32MAX, WASM_OP_F32MIN, WASM_OP_F32MUL, WASM_OP_F32NE, WASM_OP_F32NEAREST, WASM_OP_F32NEG, WASM_OP_F32REINTERPRETI32, WASM_OP_F32SQRT, WASM_OP_F32STORE, WASM_OP_F32SUB, WASM_OP_F32TRUNC, WASM_OP_F32X4ABS, WASM_OP_F32X4ADD, WASM_OP_F32X4CONVERTI32X4S, WASM_OP_F32X4CONVERTI32X4U, WASM_OP_F32X4DIV, WASM_OP_F32X4EQ, WASM_OP_F32X4EXTRACTLANE, WASM_OP_F32X4GE, WASM_OP_F32X4GT, WASM_OP_F32X4LE, WASM_OP_F32X4LT, WASM_OP_F32X4MAX, WASM_OP_F32X4MIN, WASM_OP_F32X4MUL, WASM_OP_F32X4NE, WASM_OP_F32X4NEG, WASM_OP_F32X4REPLACELANE, WASM_OP_F32X4SPLAT, WASM_OP_F32X4SQRT, WASM_OP_F32X4SUB, WASM_OP_F64ABS, WASM_OP_F64ADD, WASM_OP_F64CEIL, WASM_OP_F64CONST, WASM_OP_F64CONVERTSI32, WASM_OP_F64CONVERTSI64, WASM_OP_F64CONVERTUI32, WASM_OP_F64CONVERTUI64, WASM_OP_F64COPYSIGN, WASM_OP_F64DIV, WASM_OP_F64EQ, WASM_OP_F64FLOOR, WASM_OP_F64GE, WASM_OP_F64GT, WASM_OP_F64LE, WASM_OP_F64LOAD, WASM_OP_F64LT, WASM_OP_F64MAX, WASM_OP_F64MIN, WASM_OP_F64MUL, WASM_OP_F64NE, WASM_OP_F64NEAREST, WASM_OP_F64NEG, WASM_OP_F64PROMOTEF32, WASM_OP_F64REINTERPRETI64, WASM_OP_F64SQRT, WASM_OP_F64STORE, WASM_OP_F64SUB, WASM_OP_F64TRUNC, WASM_OP_F64X2ABS, WASM_OP_F64X2ADD, WASM_OP_F64X2DIV, WASM_OP_F64X2EQ, WASM_OP_F64X2EXTRACTLANE, WASM_OP_F64X2GE, WASM_OP_F64X2GT, WASM_OP_F64X2LE, WASM_OP_F64X2LT, WASM_OP_F64X2MAX, WASM_OP_F64X2MIN, WASM_OP_F64X2MUL, WASM_OP_F64X2NE, WASM_OP_F64X2NEG, WASM_OP_F64X2REPLACELANE, WASM_OP_F64X2SPLAT, WASM_OP_F64X2SQRT, WASM_OP_F64X2SUB, WASM_OP_GETGLOBAL, WASM_OP_GETLOCAL, WASM_OP_GROWMEMORY, WASM_OP_I16X8ABS, WASM_OP_I16X8ADD, WASM_OP_I16X8ADDSATURATES, WASM_OP_I16X8ADDSATURATEU, WASM_OP_I16X8ALLTRUE, WASM_OP_I16X8ANYTRUE, WASM_OP_I16X8AVGRU, WASM_OP_I16X8EQ, WASM_OP_I16X8EXTRACTLANES, WASM_OP_I16X8EXTRACTLANEU, WASM_OP_I16X8GES, WASM_OP_I16X8GEU, WASM_OP_I16X8GTS, WASM_OP_I16X8GTU, WASM_OP_I16X8LES, WASM_OP_I16X8LEU, WASM_OP_I16X8LOAD8X8S, WASM_OP_I16X8LOAD8X8U, WASM_OP_I16X8LTS, WASM_OP_I16X8LTU, WASM_OP_I16X8MAXS, WASM_OP_I16X8MAXU, WASM_OP_I16X8MINS, WASM_OP_I16X8MINU, WASM_OP_I16X8MUL, WASM_OP_I16X8NARROWI32X4S, WASM_OP_I16X8NARROWI32X4U, WASM_OP_I16X8NE, WASM_OP_I16X8NEG, WASM_OP_I16X8REPLACELANE, WASM_OP_I16X8SHL, WASM_OP_I16X8SHRS, WASM_OP_I16X8SHRU, WASM_OP_I16X8SPLAT, WASM_OP_I16X8SUB, WASM_OP_I16X8SUBSATURATES, WASM_OP_I16X8SUBSATURATEU, WASM_OP_I16X8WIDENHIGHI8X16S, WASM_OP_I16X8WIDENHIGHI8X16U, WASM_OP_I16X8WIDENLOWI8X16S, WASM_OP_I16X8WIDENLOWI8X16U, WASM_OP_I32ADD, WASM_OP_I32AND, WASM_OP_I32ATOMICLOAD, WASM_OP_I32ATOMICLOAD16U, WASM_OP_I32ATOMICLOAD8U, WASM_OP_I32ATOMICRMW16UADD, WASM_OP_I32ATOMICRMW16UAND, WASM_OP_I32ATOMICRMW16UOR, WASM_OP_I32ATOMICRMW16USUB, WASM_OP_I32ATOMICRMW16UXCHG, WASM_OP_I32ATOMICRMW16UXOR, WASM_OP_I32ATOMICRMW8UADD, WASM_OP_I32ATOMICRMW8UAND, WASM_OP_I32ATOMICRMW8UOR, WASM_OP_I32ATOMICRMW8USUB, WASM_OP_I32ATOMICRMW8UXCHG, WASM_OP_I32ATOMICRMW8UXOR, WASM_OP_I32ATOMICRMWADD, WASM_OP_I32ATOMICRMWAND, WASM_OP_I32ATOMICRMWOR, WASM_OP_I32ATOMICRMWSUB, WASM_OP_I32ATOMICRMWXCHG, WASM_OP_I32ATOMICRMWXOR, WASM_OP_I32ATOMICSTORE, WASM_OP_I32ATOMICSTORE16, WASM_OP_I32ATOMICSTORE8, WASM_OP_I32CLZ, WASM_OP_I32CONST, WASM_OP_I32CTZ, WASM_OP_I32DIVS, WASM_OP_I32DIVU, WASM_OP_I32EQ, WASM_OP_I32EQZ, WASM_OP_I32GES, WASM_OP_I32GEU, WASM_OP_I32GTS, WASM_OP_I32GTU, WASM_OP_I32LES, WASM_OP_I32LEU, WASM_OP_I32LOAD, WASM_OP_I32LOAD16S, WASM_OP_I32LOAD16U, WASM_OP_I32LOAD8S, WASM_OP_I32LOAD8U, WASM_OP_I32LTS, WASM_OP_I32LTU, WASM_OP_I32MUL, WASM_OP_I32NE, WASM_OP_I32OR, WASM_OP_I32POPCNT, WASM_OP_I32REINTERPRETF32, WASM_OP_I32REMS, WASM_OP_I32REMU, WASM_OP_I32ROTL, WASM_OP_I32ROTR, WASM_OP_I32SHL, WASM_OP_I32SHRS, WASM_OP_I32SHRU, WASM_OP_I32STORE, WASM_OP_I32STORE16, WASM_OP_I32STORE8, WASM_OP_I32SUB, WASM_OP_I32TRUNCSF32, WASM_OP_I32TRUNCSF64, WASM_OP_I32TRUNCUF32, WASM_OP_I32TRUNCUF64, WASM_OP_I32WRAPI64, WASM_OP_I32X4ABS, WASM_OP_I32X4ADD, WASM_OP_I32X4ALLTRUE, WASM_OP_I32X4ANYTRUE, WASM_OP_I32X4EQ, WASM_OP_I32X4EXTRACTLANE, WASM_OP_I32X4GES, WASM_OP_I32X4GEU, WASM_OP_I32X4GTS, WASM_OP_I32X4GTU, WASM_OP_I32X4LES, WASM_OP_I32X4LEU, WASM_OP_I32X4LOAD16X4S, WASM_OP_I32X4LOAD16X4U, WASM_OP_I32X4LTS, WASM_OP_I32X4LTU, WASM_OP_I32X4MAXS, WASM_OP_I32X4MAXU, WASM_OP_I32X4MINS, WASM_OP_I32X4MINU, WASM_OP_I32X4MUL, WASM_OP_I32X4NE, WASM_OP_I32X4NEG, WASM_OP_I32X4REPLACELANE, WASM_OP_I32X4SHL, WASM_OP_I32X4SHRS, WASM_OP_I32X4SHRU, WASM_OP_I32X4SPLAT, WASM_OP_I32X4SUB, WASM_OP_I32X4TRUNCSATF32X4S, WASM_OP_I32X4TRUNCSATF32X4U, WASM_OP_I32X4WIDENHIGHI16X8S, WASM_OP_I32X4WIDENHIGHI16X8U, WASM_OP_I32X4WIDENLOWI16X8S, WASM_OP_I32X4WIDENLOWI16X8U, WASM_OP_I32XOR, WASM_OP_I64ADD, WASM_OP_I64AND, WASM_OP_I64ATOMICLOAD, WASM_OP_I64ATOMICLOAD16U, WASM_OP_I64ATOMICLOAD32U, WASM_OP_I64ATOMICLOAD8U, WASM_OP_I64ATOMICRMW16UADD, WASM_OP_I64ATOMICRMW16UAND, WASM_OP_I64ATOMICRMW16UOR, WASM_OP_I64ATOMICRMW16USUB, WASM_OP_I64ATOMICRMW16UXCHG, WASM_OP_I64ATOMICRMW16UXOR, WASM_OP_I64ATOMICRMW32UADD, WASM_OP_I64ATOMICRMW32UAND, WASM_OP_I64ATOMICRMW32UOR, WASM_OP_I64ATOMICRMW32USUB, WASM_OP_I64ATOMICRMW32UXCHG, WASM_OP_I64ATOMICRMW32UXOR, WASM_OP_I64ATOMICRMW8UADD, WASM_OP_I64ATOMICRMW8UAND, WASM_OP_I64ATOMICRMW8UOR, WASM_OP_I64ATOMICRMW8USUB, WASM_OP_I64ATOMICRMW8UXCHG, WASM_OP_I64ATOMICRMW8UXOR, WASM_OP_I64ATOMICRMWADD, WASM_OP_I64ATOMICRMWAND, WASM_OP_I64ATOMICRMWOR, WASM_OP_I64ATOMICRMWSUB, WASM_OP_I64ATOMICRMWXCHG, WASM_OP_I64ATOMICRMWXOR, WASM_OP_I64ATOMICSTORE, WASM_OP_I64ATOMICSTORE16, WASM_OP_I64ATOMICSTORE32, WASM_OP_I64ATOMICSTORE8, WASM_OP_I64CLZ, WASM_OP_I64CONST, WASM_OP_I64CTZ, WASM_OP_I64DIVS, WASM_OP_I64DIVU, WASM_OP_I64EQ, WASM_OP_I64EQZ, WASM_OP_I64EXTENDSI32, WASM_OP_I64EXTENDUI32, WASM_OP_I64GES, WASM_OP_I64GEU, WASM_OP_I64GTS, WASM_OP_I64GTU, WASM_OP_I64LES, WASM_OP_I64LEU, WASM_OP_I64LOAD, WASM_OP_I64LOAD16S, WASM_OP_I64LOAD16U, WASM_OP_I64LOAD32S, WASM_OP_I64LOAD32U, WASM_OP_I64LOAD8S, WASM_OP_I64LOAD8U, WASM_OP_I64LTS, WASM_OP_I64LTU, WASM_OP_I64MUL, WASM_OP_I64NE, WASM_OP_I64OR, WASM_OP_I64POPCNT, WASM_OP_I64REINTERPRETF64, WASM_OP_I64REMS, WASM_OP_I64REMU, WASM_OP_I64ROTL, WASM_OP_I64ROTR, WASM_OP_I64SHL, WASM_OP_I64SHRS, WASM_OP_I64SHRU, WASM_OP_I64STORE, WASM_OP_I64STORE16, WASM_OP_I64STORE32, WASM_OP_I64STORE8, WASM_OP_I64SUB, WASM_OP_I64TRUNCSF32, WASM_OP_I64TRUNCSF64, WASM_OP_I64TRUNCUF32, WASM_OP_I64TRUNCUF64, WASM_OP_I64X2ADD, WASM_OP_I64X2EXTRACTLANE, WASM_OP_I64X2LOAD32X2S, WASM_OP_I64X2LOAD32X2U, WASM_OP_I64X2MUL, WASM_OP_I64X2NEG, WASM_OP_I64X2REPLACELANE, WASM_OP_I64X2SHL, WASM_OP_I64X2SHRS, WASM_OP_I64X2SHRU, WASM_OP_I64X2SPLAT, WASM_OP_I64X2SUB, WASM_OP_I64XOR, WASM_OP_I8X16ABS, WASM_OP_I8X16ADD, WASM_OP_I8X16ADDSATURATES, WASM_OP_I8X16ADDSATURATEU, WASM_OP_I8X16ALLTRUE, WASM_OP_I8X16ANYTRUE, WASM_OP_I8X16AVGRU, WASM_OP_I8X16EQ, WASM_OP_I8X16EXTRACTLANES, WASM_OP_I8X16EXTRACTLANEU, WASM_OP_I8X16GES, WASM_OP_I8X16GEU, WASM_OP_I8X16GTS, WASM_OP_I8X16GTU, WASM_OP_I8X16LES, WASM_OP_I8X16LEU, WASM_OP_I8X16LTS, WASM_OP_I8X16LTU, WASM_OP_I8X16MAXS, WASM_OP_I8X16MAXU, WASM_OP_I8X16MINS, WASM_OP_I8X16MINU, WASM_OP_I8X16NARROWI16X8S, WASM_OP_I8X16NARROWI16X8U, WASM_OP_I8X16NE, WASM_OP_I8X16NEG, WASM_OP_I8X16REPLACELANE, WASM_OP_I8X16SHL, WASM_OP_I8X16SHRS, WASM_OP_I8X16SHRU, WASM_OP_I8X16SPLAT, WASM_OP_I8X16SUB, WASM_OP_I8X16SUBSATURATES, WASM_OP_I8X16SUBSATURATEU, WASM_OP_IF, WASM_OP_LOOP, WASM_OP_NOP, WASM_OP_RETURN, WASM_OP_SELECT, WASM_OP_SETGLOBAL, WASM_OP_SETLOCAL, WASM_OP_TEELOCAL, WASM_OP_TRAP, WASM_OP_V128AND, WASM_OP_V128ANDNOT, WASM_OP_V128BITSELECT, WASM_OP_V128CONST, WASM_OP_V128LOAD, WASM_OP_V128NOT, WASM_OP_V128OR, WASM_OP_V128STORE, WASM_OP_V128XOR, WASM_OP_V16X8LOADSPLAT, WASM_OP_V32X4LOADSPLAT, WASM_OP_V64X2LOADSPLAT, WASM_OP_V8X16LOADSPLAT, WASM_OP_V8X16SHUFFLE, WASM_OP_V8X16SWIZZLE, WASM_TYPE_OP_ATOMIC, WASM_TYPE_OP_CORE, and WASM_TYPE_OP_SIMD.

Referenced by advance_till_scope_end(), disassemble(), and wasm_op().