Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
Xbyak Namespace Reference

Namespaces

namespace  inner
 
namespace  util
 

Classes

class  Address
 
class  AddressFrame
 
struct  Allocator
 
struct  BoundsReg
 
class  CodeArray
 
class  CodeGenerator
 
class  Error
 
struct  EvexModifierRounding
 
struct  EvexModifierZero
 
struct  Fpu
 
struct  JmpLabel
 
class  Label
 
class  LabelManager
 
struct  Mmx
 
class  Operand
 
struct  Opmask
 
class  Reg
 
struct  Reg16
 
struct  Reg32
 
struct  Reg32e
 
struct  Reg8
 
class  RegExp
 
class  Segment
 
struct  Xmm
 
struct  Ymm
 
struct  Zmm
 

Typedefs

typedef uint64_t uint64
 
typedef int64_t sint64
 
typedef unsigned int uint32
 
typedef unsigned short uint16
 

Enumerations

enum  { DEFAULT_MAX_CODE_SIZE = 4096 , VERSION = 0x5630 }
 
enum  {
  ERR_NONE = 0 , ERR_BAD_ADDRESSING , ERR_CODE_IS_TOO_BIG , ERR_BAD_SCALE ,
  ERR_ESP_CANT_BE_INDEX , ERR_BAD_COMBINATION , ERR_BAD_SIZE_OF_REGISTER , ERR_IMM_IS_TOO_BIG ,
  ERR_BAD_ALIGN , ERR_LABEL_IS_REDEFINED , ERR_LABEL_IS_TOO_FAR , ERR_LABEL_IS_NOT_FOUND ,
  ERR_CODE_ISNOT_COPYABLE , ERR_BAD_PARAMETER , ERR_CANT_PROTECT , ERR_CANT_USE_64BIT_DISP ,
  ERR_OFFSET_IS_TOO_BIG , ERR_MEM_SIZE_IS_NOT_SPECIFIED , ERR_BAD_MEM_SIZE , ERR_BAD_ST_COMBINATION ,
  ERR_OVER_LOCAL_LABEL , ERR_UNDER_LOCAL_LABEL , ERR_CANT_ALLOC , ERR_ONLY_T_NEAR_IS_SUPPORTED_IN_AUTO_GROW ,
  ERR_BAD_PROTECT_MODE , ERR_BAD_PNUM , ERR_BAD_TNUM , ERR_BAD_VSIB_ADDRESSING ,
  ERR_CANT_CONVERT , ERR_LABEL_ISNOT_SET_BY_L , ERR_LABEL_IS_ALREADY_SET_BY_L , ERR_BAD_LABEL_STR ,
  ERR_MUNMAP , ERR_OPMASK_IS_ALREADY_SET , ERR_ROUNDING_IS_ALREADY_SET , ERR_K0_IS_INVALID ,
  ERR_EVEX_IS_INVALID , ERR_SAE_IS_INVALID , ERR_ER_IS_INVALID , ERR_INVALID_BROADCAST ,
  ERR_INVALID_OPMASK_WITH_MEMORY , ERR_INVALID_ZERO , ERR_INVALID_RIP_IN_AUTO_GROW , ERR_INVALID_MIB_ADDRESS ,
  ERR_INTERNAL
}
 

Functions

const char * ConvertErrorToString (const Error &err)
 
void * AlignedMalloc (size_t size, size_t alignment)
 
void AlignedFree (void *p)
 
template<class To , class From >
const To CastTo (From p) throw ()
 
template<class T >
T operator| (const T &x, const Opmask &k)
 
template<class T >
T operator| (const T &x, const EvexModifierZero &)
 
template<class T >
T operator| (const T &x, const EvexModifierRounding &emr)
 
RegExp operator+ (const RegExp &a, const RegExp &b)
 
RegExp operator* (const Reg &r, int scale)
 
RegExp operator- (const RegExp &e, size_t disp)
 

Variables

void *const AutoGrow = (void*)1
 

Typedef Documentation

◆ sint64

Definition at line 118 of file xbyak.h.

◆ uint16

typedef unsigned short Xbyak::uint16

Definition at line 121 of file xbyak.h.

◆ uint32

typedef unsigned int Xbyak::uint32

Definition at line 120 of file xbyak.h.

◆ uint64

Definition at line 117 of file xbyak.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
DEFAULT_MAX_CODE_SIZE 
VERSION 

Definition at line 106 of file xbyak.h.

106 {
108 VERSION = 0x5630 /* 0xABCD = A.BC(D) */
109};
@ VERSION
Definition xbyak.h:108
@ DEFAULT_MAX_CODE_SIZE
Definition xbyak.h:107

◆ anonymous enum

