orc-stdint.h   orc-stdint.h 
#ifndef _ORC_ORC_ORC_STDINT_H /* This file is intentionally nearly empty */
#define _ORC_ORC_ORC_STDINT_H 1
#ifndef _GENERATED_STDINT_H
#define _GENERATED_STDINT_H "orc 0.4.11"
/* generated using gnu compiler gcc (SUSE Linux) 4.4.1 [gcc-4_4-branch revi
sion 150839] */
#define _STDINT_HAVE_STDINT_H 1
#include <stdint.h>
#endif
#endif
 End of changes. 1 change blocks. 
lines changed or deleted lines changed or added


 orcarm.h   orcarm.h 
#ifndef _ORC_ARM_H_ #ifndef _ORC_ARM_H_
#define _ORC_ARM_H_ #define _ORC_ARM_H_
#include <orc/orcprogram.h> #include <orc/orcprogram.h>
ORC_BEGIN_DECLS
#ifdef ORC_ENABLE_UNSTABLE_API
typedef enum { typedef enum {
ORC_ARM_A1 = ORC_GP_REG_BASE+0, ORC_ARM_A1 = ORC_GP_REG_BASE+0,
ORC_ARM_A2, ORC_ARM_A2,
ORC_ARM_A3, ORC_ARM_A3,
ORC_ARM_A4, ORC_ARM_A4,
ORC_ARM_V1, ORC_ARM_V1,
ORC_ARM_V2, ORC_ARM_V2,
ORC_ARM_V3, ORC_ARM_V3,
ORC_ARM_V4, ORC_ARM_V4,
ORC_ARM_V5, ORC_ARM_V5,
skipping to change at line 321 skipping to change at line 325
#define orc_arm_emit_ssat_asr(p,cond,Rd,sat,Rm,sh) orc_arm_emit_sat(p,0, cond,Rd,sat,Rm,sh,1) #define orc_arm_emit_ssat_asr(p,cond,Rd,sat,Rm,sh) orc_arm_emit_sat(p,0, cond,Rd,sat,Rm,sh,1)
#define orc_arm_emit_usat_asr(p,cond,Rd,sat,Rm,sh) orc_arm_emit_sat(p,1, cond,Rd,sat,Rm,sh,1) #define orc_arm_emit_usat_asr(p,cond,Rd,sat,Rm,sh) orc_arm_emit_sat(p,1, cond,Rd,sat,Rm,sh,1)
#define orc_arm_emit_ssat16(p,cond,Rd,sat,Rm) orc_arm_emit_sat(p,2, cond,Rd,sat,Rm,0, 0) #define orc_arm_emit_ssat16(p,cond,Rd,sat,Rm) orc_arm_emit_sat(p,2, cond,Rd,sat,Rm,0, 0)
#define orc_arm_emit_usat16(p,cond,Rd,sat,Rm) orc_arm_emit_sat(p,3, cond,Rd,sat,Rm,0, 0) #define orc_arm_emit_usat16(p,cond,Rd,sat,Rm) orc_arm_emit_sat(p,3, cond,Rd,sat,Rm,0, 0)
/* reversing */ /* reversing */
#define orc_arm_emit_rev(p,cond,Rd,Rm) orc_arm_emit_rv (p,0, cond,Rd,Rm) #define orc_arm_emit_rev(p,cond,Rd,Rm) orc_arm_emit_rv (p,0, cond,Rd,Rm)
#define orc_arm_emit_rev16(p,cond,Rd,Rm) orc_arm_emit_rv (p,1, cond,Rd,Rm) #define orc_arm_emit_rev16(p,cond,Rd,Rm) orc_arm_emit_rv (p,1, cond,Rd,Rm)
#endif #endif
ORC_END_DECLS
#endif
 End of changes. 2 change blocks. 
0 lines changed or deleted 4 lines changed or added


 orcfunctions.h   orcfunctions.h 
skipping to change at line 34 skipping to change at line 34
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
typedef signed __int8 orc_int8; typedef signed __int8 orc_int8;
typedef signed __int16 orc_int16; typedef signed __int16 orc_int16;
typedef signed __int32 orc_int32; typedef signed __int32 orc_int32;
typedef signed __int64 orc_int64; typedef signed __int64 orc_int64;
typedef unsigned __int8 orc_uint8; typedef unsigned __int8 orc_uint8;
typedef unsigned __int16 orc_uint16; typedef unsigned __int16 orc_uint16;
typedef unsigned __int32 orc_uint32; typedef unsigned __int32 orc_uint32;
typedef unsigned __int64 orc_uint64; typedef unsigned __int64 orc_uint64;
#define ORC_UINT64_C(x) (x##Ui64) #define ORC_UINT64_C(x) (x##Ui64)
#define inline __inline
#else #else
#include <limits.h> #include <limits.h>
typedef signed char orc_int8; typedef signed char orc_int8;
typedef short orc_int16; typedef short orc_int16;
typedef int orc_int32; typedef int orc_int32;
typedef unsigned char orc_uint8; typedef unsigned char orc_uint8;
typedef unsigned short orc_uint16; typedef unsigned short orc_uint16;
typedef unsigned int orc_uint32; typedef unsigned int orc_uint32;
#if INT_MAX == LONG_MAX #if INT_MAX == LONG_MAX
typedef long long orc_int64; typedef long long orc_int64;
skipping to change at line 56 skipping to change at line 57
#else #else
typedef long orc_int64; typedef long orc_int64;
typedef unsigned long orc_uint64; typedef unsigned long orc_uint64;
#define ORC_UINT64_C(x) (x##UL) #define ORC_UINT64_C(x) (x##UL)
#endif #endif
#endif #endif
typedef union { orc_int16 i; orc_int8 x2[2]; } orc_union16; typedef union { orc_int16 i; orc_int8 x2[2]; } orc_union16;
typedef union { orc_int32 i; float f; orc_int16 x2[2]; orc_int8 x4[4]; } or c_union32; typedef union { orc_int32 i; float f; orc_int16 x2[2]; orc_int8 x4[4]; } or c_union32;
typedef union { orc_int64 i; double f; orc_int32 x2[2]; float x2f[2]; orc_i nt16 x4[4]; } orc_union64; typedef union { orc_int64 i; double f; orc_int32 x2[2]; float x2f[2]; orc_i nt16 x4[4]; } orc_union64;
#endif #endif
void orc_memcpy (void * d1, const void * s1, int n); #ifndef ORC_RESTRICT
void orc_memset (void * d1, int p1, int n); #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define ORC_RESTRICT restrict
#elif defined(__GNUC__) && __GNUC__ >= 4
#define ORC_RESTRICT __restrict__
#else
#define ORC_RESTRICT
#endif
#endif
void orc_memcpy (void * ORC_RESTRICT d1, const void * s1, int n);
void orc_memset (void * ORC_RESTRICT d1, int p1, int n);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 2 change blocks. 
2 lines changed or deleted 12 lines changed or added


 orcmmx.h   orcmmx.h 
#ifndef _ORC_MMX_H_ #ifndef _ORC_MMX_H_
#define _ORC_MMX_H_ #define _ORC_MMX_H_
#include <orc/orcx86.h> #include <orc/orcx86.h>
ORC_BEGIN_DECLS
typedef enum { typedef enum {
ORC_TARGET_MMX_MMX = (1<<0), ORC_TARGET_MMX_MMX = (1<<0),
ORC_TARGET_MMX_MMXEXT = (1<<1), ORC_TARGET_MMX_MMXEXT = (1<<1),
ORC_TARGET_MMX_3DNOW = (1<<2), ORC_TARGET_MMX_3DNOW = (1<<2),
ORC_TARGET_MMX_3DNOWEXT = (1<<3), ORC_TARGET_MMX_3DNOWEXT = (1<<3),
ORC_TARGET_MMX_SSSE3 = (1<<4), ORC_TARGET_MMX_SSSE3 = (1<<4),
ORC_TARGET_MMX_SSE4_1 = (1<<5), ORC_TARGET_MMX_SSE4_1 = (1<<5),
ORC_TARGET_MMX_SSE4_2 = (1<<6), ORC_TARGET_MMX_SSE4_2 = (1<<6),
ORC_TARGET_MMX_FRAME_POINTER = (1<<7), ORC_TARGET_MMX_FRAME_POINTER = (1<<7),
ORC_TARGET_MMX_SHORT_JUMPS = (1<<8), ORC_TARGET_MMX_SHORT_JUMPS = (1<<8),
ORC_TARGET_MMX_64BIT = (1<<9) ORC_TARGET_MMX_64BIT = (1<<9)
} OrcTargetMMXFlags; } OrcTargetMMXFlags;
#ifdef ORC_ENABLE_UNSTABLE_API
typedef enum { typedef enum {
X86_MM0 = ORC_VEC_REG_BASE, X86_MM0 = ORC_VEC_REG_BASE,
X86_MM1, X86_MM1,
X86_MM2, X86_MM2,
X86_MM3, X86_MM3,
X86_MM4, X86_MM4,
X86_MM5, X86_MM5,
X86_MM6, X86_MM6,
X86_MM7 X86_MM7
} OrcMMXRegister; } OrcMMXRegister;
skipping to change at line 210 skipping to change at line 214
#define orc_mmx_emit_pminud(p,a,b) orc_mmx_emit_660f (p, "pminud", 0x38 3b, a, b) #define orc_mmx_emit_pminud(p,a,b) orc_mmx_emit_660f (p, "pminud", 0x38 3b, a, b)
#define orc_mmx_emit_pmaxsb(p,a,b) orc_mmx_emit_660f (p, "pmaxsb", 0x38 3c, a, b) #define orc_mmx_emit_pmaxsb(p,a,b) orc_mmx_emit_660f (p, "pmaxsb", 0x38 3c, a, b)
#define orc_mmx_emit_pmaxsd(p,a,b) orc_mmx_emit_660f (p, "pmaxsd", 0x38 3d, a, b) #define orc_mmx_emit_pmaxsd(p,a,b) orc_mmx_emit_660f (p, "pmaxsd", 0x38 3d, a, b)
#define orc_mmx_emit_pmaxuw(p,a,b) orc_mmx_emit_660f (p, "pmaxuw", 0x38 3e, a, b) #define orc_mmx_emit_pmaxuw(p,a,b) orc_mmx_emit_660f (p, "pmaxuw", 0x38 3e, a, b)
#define orc_mmx_emit_pmaxud(p,a,b) orc_mmx_emit_660f (p, "pmaxud", 0x38 3f, a, b) #define orc_mmx_emit_pmaxud(p,a,b) orc_mmx_emit_660f (p, "pmaxud", 0x38 3f, a, b)
/* SSE4.2 instructions */ /* SSE4.2 instructions */
#define orc_mmx_emit_pcmpgtq(p,a,b) orc_mmx_emit_660f (p, "pcmpgtq", 0x3 837, a, b) #define orc_mmx_emit_pcmpgtq(p,a,b) orc_mmx_emit_660f (p, "pcmpgtq", 0x3 837, a, b)
#endif #endif
ORC_END_DECLS
#endif
 End of changes. 3 change blocks. 
0 lines changed or deleted 4 lines changed or added


 orcneon.h   orcneon.h 
#ifndef _ORC_NEON_H_ #ifndef _ORC_NEON_H_
#define _ORC_NEON_H_ #define _ORC_NEON_H_
#include <orc/orc.h> #include <orc/orc.h>
#include <orc/orcarm.h> #include <orc/orcarm.h>
ORC_BEGIN_DECLS
#ifdef ORC_ENABLE_UNSTABLE_API
const char *orc_neon_reg_name (int reg); const char *orc_neon_reg_name (int reg);
const char *orc_neon_reg_name_quad (int reg); const char *orc_neon_reg_name_quad (int reg);
void orc_neon_loadb (OrcCompiler *compiler, OrcVariable *var, int update); void orc_neon_loadb (OrcCompiler *compiler, OrcVariable *var, int update);
void orc_neon_loadw (OrcCompiler *compiler, OrcVariable *var, int update); void orc_neon_loadw (OrcCompiler *compiler, OrcVariable *var, int update);
void orc_neon_loadl (OrcCompiler *compiler, OrcVariable *var, int update); void orc_neon_loadl (OrcCompiler *compiler, OrcVariable *var, int update);
void orc_neon_loadq (OrcCompiler *compiler, int dest, int src1, int update, int is_aligned); void orc_neon_loadq (OrcCompiler *compiler, int dest, int src1, int update, int is_aligned);
void orc_neon_load_vec_aligned (OrcCompiler *compiler, OrcVariable *var, in t update); void orc_neon_load_vec_aligned (OrcCompiler *compiler, OrcVariable *var, in t update);
void orc_neon_load_vec_unaligned (OrcCompiler *compiler, OrcVariable *var, int update); void orc_neon_load_vec_unaligned (OrcCompiler *compiler, OrcVariable *var, int update);
skipping to change at line 35 skipping to change at line 39
void orc_neon_emit_loadib (OrcCompiler *p, int reg, int value); void orc_neon_emit_loadib (OrcCompiler *p, int reg, int value);
void orc_neon_emit_loadiw (OrcCompiler *p, int reg, int value); void orc_neon_emit_loadiw (OrcCompiler *p, int reg, int value);
void orc_neon_emit_loadil (OrcCompiler *p, int reg, int value); void orc_neon_emit_loadil (OrcCompiler *p, int reg, int value);
void orc_neon_emit_loadpb (OrcCompiler *p, int reg, int param); void orc_neon_emit_loadpb (OrcCompiler *p, int reg, int param);
void orc_neon_emit_loadpw (OrcCompiler *p, int reg, int param); void orc_neon_emit_loadpw (OrcCompiler *p, int reg, int param);
void orc_neon_emit_loadpl (OrcCompiler *p, int reg, int param); void orc_neon_emit_loadpl (OrcCompiler *p, int reg, int param);
void orc_neon_preload (OrcCompiler *compiler, OrcVariable *var, int write, void orc_neon_preload (OrcCompiler *compiler, OrcVariable *var, int write,
int offset); int offset);
#endif #endif
ORC_END_DECLS
#endif
 End of changes. 2 change blocks. 
0 lines changed or deleted 4 lines changed or added


 orconce.h   orconce.h 
#ifndef _ORC_ONCE_H_ #ifndef _ORC_ONCE_H_
#define _ORC_ONCE_H_ #define _ORC_ONCE_H_
#include <orc/orcutils.h>
ORC_BEGIN_DECLS
typedef struct _OrcMutex OrcMutex; typedef struct _OrcMutex OrcMutex;
typedef struct _OrcOnce OrcOnce; typedef struct _OrcOnce OrcOnce;
struct _OrcOnce { struct _OrcOnce {
int inited; int inited;
void *value; void *value;
}; };
void orc_once_mutex_lock (void); void orc_once_mutex_lock (void);
void orc_once_mutex_unlock (void); void orc_once_mutex_unlock (void);
ORC_END_DECLS
#endif #endif
 End of changes. 2 change blocks. 
0 lines changed or deleted 6 lines changed or added


 orcpowerpc.h   orcpowerpc.h 
#ifndef _ORC_POWERPC_H_ #ifndef _ORC_POWERPC_H_
#define _ORC_POWERPC_H_ #define _ORC_POWERPC_H_
#include <orc/orcprogram.h> #include <orc/orcprogram.h>
ORC_BEGIN_DECLS
#ifdef ORC_ENABLE_UNSTABLE_API
enum { enum {
POWERPC_R0 = ORC_GP_REG_BASE, POWERPC_R0 = ORC_GP_REG_BASE,
POWERPC_R1, POWERPC_R1,
POWERPC_R2, POWERPC_R2,
POWERPC_R3, POWERPC_R3,
POWERPC_R4, POWERPC_R4,
POWERPC_R5, POWERPC_R5,
POWERPC_R6, POWERPC_R6,
POWERPC_R7, POWERPC_R7,
POWERPC_R8, POWERPC_R8,
skipping to change at line 172 skipping to change at line 176
#define powerpc_emit_vsldoi(p,a,b,c,d) powerpc_emit_VX_3 (p, "vsldoi", 0x1000002c | (d<<6), a, b, c, d) #define powerpc_emit_vsldoi(p,a,b,c,d) powerpc_emit_VX_3 (p, "vsldoi", 0x1000002c | (d<<6), a, b, c, d)
#define powerpc_emit_vmladduhm(p,a,b,c,d) powerpc_emit_VA (p, "vmladduhm", 0x10000022, a, b, c, d) #define powerpc_emit_vmladduhm(p,a,b,c,d) powerpc_emit_VA (p, "vmladduhm", 0x10000022, a, b, c, d)
#define powerpc_emit_vupkhsb(p,a,b) powerpc_emit_VX_4 (p, "vupkhsb", 0x1000020e, a, b) #define powerpc_emit_vupkhsb(p,a,b) powerpc_emit_VX_4 (p, "vupkhsb", 0x1000020e, a, b)
#define powerpc_emit_vupkhsh(p,a,b) powerpc_emit_VX_4 (p, "vupkhsh", 0x1000024e, a, b) #define powerpc_emit_vupkhsh(p,a,b) powerpc_emit_VX_4 (p, "vupkhsh", 0x1000024e, a, b)
#define powerpc_emit_vperm(p,a,b,c,d) powerpc_emit_VA (p, "vperm", 0x1 000002b, a, b, c, d) #define powerpc_emit_vperm(p,a,b,c,d) powerpc_emit_VA (p, "vperm", 0x1 000002b, a, b, c, d)
#endif #endif
ORC_END_DECLS
#endif
 End of changes. 2 change blocks. 
0 lines changed or deleted 4 lines changed or added


 orcprogram.h   orcprogram.h 
#ifndef _ORC_PROGRAM_H_ #ifndef _ORC_PROGRAM_H_
#define _ORC_PROGRAM_H_ #define _ORC_PROGRAM_H_
#include <orc/orcutils.h> #include <orc/orcutils.h>
ORC_BEGIN_DECLS
typedef struct _OrcOpcodeExecutor OrcOpcodeExecutor; typedef struct _OrcOpcodeExecutor OrcOpcodeExecutor;
typedef struct _OrcExecutor OrcExecutor; typedef struct _OrcExecutor OrcExecutor;
typedef struct _OrcExecutorAlt OrcExecutorAlt; typedef struct _OrcExecutorAlt OrcExecutorAlt;
typedef struct _OrcVariable OrcVariable; typedef struct _OrcVariable OrcVariable;
typedef struct _OrcOpcodeSet OrcOpcodeSet; typedef struct _OrcOpcodeSet OrcOpcodeSet;
typedef struct _OrcStaticOpcode OrcStaticOpcode; typedef struct _OrcStaticOpcode OrcStaticOpcode;
typedef struct _OrcInstruction OrcInstruction; typedef struct _OrcInstruction OrcInstruction;
typedef struct _OrcProgram OrcProgram; typedef struct _OrcProgram OrcProgram;
typedef struct _OrcCompiler OrcCompiler; typedef struct _OrcCompiler OrcCompiler;
typedef struct _OrcRule OrcRule; typedef struct _OrcRule OrcRule;
skipping to change at line 53 skipping to change at line 55
#define ORC_STATIC_OPCODE_N_SRC 4 #define ORC_STATIC_OPCODE_N_SRC 4
#define ORC_STATIC_OPCODE_N_DEST 2 #define ORC_STATIC_OPCODE_N_DEST 2
#define ORC_OPCODE_N_ARGS 4 #define ORC_OPCODE_N_ARGS 4
#define ORC_N_TARGETS 10 #define ORC_N_TARGETS 10
#define ORC_N_RULE_SETS 10 #define ORC_N_RULE_SETS 10
#define ORC_MAX_VAR_SIZE 8 #define ORC_MAX_VAR_SIZE 8
#define ORC_STRUCT_OFFSET(struct_type, member) \
((long) ((unsigned int *) &((struct_type*) 0)->member))
#ifndef TRUE #ifndef TRUE
#define TRUE 1 #define TRUE 1
#endif #endif
#ifndef FALSE #ifndef FALSE
#define FALSE 0 #define FALSE 0
#endif #endif
#define ORC_ENABLE_ASM_CODE #define ORC_ENABLE_ASM_CODE
#ifdef ORC_ENABLE_ASM_CODE #ifdef ORC_ENABLE_ASM_CODE
#define ORC_ASM_CODE(compiler,...) orc_compiler_append_code(compiler, __VA_ ARGS__) #define ORC_ASM_CODE(compiler,...) orc_compiler_append_code(compiler, __VA_ ARGS__)
skipping to change at line 464 skipping to change at line 463
int loop_shift; int loop_shift;
int long_jumps; int long_jumps;
int use_frame_pointer; int use_frame_pointer;
char *asm_code; char *asm_code;
int asm_code_len; int asm_code_len;
int is_64bit; int is_64bit;
int tmpreg; int tmpreg;
int tmpreg2;
int exec_reg; int exec_reg;
int gp_tmpreg; int gp_tmpreg;
int insn_index; int insn_index;
int unroll_index; int unroll_index;
int need_mask_regs; int need_mask_regs;
int unroll_shift; int unroll_shift;
int alloc_loop_counter; int alloc_loop_counter;
int allow_gp_on_stack; int allow_gp_on_stack;
skipping to change at line 526 skipping to change at line 526
OrcProgram *program; OrcProgram *program;
int n; int n;
int counter1; int counter1;
int counter2; int counter2;
int counter3; int counter3;
void *arrays[ORC_N_VARIABLES]; void *arrays[ORC_N_VARIABLES];
int params[ORC_N_VARIABLES]; int params[ORC_N_VARIABLES];
int accumulators[4]; int accumulators[4];
/* exec pointer is stored in arrays[ORC_VAR_A1] */ /* exec pointer is stored in arrays[ORC_VAR_A1] */
/* OrcCode pointer is stored in arrays[ORC_VAR_A2] */
/* row pointers are stored in arrays[i+ORC_VAR_C1] */ /* row pointers are stored in arrays[i+ORC_VAR_C1] */
/* the stride for arrays[x] is stored in params[x] */ /* the stride for arrays[x] is stored in params[x] */
/* m is stored in params[ORC_VAR_A1] */ /* m is stored in params[ORC_VAR_A1] */
/* m_index is stored in params[ORC_VAR_A2] */ /* m_index is stored in params[ORC_VAR_A2] */
/* elapsed time is stored in params[ORC_VAR_A3] */ /* elapsed time is stored in params[ORC_VAR_A3] */
/* high half of params is stored in params[ORC_VAR_T1..] */ /* high half of params is stored in params[ORC_VAR_T1..] */
}; };
/* the alternate view of OrcExecutor */ /* the alternate view of OrcExecutor */
struct _OrcExecutorAlt { struct _OrcExecutorAlt {
/*< private >*/ /*< private >*/
OrcProgram *program; OrcProgram *program;
int n; int n;
int counter1; int counter1;
int counter2; int counter2;
int counter3; int counter3;
void *arrays[ORC_N_ARRAYS]; void *arrays[ORC_N_ARRAYS];
OrcExecutorFunc exec; OrcExecutorFunc exec;
void *unused1[ORC_N_VARIABLES - ORC_N_ARRAYS - 1]; OrcCode *code;
void *unused1[ORC_N_VARIABLES - ORC_N_ARRAYS - 2];
int strides[ORC_N_ARRAYS]; int strides[ORC_N_ARRAYS];
int m; int m;
int m_index; int m_index;
int time; int time;
int unused2; int unused2;
int unused4[8]; int unused4[8];
int params[ORC_VAR_T1-ORC_VAR_P1]; int params[ORC_VAR_T1-ORC_VAR_P1];
int params_hi[ORC_VAR_T1-ORC_VAR_P1]; int params_hi[ORC_VAR_T1-ORC_VAR_P1];
int unused3[ORC_N_VARIABLES - ORC_VAR_T9]; int unused3[ORC_N_VARIABLES - ORC_VAR_T9];
int accumulators[4]; int accumulators[4];
skipping to change at line 571 skipping to change at line 573
typedef struct _OrcCodeVariable OrcCodeVariable; typedef struct _OrcCodeVariable OrcCodeVariable;
struct _OrcCodeVariable { struct _OrcCodeVariable {
/*< private >*/ /*< private >*/
int vartype; int vartype;
int size; int size;
orc_union64 value; orc_union64 value;
}; };
struct _OrcCode { struct _OrcCode {
/*< public >*/
OrcExecutorFunc exec;
/*< private >*/ /*< private >*/
OrcCompileResult result; OrcCompileResult result;
char *name; char *name;
/* for execution */ /* for execution */
OrcExecutorFunc exec;
unsigned char *code; unsigned char *code;
int code_size; int code_size;
void *chunk; void *chunk;
/* for emulation */ /* for emulation */
int n_insns; int n_insns;
OrcInstruction *insns; OrcInstruction *insns;
OrcCodeVariable *vars; OrcCodeVariable *vars;
int is_2d; int is_2d;
int constant_n; int constant_n;
skipping to change at line 773 skipping to change at line 777
extern const char *_orc_cpu_name; extern const char *_orc_cpu_name;
extern int _orc_compiler_flag_backup; extern int _orc_compiler_flag_backup;
extern int _orc_compiler_flag_emulate; extern int _orc_compiler_flag_emulate;
extern int _orc_compiler_flag_debug; extern int _orc_compiler_flag_debug;
void orc_code_chunk_free (OrcCodeChunk *chunk); void orc_code_chunk_free (OrcCodeChunk *chunk);
#endif #endif
ORC_END_DECLS
#endif #endif
 End of changes. 8 change blocks. 
5 lines changed or deleted 11 lines changed or added


 orcsse.h   orcsse.h 
#ifndef _ORC_SSE_H_ #ifndef _ORC_SSE_H_
#define _ORC_SSE_H_ #define _ORC_SSE_H_
#include <orc/orcx86.h> #include <orc/orcx86.h>
#include <orc/orcx86insn.h>
ORC_BEGIN_DECLS
typedef enum { typedef enum {
ORC_TARGET_SSE_SSE2 = (1<<0), ORC_TARGET_SSE_SSE2 = (1<<0),
ORC_TARGET_SSE_SSE3 = (1<<1), ORC_TARGET_SSE_SSE3 = (1<<1),
ORC_TARGET_SSE_SSSE3 = (1<<2), ORC_TARGET_SSE_SSSE3 = (1<<2),
ORC_TARGET_SSE_SSE4_1 = (1<<3), ORC_TARGET_SSE_SSE4_1 = (1<<3),
ORC_TARGET_SSE_SSE4_2 = (1<<4), ORC_TARGET_SSE_SSE4_2 = (1<<4),
ORC_TARGET_SSE_SSE4A = (1<<5), ORC_TARGET_SSE_SSE4A = (1<<5),
ORC_TARGET_SSE_SSE5 = (1<<6), ORC_TARGET_SSE_SSE5 = (1<<6),
ORC_TARGET_SSE_FRAME_POINTER = (1<<7), ORC_TARGET_SSE_FRAME_POINTER = (1<<7),
ORC_TARGET_SSE_SHORT_JUMPS = (1<<8), ORC_TARGET_SSE_SHORT_JUMPS = (1<<8),
ORC_TARGET_SSE_64BIT = (1<<9) ORC_TARGET_SSE_64BIT = (1<<9)
}OrcTargetSSEFlags; }OrcTargetSSEFlags;
#ifdef ORC_ENABLE_UNSTABLE_API
typedef enum { typedef enum {
X86_XMM0 = ORC_VEC_REG_BASE, X86_XMM0 = ORC_VEC_REG_BASE,
X86_XMM1, X86_XMM1,
X86_XMM2, X86_XMM2,
X86_XMM3, X86_XMM3,
X86_XMM4, X86_XMM4,
X86_XMM5, X86_XMM5,
X86_XMM6, X86_XMM6,
X86_XMM7, X86_XMM7,
X86_XMM8, X86_XMM8,
skipping to change at line 61 skipping to change at line 66
void orc_x86_emit_mov_reg_sse (OrcCompiler *compiler, int reg1, int reg2); void orc_x86_emit_mov_reg_sse (OrcCompiler *compiler, int reg1, int reg2);
void orc_x86_emit_mov_sse_reg (OrcCompiler *compiler, int reg1, int reg2); void orc_x86_emit_mov_sse_reg (OrcCompiler *compiler, int reg1, int reg2);
void orc_sse_emit_loadib (OrcCompiler *p, int reg, int value); void orc_sse_emit_loadib (OrcCompiler *p, int reg, int value);
void orc_sse_emit_loadiw (OrcCompiler *p, int reg, int value); void orc_sse_emit_loadiw (OrcCompiler *p, int reg, int value);
void orc_sse_emit_loadil (OrcCompiler *p, int reg, int value); void orc_sse_emit_loadil (OrcCompiler *p, int reg, int value);
void orc_sse_emit_loadpb (OrcCompiler *p, int reg, int value); void orc_sse_emit_loadpb (OrcCompiler *p, int reg, int value);
void orc_sse_emit_loadpw (OrcCompiler *p, int reg, int value); void orc_sse_emit_loadpw (OrcCompiler *p, int reg, int value);
void orc_sse_emit_loadpl (OrcCompiler *p, int reg, int value); void orc_sse_emit_loadpl (OrcCompiler *p, int reg, int value);
void orc_sse_emit_loadpq (OrcCompiler *p, int reg, int value); void orc_sse_emit_loadpq (OrcCompiler *p, int reg, int value);
void orc_sse_emit_660f (OrcCompiler *p, const char *insn_name, int code,
int src, int dest);
void orc_sse_emit_f20f (OrcCompiler *p, const char *insn_name, int code,
int src, int dest);
void orc_sse_emit_f30f (OrcCompiler *p, const char *insn_name, int code,
int src, int dest);
void orc_sse_emit_0f (OrcCompiler *p, const char *insn_name, int code,
int src, int dest);
void orc_sse_emit_pshufd (OrcCompiler *p, int shuf, int src, int dest);
void orc_sse_emit_pshuflw (OrcCompiler *p, int shuf, int src, int dest);
void orc_sse_emit_pshufhw (OrcCompiler *p, int shuf, int src, int dest);
void orc_sse_emit_palignr (OrcCompiler *p, int align, int src, int dest);
void orc_sse_emit_pinsrw_memoffset (OrcCompiler *p, int imm, int offset, in
t src, int dest);
void orc_sse_emit_pextrw_memoffset (OrcCompiler *p, int imm, int src, int o
ffset, int dest);
void orc_sse_emit_shiftimm (OrcCompiler *p, const char *insn_name,
int code, int modrm_code, int shift, int reg);
void orc_sse_set_mxcsr (OrcCompiler *compiler); void orc_sse_set_mxcsr (OrcCompiler *compiler);
void orc_sse_restore_mxcsr (OrcCompiler *compiler); void orc_sse_restore_mxcsr (OrcCompiler *compiler);
void orc_sse_load_constant (OrcCompiler *compiler, int reg, int size, void orc_sse_load_constant (OrcCompiler *compiler, int reg, int size,
orc_uint64 value); orc_uint64 value);
unsigned int orc_sse_get_cpu_flags (void); #endif
/* SSE instructions */
/* SSE2 instructions */
#define orc_sse_emit_punpcklbw(p,a,b) orc_sse_emit_660f (p, "punpcklbw", 0
x60, a, b)
#define orc_sse_emit_punpcklwd(p,a,b) orc_sse_emit_660f (p, "punpcklwd", 0
x61, a, b)
#define orc_sse_emit_punpckldq(p,a,b) orc_sse_emit_660f (p, "punpckldq", 0
x62, a, b)
#define orc_sse_emit_packsswb(p,a,b) orc_sse_emit_660f (p, "packsswb", 0x
63, a, b)
#define orc_sse_emit_pcmpgtb(p,a,b) orc_sse_emit_660f (p, "pcmpgtb", 0x6
4, a, b)
#define orc_sse_emit_pcmpgtw(p,a,b) orc_sse_emit_660f (p, "pcmpgtw", 0x6
5, a, b)
#define orc_sse_emit_pcmpgtd(p,a,b) orc_sse_emit_660f (p, "pcmpgtd", 0x6
6, a, b)
#define orc_sse_emit_packuswb(p,a,b) orc_sse_emit_660f (p, "packuswb", 0x
67, a, b)
#define orc_sse_emit_punpckhbw(p,a,b) orc_sse_emit_660f (p, "punpckhbw", 0
x68, a, b)
#define orc_sse_emit_punpckhwd(p,a,b) orc_sse_emit_660f (p, "punpckhwd", 0
x69, a, b)
#define orc_sse_emit_punpckhdq(p,a,b) orc_sse_emit_660f (p, "punpckhdq", 0
x6a, a, b)
#define orc_sse_emit_packssdw(p,a,b) orc_sse_emit_660f (p, "packssdw", 0x
6b, a, b)
#define orc_sse_emit_punpcklqdq(p,a,b) orc_sse_emit_660f (p, "punpcklqdq",
0x6c, a, b)
#define orc_sse_emit_punpckhqdq(p,a,b) orc_sse_emit_660f (p, "punpckhqdq",
0x6d, a, b)
#define orc_sse_emit_movdqa(p,a,b) orc_sse_emit_660f (p, "movdqa", 0x6f
, a, b)
#define orc_sse_emit_psraw(p,a,b) orc_sse_emit_shiftimm (p, "psraw", 0
x71, 4, a, b)
#define orc_sse_emit_psrlw(p,a,b) orc_sse_emit_shiftimm (p, "psrlw", 0
x71, 2, a, b)
#define orc_sse_emit_psllw(p,a,b) orc_sse_emit_shiftimm (p, "psllw", 0
x71, 6, a, b)
#define orc_sse_emit_psrad(p,a,b) orc_sse_emit_shiftimm (p, "psrad", 0
x72, 4, a, b)
#define orc_sse_emit_psrld(p,a,b) orc_sse_emit_shiftimm (p, "psrld", 0
x72, 2, a, b)
#define orc_sse_emit_pslld(p,a,b) orc_sse_emit_shiftimm (p, "pslld", 0
x72, 6, a, b)
#define orc_sse_emit_psrlq(p,a,b) orc_sse_emit_shiftimm (p, "psrlq", 0
x73, 2, a, b)
#define orc_sse_emit_psllq(p,a,b) orc_sse_emit_shiftimm (p, "psllq", 0
x73, 6, a, b)
#define orc_sse_emit_psrldq(p,a,b) orc_sse_emit_shiftimm (p, "psrldq",
0x73, 3, a, b)
#define orc_sse_emit_pslldq(p,a,b) orc_sse_emit_shiftimm (p, "pslldq",
0x73, 7, a, b)
#define orc_sse_emit_psrlq_reg(p,a,b) orc_sse_emit_660f (p, "psrlq", 0
xd3, a, b)
#define orc_sse_emit_pcmpeqb(p,a,b) orc_sse_emit_660f (p, "pcmpeqb", 0x7
4, a, b)
#define orc_sse_emit_pcmpeqw(p,a,b) orc_sse_emit_660f (p, "pcmpeqw", 0x7
5, a, b)
#define orc_sse_emit_pcmpeqd(p,a,b) orc_sse_emit_660f (p, "pcmpeqd", 0x7
6, a, b)
#define orc_sse_emit_paddq(p,a,b) orc_sse_emit_660f (p, "paddq", 0xd4,
a, b)
#define orc_sse_emit_pmullw(p,a,b) orc_sse_emit_660f (p, "pmullw", 0xd5
, a, b)
#define orc_sse_emit_psubusb(p,a,b) orc_sse_emit_660f (p, "psubusb", 0xd
8, a, b)
#define orc_sse_emit_psubusw(p,a,b) orc_sse_emit_660f (p, "psubusw", 0xd
9, a, b)
#define orc_sse_emit_pminub(p,a,b) orc_sse_emit_660f (p, "pminub", 0xda
, a, b)
#define orc_sse_emit_pand(p,a,b) orc_sse_emit_660f (p, "pand", 0xdb,
a, b)
#define orc_sse_emit_paddusb(p,a,b) orc_sse_emit_660f (p, "paddusb", 0xd
c, a, b)
#define orc_sse_emit_paddusw(p,a,b) orc_sse_emit_660f (p, "paddusw", 0xd
d, a, b)
#define orc_sse_emit_pmaxub(p,a,b) orc_sse_emit_660f (p, "pmaxub", 0xde
, a, b)
#define orc_sse_emit_pandn(p,a,b) orc_sse_emit_660f (p, "pandn", 0xdf,
a, b)
#define orc_sse_emit_pavgb(p,a,b) orc_sse_emit_660f (p, "pavgb", 0xe0,
a, b)
#define orc_sse_emit_pavgw(p,a,b) orc_sse_emit_660f (p, "pavgw", 0xe3,
a, b)
#define orc_sse_emit_pmulhuw(p,a,b) orc_sse_emit_660f (p, "pmulhuw", 0x
e4, a, b)
#define orc_sse_emit_pmulhw(p,a,b) orc_sse_emit_660f (p, "pmulhw", 0xe5
, a, b)
#define orc_sse_emit_psubsb(p,a,b) orc_sse_emit_660f (p, "psubsb", 0xe8
, a, b)
#define orc_sse_emit_psubsw(p,a,b) orc_sse_emit_660f (p, "psubsw", 0xe9
, a, b)
#define orc_sse_emit_pminsw(p,a,b) orc_sse_emit_660f (p, "pminsw", 0xea
, a, b)
#define orc_sse_emit_por(p,a,b) orc_sse_emit_660f (p, "por", 0xeb, a
, b)
#define orc_sse_emit_paddsb(p,a,b) orc_sse_emit_660f (p, "paddsb", 0xec
, a, b)
#define orc_sse_emit_paddsw(p,a,b) orc_sse_emit_660f (p, "paddsw", 0xed
, a, b)
#define orc_sse_emit_pmaxsw(p,a,b) orc_sse_emit_660f (p, "pmaxsw", 0xee
, a, b)
#define orc_sse_emit_pxor(p,a,b) orc_sse_emit_660f (p, "pxor", 0xef,
a, b)
#define orc_sse_emit_pmuludq(p,a,b) orc_sse_emit_660f (p, "pmuludq", 0xf
4, a, b)
#define orc_sse_emit_pmaddwd(p,a,b) orc_sse_emit_660f (p, "pmaddwd", 0xf
5, a, b)
#define orc_sse_emit_psadbw(p,a,b) orc_sse_emit_660f (p, "psadbw", 0xf6
, a, b)
#define orc_sse_emit_psubb(p,a,b) orc_sse_emit_660f (p, "psubb", 0xf8,
a, b)
#define orc_sse_emit_psubw(p,a,b) orc_sse_emit_660f (p, "psubw", 0xf9,
a, b)
#define orc_sse_emit_psubd(p,a,b) orc_sse_emit_660f (p, "psubd", 0xfa,
a, b)
#define orc_sse_emit_psubq(p,a,b) orc_sse_emit_660f (p, "psubq", 0xfb,
a, b)
#define orc_sse_emit_paddb(p,a,b) orc_sse_emit_660f (p, "paddb", 0xfc,
a, b)
#define orc_sse_emit_paddw(p,a,b) orc_sse_emit_660f (p, "paddw", 0xfd,
a, b)
#define orc_sse_emit_paddd(p,a,b) orc_sse_emit_660f (p, "paddd", 0xfe,
a, b)
/* SSE3 instructions */
/* SSSE3 instructions */
#define orc_sse_emit_pshufb(p,a,b) orc_sse_emit_660f (p, "pshufb", 0x38
00, a, b)
#define orc_sse_emit_phaddw(p,a,b) orc_sse_emit_660f (p, "phaddw", 0x38
01, a, b)
#define orc_sse_emit_phaddd(p,a,b) orc_sse_emit_660f (p, "phaddd", 0x38
02, a, b)
#define orc_sse_emit_phaddsw(p,a,b) orc_sse_emit_660f (p, "phaddsw", 0x3
803, a, b)
#define orc_sse_emit_pmaddubsw(p,a,b) orc_sse_emit_660f (p, "pmaddubsw", 0
x3804, a, b)
#define orc_sse_emit_phsubw(p,a,b) orc_sse_emit_660f (p, "phsubw", 0x38
05, a, b)
#define orc_sse_emit_phsubd(p,a,b) orc_sse_emit_660f (p, "phsubd", 0x38
06, a, b)
#define orc_sse_emit_phsubsw(p,a,b) orc_sse_emit_660f (p, "phsubsw", 0x3
807, a, b)
#define orc_sse_emit_psignb(p,a,b) orc_sse_emit_660f (p, "psignb", 0x38
08, a, b)
#define orc_sse_emit_psignw(p,a,b) orc_sse_emit_660f (p, "psignw", 0x38
09, a, b)
#define orc_sse_emit_psignd(p,a,b) orc_sse_emit_660f (p, "psignd", 0x38
0a, a, b)
#define orc_sse_emit_pmulhrsw(p,a,b) orc_sse_emit_660f (p, "pmulhrsw", 0x
380b, a, b)
#define orc_sse_emit_pabsb(p,a,b) orc_sse_emit_660f (p, "pabsb", 0x381
c, a, b)
#define orc_sse_emit_pabsw(p,a,b) orc_sse_emit_660f (p, "pabsw", 0x381
d, a, b)
#define orc_sse_emit_pabsd(p,a,b) orc_sse_emit_660f (p, "pabsd", 0x381
e, a, b)
/* SSE4.1 instructions */
#define orc_sse_emit_pmovsxbw(p,a,b) orc_sse_emit_660f (p, "pmovsxbw", 0x
3820, a, b)
#define orc_sse_emit_pmovsxbd(p,a,b) orc_sse_emit_660f (p, "pmovsxbd", 0x
3821, a, b)
#define orc_sse_emit_pmovsxbq(p,a,b) orc_sse_emit_660f (p, "pmovsxbq", 0x
3822, a, b)
#define orc_sse_emit_pmovsxwd(p,a,b) orc_sse_emit_660f (p, "pmovsxwd", 0x
3823, a, b)
#define orc_sse_emit_pmovsxwq(p,a,b) orc_sse_emit_660f (p, "pmovsxwq", 0x
3824, a, b)
#define orc_sse_emit_pmovsxdq(p,a,b) orc_sse_emit_660f (p, "pmovsxdq", 0x
3825, a, b)
#define orc_sse_emit_pmuldq(p,a,b) orc_sse_emit_660f (p, "pmuldq", 0x38
28, a, b)
#define orc_sse_emit_pcmpeqq(p,a,b) orc_sse_emit_660f (p, "pcmpeqq", 0x3
829, a, b)
#define orc_sse_emit_packusdw(p,a,b) orc_sse_emit_660f (p, "packusdw", 0x
382b, a, b)
#define orc_sse_emit_pmovzxbw(p,a,b) orc_sse_emit_660f (p, "pmovzxbw", 0x
3830, a, b)
#define orc_sse_emit_pmovzxbd(p,a,b) orc_sse_emit_660f (p, "pmovzxbd", 0x
3831, a, b)
#define orc_sse_emit_pmovzxbq(p,a,b) orc_sse_emit_660f (p, "pmovzxbq", 0x
3832, a, b)
#define orc_sse_emit_pmovzxwd(p,a,b) orc_sse_emit_660f (p, "pmovzxwd", 0x
3833, a, b)
#define orc_sse_emit_pmovzxwq(p,a,b) orc_sse_emit_660f (p, "pmovzxwq", 0x
3834, a, b)
#define orc_sse_emit_pmovzxdq(p,a,b) orc_sse_emit_660f (p, "pmovzxdq", 0x
3835, a, b)
#define orc_sse_emit_pmulld(p,a,b) orc_sse_emit_660f (p, "pmulld", 0x38
40, a, b)
#define orc_sse_emit_phminposuw(p,a,b) orc_sse_emit_660f (p, "phminposuw",
0x3841, a, b)
#define orc_sse_emit_pminsb(p,a,b) orc_sse_emit_660f (p, "pminsb", 0x38 unsigned int orc_sse_get_cpu_flags (void);
38, a, b)
#define orc_sse_emit_pminsd(p,a,b) orc_sse_emit_660f (p, "pminsd", 0x38
39, a, b)
#define orc_sse_emit_pminuw(p,a,b) orc_sse_emit_660f (p, "pminuw", 0x38
3a, a, b)
#define orc_sse_emit_pminud(p,a,b) orc_sse_emit_660f (p, "pminud", 0x38
3b, a, b)
#define orc_sse_emit_pmaxsb(p,a,b) orc_sse_emit_660f (p, "pmaxsb", 0x38
3c, a, b)
#define orc_sse_emit_pmaxsd(p,a,b) orc_sse_emit_660f (p, "pmaxsd", 0x38
3d, a, b)
#define orc_sse_emit_pmaxuw(p,a,b) orc_sse_emit_660f (p, "pmaxuw", 0x38
3e, a, b)
#define orc_sse_emit_pmaxud(p,a,b) orc_sse_emit_660f (p, "pmaxud", 0x38
3f, a, b)
/* SSE4.2 instructions */ ORC_END_DECLS
#define orc_sse_emit_pcmpgtq(p,a,b) orc_sse_emit_660f (p, "pcmpgtq", 0x3
837, a, b)
#endif #endif
 End of changes. 6 change blocks. 