anonymous enum
Enumerator
ERR_NONE 
ERR_BAD_ADDRESSING 
ERR_CODE_IS_TOO_BIG 
ERR_BAD_SCALE 
ERR_ESP_CANT_BE_INDEX 
ERR_BAD_COMBINATION 
ERR_BAD_SIZE_OF_REGISTER 
ERR_IMM_IS_TOO_BIG 
ERR_BAD_ALIGN 
ERR_LABEL_IS_REDEFINED 
ERR_LABEL_IS_TOO_FAR 
ERR_LABEL_IS_NOT_FOUND 
ERR_CODE_ISNOT_COPYABLE 
ERR_BAD_PARAMETER 
ERR_CANT_PROTECT 
ERR_CANT_USE_64BIT_DISP 
ERR_OFFSET_IS_TOO_BIG 
ERR_MEM_SIZE_IS_NOT_SPECIFIED 
ERR_BAD_MEM_SIZE 
ERR_BAD_ST_COMBINATION 
ERR_OVER_LOCAL_LABEL 
ERR_UNDER_LOCAL_LABEL 
ERR_CANT_ALLOC 
ERR_ONLY_T_NEAR_IS_SUPPORTED_IN_AUTO_GROW 
ERR_BAD_PROTECT_MODE 
ERR_BAD_PNUM 
ERR_BAD_TNUM 
ERR_BAD_VSIB_ADDRESSING 
ERR_CANT_CONVERT 
ERR_LABEL_ISNOT_SET_BY_L 
ERR_LABEL_IS_ALREADY_SET_BY_L 
ERR_BAD_LABEL_STR 
ERR_MUNMAP 
ERR_OPMASK_IS_ALREADY_SET 
ERR_ROUNDING_IS_ALREADY_SET 
ERR_K0_IS_INVALID 
ERR_EVEX_IS_INVALID 
ERR_SAE_IS_INVALID 
ERR_ER_IS_INVALID 
ERR_INVALID_BROADCAST 
ERR_INVALID_OPMASK_WITH_MEMORY 
ERR_INVALID_ZERO 
ERR_INVALID_RIP_IN_AUTO_GROW 
ERR_INVALID_MIB_ADDRESS 
ERR_INTERNAL 

Definition at line 136 of file xbyak.h.

136 {
137 ERR_NONE = 0,
157 ERR_OVER_LOCAL_LABEL, // not used
182};
@ ERR_MEM_SIZE_IS_NOT_SPECIFIED
Definition xbyak.h:154
@ ERR_NONE
Definition xbyak.h:137
@ ERR_ONLY_T_NEAR_IS_SUPPORTED_IN_AUTO_GROW
Definition xbyak.h:160
@ ERR_BAD_PROTECT_MODE
Definition xbyak.h:161
@ ERR_INVALID_BROADCAST
Definition xbyak.h:176
@ ERR_CANT_ALLOC
Definition xbyak.h:159
@ ERR_BAD_LABEL_STR
Definition xbyak.h:168
@ ERR_BAD_SIZE_OF_REGISTER
Definition xbyak.h:143
@ ERR_BAD_SCALE
Definition xbyak.h:140
@ ERR_BAD_VSIB_ADDRESSING
Definition xbyak.h:164
@ ERR_CANT_CONVERT
Definition xbyak.h:165
@ ERR_OPMASK_IS_ALREADY_SET
Definition xbyak.h:170
@ ERR_ROUNDING_IS_ALREADY_SET
Definition xbyak.h:171
@ ERR_INTERNAL
Definition xbyak.h:181
@ ERR_SAE_IS_INVALID
Definition xbyak.h:174
@ ERR_BAD_PNUM
Definition xbyak.h:162
@ ERR_OFFSET_IS_TOO_BIG
Definition xbyak.h:153
@ ERR_BAD_ADDRESSING
Definition xbyak.h:138
@ ERR_LABEL_ISNOT_SET_BY_L
Definition xbyak.h:166
@ ERR_BAD_MEM_SIZE
Definition xbyak.h:155
@ ERR_CODE_ISNOT_COPYABLE
Definition xbyak.h:149
@ ERR_LABEL_IS_REDEFINED
Definition xbyak.h:146
@ ERR_ER_IS_INVALID
Definition xbyak.h:175
@ ERR_LABEL_IS_TOO_FAR
Definition xbyak.h:147
@ ERR_CANT_PROTECT
Definition xbyak.h:151
@ ERR_INVALID_ZERO
Definition xbyak.h:178
@ ERR_CANT_USE_64BIT_DISP
Definition xbyak.h:152
@ ERR_INVALID_MIB_ADDRESS
Definition xbyak.h:180
@ ERR_BAD_ST_COMBINATION
Definition xbyak.h:156
@ ERR_EVEX_IS_INVALID
Definition xbyak.h:173
@ ERR_BAD_ALIGN
Definition xbyak.h:145
@ ERR_LABEL_IS_ALREADY_SET_BY_L
Definition xbyak.h:167
@ ERR_IMM_IS_TOO_BIG
Definition xbyak.h:144
@ ERR_BAD_TNUM
Definition xbyak.h:163
@ ERR_K0_IS_INVALID
Definition xbyak.h:172
@ ERR_OVER_LOCAL_LABEL
Definition xbyak.h:157
@ ERR_BAD_PARAMETER
Definition xbyak.h:150
@ ERR_INVALID_OPMASK_WITH_MEMORY
Definition xbyak.h:177
@ ERR_ESP_CANT_BE_INDEX
Definition xbyak.h:141
@ ERR_MUNMAP
Definition xbyak.h:169
@ ERR_BAD_COMBINATION
Definition xbyak.h:142
@ ERR_CODE_IS_TOO_BIG
Definition xbyak.h:139
@ ERR_LABEL_IS_NOT_FOUND
Definition xbyak.h:148
@ ERR_INVALID_RIP_IN_AUTO_GROW
Definition xbyak.h:179
@ ERR_UNDER_LOCAL_LABEL
Definition xbyak.h:158

Function Documentation

◆ AlignedFree()

void Xbyak::AlignedFree ( void * p)
inline

Definition at line 267 of file xbyak.h.

268{
269#ifdef __MINGW32__
270 __mingw_aligned_free(p);
271#elif defined(_MSC_VER)
272 _aligned_free(p);
273#else
274 free(p);
275#endif
276}
const mie::Vuint & p
Definition bn.cpp:27
Here is the caller graph for this function:

◆ AlignedMalloc()

void * Xbyak::AlignedMalloc ( size_t size,
size_t alignment )
inline

Definition at line 254 of file xbyak.h.

255{
256#ifdef __MINGW32__
257 return __mingw_aligned_malloc(size, alignment);
258#elif defined(_WIN32)
259 return _aligned_malloc(size, alignment);
260#else
261 void *p;
262 int ret = posix_memalign(&p, alignment, size);
263 return (ret == 0) ? p : 0;
264#endif
265}
CK_RV ret
Here is the caller graph for this function:

◆ CastTo()

template<class To , class From >
const To Xbyak::CastTo ( From p)
throw ( )
inline

Definition at line 279 of file xbyak.h.

280{
281 return (const To)(size_t)(p);
282}
Here is the caller graph for this function:

◆ ConvertErrorToString()

const char * Xbyak::ConvertErrorToString ( const Error & err)
inline

Definition at line 249 of file xbyak.h.

250{
251 return err.what();
252}
const char * what() const
Definition xbyak.h:195

◆ operator*()

RegExp Xbyak::operator* ( const Reg & r,
int scale )
inline

Definition at line 776 of file xbyak.h.

777{
778 return RegExp(r, scale);
779}
const mie::Vuint & r
Definition bn.cpp:28

◆ operator+()

RegExp Xbyak::operator+ ( const RegExp & a,
const RegExp & b )
inline

Definition at line 756 of file xbyak.h.

757{
758 if (a.index_.getBit() && b.index_.getBit()) throw Error(ERR_BAD_ADDRESSING);
759 RegExp ret = a;
760 if (!ret.index_.getBit()) { ret.index_ = b.index_; ret.scale_ = b.scale_; }
761 if (b.base_.getBit()) {
762 if (ret.base_.getBit()) {
763 if (ret.index_.getBit()) throw Error(ERR_BAD_ADDRESSING);
764 // base + base => base + index * 1
765 ret.index_ = b.base_;
766 // [reg + esp] => [esp + reg]
767 if (ret.index_.getIdx() == Operand::ESP) std::swap(ret.base_, ret.index_);
768 ret.scale_ = 1;
769 } else {
770 ret.base_ = b.base_;
771 }
772 }
773 ret.disp_ += b.disp_;
774 return ret;
775}
Error
Definition calc.cpp:23
uint32 getBit() const
Definition xbyak.h:453
void swap(picojson::value &x, picojson::value &y)
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181

◆ operator-()

RegExp Xbyak::operator- ( const RegExp & e,
size_t disp )
inline

Definition at line 780 of file xbyak.h.

781{
782 RegExp ret = e;
783 ret.disp_ -= disp;
784 return ret;
785}

◆ operator|() [1/3]

template<class T >
T Xbyak::operator| ( const T & x,
const EvexModifierRounding & emr )

Definition at line 599 of file xbyak.h.

599{ T r(x); r.setRounding(emr.rounding); return r; }
#define T(meth, val, expected)

◆ operator|() [2/3]

template<class T >
T Xbyak::operator| ( const T & x,
const EvexModifierZero &  )

Definition at line 598 of file xbyak.h.

598{ T r(x); r.setZero(); return r; }

◆ operator|() [3/3]

template<class T >
T Xbyak::operator| ( const T & x,
const Opmask & k )

Definition at line 597 of file xbyak.h.

597{ T r(x); r.setOpmaskIdx(k.getIdx()); return r; }
int getIdx() const
Definition xbyak.h:398

Variable Documentation

◆ AutoGrow

void* const Xbyak::AutoGrow = (void*)1

Definition at line 788 of file xbyak.h.