251 lines changed or deleted 8 lines changed or added


 orcutils.h   orcutils.h 
skipping to change at line 33 skipping to change at line 33
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef _ORC_UTILS_H_ #ifndef _ORC_UTILS_H_
#define _ORC_UTILS_H_ #define _ORC_UTILS_H_
#ifndef _ORC_INTEGER_TYPEDEFS_ #ifndef _ORC_INTEGER_TYPEDEFS_
#define _ORC_INTEGER_TYPEDEFS_ #define _ORC_INTEGER_TYPEDEFS_
#if defined(_x_STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L #if defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L
#include <stdint.h> #include <stdint.h>
typedef int8_t orc_int8; typedef int8_t orc_int8;
typedef int16_t orc_int16; typedef int16_t orc_int16;
typedef int32_t orc_int32; typedef int32_t orc_int32;
typedef int64_t orc_int64; typedef int64_t orc_int64;
typedef uint8_t orc_uint8; typedef uint8_t orc_uint8;
typedef uint16_t orc_uint16; typedef uint16_t orc_uint16;
typedef uint32_t orc_uint32; typedef uint32_t orc_uint32;
typedef uint64_t orc_uint64; typedef uint64_t orc_uint64;
typedef intptr_t orc_intptr;
#define ORC_UINT64_C(x) UINT64_C(x) #define ORC_UINT64_C(x) UINT64_C(x)
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
typedef signed __int8 orc_int8; typedef signed __int8 orc_int8;
typedef signed __int16 orc_int16; typedef signed __int16 orc_int16;
typedef signed __int32 orc_int32; typedef signed __int32 orc_int32;
typedef signed __int64 orc_int64; typedef signed __int64 orc_int64;
typedef unsigned __int8 orc_uint8; typedef unsigned __int8 orc_uint8;
typedef unsigned __int16 orc_uint16; typedef unsigned __int16 orc_uint16;
typedef unsigned __int32 orc_uint32; typedef unsigned __int32 orc_uint32;
typedef unsigned __int64 orc_uint64; typedef unsigned __int64 orc_uint64;
#ifdef _WIN64
typedef unsigned __int64 orc_intptr;
#else
typedef unsigned long orc_intptr;
#endif
#define ORC_UINT64_C(x) (x##Ui64) #define ORC_UINT64_C(x) (x##Ui64)
#else #else
#include <limits.h> #include <limits.h>
typedef signed char orc_int8; typedef signed char orc_int8;
typedef short orc_int16; typedef short orc_int16;
typedef int orc_int32; typedef int orc_int32;
typedef unsigned char orc_uint8; typedef unsigned char orc_uint8;
typedef unsigned short orc_uint16; typedef unsigned short orc_uint16;
typedef unsigned int orc_uint32; typedef unsigned int orc_uint32;
#if INT_MAX == LONG_MAX #if INT_MAX == LONG_MAX
typedef long long orc_int64; typedef long long orc_int64;
typedef unsigned long long orc_uint64; typedef unsigned long long orc_uint64;
#define ORC_UINT64_C(x) (x##ULL) #define ORC_UINT64_C(x) (x##ULL)
#else #else
typedef long orc_int64; typedef long orc_int64;
typedef unsigned long orc_uint64; typedef unsigned long orc_uint64;
#define ORC_UINT64_C(x) (x##UL) #define ORC_UINT64_C(x) (x##UL)
#endif #endif
#ifdef _WIN64
typedef unsigned __int64 orc_intptr;
#else
typedef unsigned long orc_intptr;
#endif
#endif #endif
typedef union { orc_int16 i; orc_int8 x2[2]; } orc_union16; typedef union { orc_int16 i; orc_int8 x2[2]; } orc_union16;
typedef union { orc_int32 i; float f; orc_int16 x2[2]; orc_int8 x4[4]; } or c_union32; typedef union { orc_int32 i; float f; orc_int16 x2[2]; orc_int8 x4[4]; } or c_union32;
typedef union { orc_int64 i; double f; orc_int32 x2[2]; float x2f[2]; orc_i nt16 x4[4]; } orc_union64; typedef union { orc_int64 i; double f; orc_int32 x2[2]; float x2f[2]; orc_i nt16 x4[4]; } orc_union64;
#endif #endif
#ifndef TRUE #ifndef TRUE
#define TRUE 1 #define TRUE 1
#endif #endif
#ifndef FALSE #ifndef FALSE
#define FALSE 0 #define FALSE 0
#endif #endif
typedef unsigned int orc_bool; typedef unsigned int orc_bool;
#define ORC_PTR_TO_INT(x) ((int)(orc_intptr)(x))
#define ORC_PTR_OFFSET(ptr,offset) ((void *)(((unsigned char *)(ptr)) + (of
fset)))
#define ORC_STRUCT_OFFSET(struct_type, member) \
(ORC_PTR_TO_INT((unsigned char *) &((struct_type*) 0)->member))
#ifdef ORC_ENABLE_UNSTABLE_API #ifdef ORC_ENABLE_UNSTABLE_API
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
#ifndef MIN #ifndef MIN
#define MIN(a,b) ((a)<(b) ? (a) : (b)) #define MIN(a,b) ((a)<(b) ? (a) : (b))
#endif #endif
#ifndef MAX #ifndef MAX
#define MAX(a,b) ((a)>(b) ? (a) : (b)) #define MAX(a,b) ((a)>(b) ? (a) : (b))
#endif #endif
#ifndef ORC_CLAMP #ifndef ORC_CLAMP
#define ORC_CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x))) #define ORC_CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x)))
#endif #endif
#define ORC_PTR_TO_INT(x) ((int)(long)(x))
#define ORC_PTR_OFFSET(ptr,offset) ((void *)(((unsigned char *)(ptr)) + (of
fset)))
#define ORC_READ_UINT32_LE(ptr) \ #define ORC_READ_UINT32_LE(ptr) \
((orc_uint32)( \ ((orc_uint32)( \
((orc_uint8 *)(ptr))[0] | \ ((orc_uint8 *)(ptr))[0] | \
(((orc_uint8 *)(ptr))[1]<<8) | \ (((orc_uint8 *)(ptr))[1]<<8) | \
(((orc_uint8 *)(ptr))[2]<<16) | \ (((orc_uint8 *)(ptr))[2]<<16) | \
(((orc_uint8 *)(ptr))[3]<<24))) (((orc_uint8 *)(ptr))[3]<<24)))
#define ORC_WRITE_UINT32_LE(ptr,val) \ #define ORC_WRITE_UINT32_LE(ptr,val) \
do { \ do { \
 End of changes. 6 change blocks. 
4 lines changed or deleted 18 lines changed or added


 orcx86.h   orcx86.h 
#ifndef _ORC_X86_H_ #ifndef _ORC_X86_H_
#define _ORC_X86_H_ #define _ORC_X86_H_
#include <orc/orcprogram.h> #include <orc/orcprogram.h>
#include <orc/orcx86insn.h>
ORC_BEGIN_DECLS
#ifdef ORC_ENABLE_UNSTABLE_API
enum { enum {
X86_EAX = ORC_GP_REG_BASE, X86_EAX = ORC_GP_REG_BASE,
X86_ECX, X86_ECX,
X86_EDX, X86_EDX,
X86_EBX, X86_EBX,
X86_ESP, X86_ESP,
X86_EBP, X86_EBP,
X86_ESI, X86_ESI,
X86_EDI, X86_EDI,
skipping to change at line 45 skipping to change at line 50
ORC_X86_SANDY_BRIDGE, ORC_X86_SANDY_BRIDGE,
ORC_X86_K5, ORC_X86_K5,
ORC_X86_K6, ORC_X86_K6,
ORC_X86_K7, ORC_X86_K7,
ORC_X86_K8, ORC_X86_K8,
ORC_X86_K10 ORC_X86_K10
}; };
const char * orc_x86_get_regname(int i); const char * orc_x86_get_regname(int i);
int orc_x86_get_regnum(int i); int orc_x86_get_regnum(int i);
const char * orc_x86_get_regname_8(int i);
const char * orc_x86_get_regname_16(int i); const char * orc_x86_get_regname_16(int i);
const char * orc_x86_get_regname_64(int i); const char * orc_x86_get_regname_64(int i);
const char * orc_x86_get_regname_ptr(OrcCompiler *compiler, int i); const char * orc_x86_get_regname_ptr(OrcCompiler *compiler, int i);
const char * orc_x86_get_regname_size(int i, int size);
void orc_x86_emit_push (OrcCompiler *compiler, int size, int reg); void orc_x86_emit_push (OrcCompiler *compiler, int size, int reg);
void orc_x86_emit_pop (OrcCompiler *compiler, int size, int reg); void orc_x86_emit_pop (OrcCompiler *compiler, int size, int reg);
#define orc_x86_emit_mov_imm_reg(p,size,value,reg) \
orc_x86_emit_cpuinsn_imm_reg (p, ORC_X86_mov_imm32_r, size, value, reg)
#define orc_x86_emit_mov_reg_reg(p,size,src,dest) \
orc_x86_emit_cpuinsn (p, ORC_X86_mov_r_rm, size, src, dest)
#define orc_x86_emit_test_reg_reg(p,size,src,dest) \
orc_x86_emit_cpuinsn (p, ORC_X86_test, size, src, dest)
#define orc_x86_emit_sar_imm_reg(p,size,value,reg) do { \
if (value == 1) { \
orc_x86_emit_cpuinsn_imm_reg (p, ORC_X86_sar, size, value, reg); \
} else if (value > 1) { \
orc_x86_emit_cpuinsn_imm_reg (p, ORC_X86_sar_imm, size, value, reg);
\
} \
} while (0)
#define orc_x86_emit_and_imm_memoffset(p,size,value,offset,reg) \
orc_x86_emit_cpuinsn_imm_memoffset (p, (value >= -128 && value < 128) ? \
ORC_X86_and_imm8_rm : ORC_X86_and_imm32_rm, size, value, offset, reg)
#define orc_x86_emit_and_imm_reg(p,size,value,reg) do { \
if ((value) >= -128 && (value) < 128) { \
orc_x86_emit_cpuinsn_imm_reg (p, ORC_X86_and_imm8_rm, size, value, reg)
; \
} else { \
if ((reg) == X86_EAX) { \
orc_x86_emit_cpuinsn_imm_reg (p, ORC_X86_and_imm32_a, size, value, re
g); \
} else { \
orc_x86_emit_cpuinsn_imm_reg (p, ORC_X86_and_imm32_rm, size, value, r
eg); \
} \
} \
} while (0)
#define orc_x86_emit_add_imm_memoffset(p,size,value,offset,reg) \
orc_x86_emit_cpuinsn_imm_memoffset (p, (value >= -128 && value < 128) ? \
ORC_X86_add_imm8_rm : ORC_X86_add_imm32_rm, size, value, offset, reg)
#define orc_x86_emit_add_reg_memoffset(p,size,src,offset,dest) \
orc_x86_emit_cpuinsn_reg_memoffset(p, ORC_X86_add_r_rm, src, offset, dest
)
#define orc_x86_emit_add_reg_reg(p,size,src,dest) \
orc_x86_emit_cpuinsn(p, ORC_X86_add_r_rm, size, src, dest)
#define orc_x86_emit_add_memoffset_reg(p,size,offset,src,dest) \
orc_x86_emit_cpuinsn_memoffset_reg(p, ORC_X86_add_rm_r, size, offset, src
, dest)
#define orc_x86_emit_sub_reg_reg(p,size,src,dest) \
orc_x86_emit_cpuinsn(p, ORC_X86_sub_r_rm, size, src, dest)
#define orc_x86_emit_sub_memoffset_reg(p,size,offset,src,dest) \
orc_x86_emit_cpuinsn_memoffset_reg(p, ORC_X86_sub_rm_r, size, offset, src
, dest)
#define orc_x86_emit_imul_memoffset_reg(p,size,offset,src,dest) \
orc_x86_emit_cpuinsn_memoffset_reg(p, ORC_X86_imul_rm_r, size, offset, sr
c, dest)
#define orc_x86_emit_cmp_reg_memoffset(p,size,src,offset,dest) \
orc_x86_emit_cpuinsn_reg_memoffset(p, ORC_X86_cmp_r_rm, src, offset, dest
)
#define orc_x86_emit_jmp(p,label) \
orc_x86_emit_cpuinsn_branch (p, ORC_X86_jmp, label)
#define orc_x86_emit_jg(p,label) \
orc_x86_emit_cpuinsn_branch (p, ORC_X86_jg, label)
#define orc_x86_emit_jle(p,label) \
orc_x86_emit_cpuinsn_branch (p, ORC_X86_jle, label)
#define orc_x86_emit_je(p,label) \
orc_x86_emit_cpuinsn_branch (p, ORC_X86_jz, label)
#define orc_x86_emit_jne(p,label) \
orc_x86_emit_cpuinsn_branch (p, ORC_X86_jnz, label)
#define orc_x86_emit_label(p,label) \
orc_x86_emit_cpuinsn_label (p, ORC_X86_LABEL, label)
#define orc_x86_emit_emms(p) \
orc_x86_emit_cpuinsn_none (p, ORC_X86_emms)
#define orc_x86_emit_rdtsc(p) \
orc_x86_emit_cpuinsn_none (p, ORC_X86_rdtsc)
#define orc_x86_emit_ret(p) \
orc_x86_emit_cpuinsn_none (p, ((p)->is_64bit) ? ORC_X86_retq : ORC_X86_re
t)
#define orc_x86_emit_test_imm_memoffset(p,size,value,offset,dest) \
orc_x86_emit_cpuinsn_imm_memoffset (p, ORC_X86_test_imm, size, value, \
offset, dest)
void orc_x86_emit_mov_memoffset_reg (OrcCompiler *compiler, int size, int o ffset, int reg1, int reg2); void orc_x86_emit_mov_memoffset_reg (OrcCompiler *compiler, int size, int o ffset, int reg1, int reg2);
void orc_x86_emit_mov_reg_memoffset (OrcCompiler *compiler, int size, int r eg1, int offset, int reg2); void orc_x86_emit_mov_reg_memoffset (OrcCompiler *compiler, int size, int r eg1, int offset, int reg2);
void orc_x86_emit_mov_imm_reg (OrcCompiler *compiler, int size, int value,
int reg1);
void orc_x86_emit_mov_reg_reg (OrcCompiler *compiler, int size, int reg1, i
nt reg2);
void orc_x86_emit_test_reg_reg (OrcCompiler *compiler, int size, int reg1,
int reg2);
void orc_x86_emit_sar_imm_reg (OrcCompiler *compiler, int size, int value,
int reg);
void orc_x86_emit_dec_memoffset (OrcCompiler *compiler, int size, int offse t, int reg); void orc_x86_emit_dec_memoffset (OrcCompiler *compiler, int size, int offse t, int reg);
void orc_x86_emit_add_imm_memoffset (OrcCompiler *compiler, int size, int v
alue, int offset, int reg);
void orc_x86_emit_add_reg_memoffset (OrcCompiler *compiler, int size, int r
eg1, int offset, int reg);
void orc_x86_emit_and_imm_memoffset (OrcCompiler *compiler, int size, int v
alue, int offset, int reg);
void orc_x86_emit_add_imm_reg (OrcCompiler *compiler, int size, int value, int reg, orc_bool record); void orc_x86_emit_add_imm_reg (OrcCompiler *compiler, int size, int value, int reg, orc_bool record);
void orc_x86_emit_and_imm_reg (OrcCompiler *compiler, int size, int value,
int reg);
void orc_x86_emit_or_imm_reg (OrcCompiler *compiler, int size, int value, i
nt reg);
void orc_x86_emit_add_reg_reg_shift (OrcCompiler *compiler, int size, int r eg1, int reg2, int shift); void orc_x86_emit_add_reg_reg_shift (OrcCompiler *compiler, int size, int r eg1, int reg2, int shift);
void orc_x86_emit_add_reg_reg (OrcCompiler *compiler, int size, int reg1, i
nt reg2);
void orc_x86_emit_sub_reg_reg (OrcCompiler *compiler, int size, int reg1, i
nt reg2);
void orc_x86_emit_imul_memoffset_reg (OrcCompiler *compiler, int size,
int offset, int reg, int destreg);
void orc_x86_emit_add_memoffset_reg (OrcCompiler *compiler, int size,
int offset, int reg, int destreg);
void orc_x86_emit_sub_memoffset_reg (OrcCompiler *compiler, int size,
int offset, int reg, int destreg);
void orc_x86_emit_cmp_reg_memoffset (OrcCompiler *compiler, int size, int r
eg1,
int offset, int reg);
void orc_x86_emit_cmp_imm_memoffset (OrcCompiler *compiler, int size, int v alue, void orc_x86_emit_cmp_imm_memoffset (OrcCompiler *compiler, int size, int v alue,
int offset, int reg); int offset, int reg);
void orc_x86_emit_cmp_imm_reg (OrcCompiler *compiler, int size, int value, int reg); void orc_x86_emit_cmp_imm_reg (OrcCompiler *compiler, int size, int value, int reg);
void orc_x86_emit_test_imm_memoffset (OrcCompiler *compiler, int size, int
value,
int offset, int reg);
void orc_x86_emit_emms (OrcCompiler *compiler);
void orc_x86_emit_rdtsc (OrcCompiler *compiler);
void orc_x86_emit_rep_movs (OrcCompiler *compiler, int size); void orc_x86_emit_rep_movs (OrcCompiler *compiler, int size);
void orc_x86_emit_ret (OrcCompiler *compiler);
void orc_x86_emit_jle (OrcCompiler *compiler, int label);
void orc_x86_emit_jg (OrcCompiler *compiler, int label);
void orc_x86_emit_je (OrcCompiler *compiler, int label);
void orc_x86_emit_jne (OrcCompiler *compiler, int label);
void orc_x86_emit_jmp (OrcCompiler *compiler, int label);
void orc_x86_emit_label (OrcCompiler *compiler, int label);
void orc_x86_emit_align (OrcCompiler *compiler); void orc_x86_emit_align (OrcCompiler *compiler);
void orc_x86_emit_prologue (OrcCompiler *compiler); void orc_x86_emit_prologue (OrcCompiler *compiler);
void orc_x86_emit_epilogue (OrcCompiler *compiler); void orc_x86_emit_epilogue (OrcCompiler *compiler);
void orc_x86_emit_rex (OrcCompiler *compiler, int size, int reg1, int reg2, int reg3); void orc_x86_emit_rex (OrcCompiler *compiler, int size, int reg1, int reg2, int reg3);
void orc_x86_emit_modrm_memoffset (OrcCompiler *compiler, int reg1, int off void orc_x86_emit_modrm_memoffset_old (OrcCompiler *compiler, int reg1, int
set, int reg2); offset, int reg2);
void orc_x86_emit_modrm_memoffset (OrcCompiler *compiler, int offset, int r
eg1, int reg2);
void orc_x86_emit_modrm_reg (OrcCompiler *compiler, int reg1, int reg2); void orc_x86_emit_modrm_reg (OrcCompiler *compiler, int reg1, int reg2);
void orc_x86_emit_modrm_memindex (OrcCompiler *compiler, int reg1, int offs et, void orc_x86_emit_modrm_memindex (OrcCompiler *compiler, int reg1, int offs et,
int reg2, int regindex, int shift); int reg2, int regindex, int shift);
void orc_x86_emit_modrm_memindex2 (OrcCompiler *compiler, int offset,
int src, int src_index, int shift, int dest);
void x86_add_fixup (OrcCompiler *compiler, unsigned char *ptr, int label, i
nt type);
void x86_add_label (OrcCompiler *compiler, unsigned char *ptr, int label);
void orc_x86_do_fixups (OrcCompiler *compiler); void orc_x86_do_fixups (OrcCompiler *compiler);
int orc_x86_assemble_copy_check (OrcCompiler *compiler); int orc_x86_assemble_copy_check (OrcCompiler *compiler);
void orc_x86_assemble_copy (OrcCompiler *compiler); void orc_x86_assemble_copy (OrcCompiler *compiler);
void orc_x86_emit_cpuinsn (OrcCompiler *p, int opcode, int src, int dest,
int imm);
void orc_x86_emit_cpuinsn_load_memoffset (OrcCompiler *p, int size, int ind
ex,
int offset, int src, int dest, int imm);
void orc_x86_emit_cpuinsn_store_memoffset (OrcCompiler *p, int size, int in
dex,
int src, int offset, int dest, int imm);
void orc_x86_emit_cpuinsn_load_memindex (OrcCompiler *p, int index, int siz
e,
int imm, int offset, int src, int src_index, int shift, int dest);
void orc_x86_emit_cpuinsn_load_register (OrcCompiler *p, int index, int imm
,
int src, int dest);
void orc_x86_emit_cpuinsn_imm_reg (OrcCompiler *p, int index, int size, int
imm,
int dest);
void orc_x86_emit_cpuinsn_imm_memoffset (OrcCompiler *p, int index, int siz
e,
int imm, int offset, int dest);
void orc_x86_emit_cpuinsn_reg_memoffset (OrcCompiler *p, int index, int src
,
int offset, int dest);
void orc_x86_emit_cpuinsn_memoffset_reg (OrcCompiler *p, int index, int siz
e,
int offset, int src, int dest);
void orc_x86_emit_cpuinsn_branch (OrcCompiler *p, int index, int label);
void orc_x86_emit_cpuinsn_label (OrcCompiler *p, int index, int label);
void orc_x86_emit_cpuinsn_none (OrcCompiler *p, int index);
#endif
ORC_END_DECLS
#endif #endif
 End of changes. 14 change blocks. 
45 lines changed or deleted 132 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/