"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
<bookinfo>
- <title>orc Reference Manual</title>
+ <title>Orc Reference Manual</title>
<releaseinfo>
- for orc [VERSION]
+ for Orc [VERSION]
The latest version of this documentation can be found on-line at
<ulink role="online-location" url="http://[SERVER]/orc/index.html">http://[SERVER]/orc/</ulink>.
</releaseinfo>
<SECTION>
<FILE>orcsse</FILE>
+OrcSSERegister
+OrcTargetSSEFlags
ORC_SSE_SHUF
orc_sse_emit_0f
orc_sse_emit_660f
<SECTION>
<FILE>orcmmx</FILE>
+OrcMMXRegister
+OrcTargetMMXFlags
ORC_MMX_SHUF
orc_mmx_emit_0f
orc_mmx_emit_660f
#include <orc/orcprogram.h>
+/**
+ * SECTION:orc
+ * @title: Orc
+ * @short_description: Library Initialization
+ */
+
void _orc_debug_init(void);
void
#define _ORC_ORC_H_
#include <orc/orcprogram.h>
+#include <orc-stdint.h>
+#include <orcarm.h>
+#include <orcdebug.h>
+#include <orcmmx.h>
+#include <orcparse.h>
+#include <orcprogram.h>
+#include <orcsse.h>
+#include <orcutils.h>
+#include <orcx86.h>
#endif
#include <orc/orcx86.h>
-enum {
+typedef enum {
+ ORC_TARGET_MMX_MMX = (1<<0),
+ ORC_TARGET_MMX_MMXEXT = (1<<1),
+ ORC_TARGET_MMX_3DNOW = (1<<2),
+ ORC_TARGET_MMX_3DNOWEXT = (1<<3),
+ ORC_TARGET_MMX_SSSE3 = (1<<4),
+ ORC_TARGET_MMX_FRAME_POINTER = (1<<7),
+ ORC_TARGET_MMX_SHORT_JUMPS = (1<<8),
+ ORC_TARGET_MMX_64BIT = (1<<9)
+} OrcTargetMMXFlags;
+
+typedef enum {
X86_MM0 = ORC_VEC_REG_BASE,
X86_MM1,
X86_MM2,
X86_MM5,
X86_MM6,
X86_MM7
-};
+} OrcMMXRegister;
#define ORC_MMX_SHUF(a,b,c,d) ((((a)&3)<<6)|(((b)&3)<<4)|(((c)&3)<<2)|(((d)&3)<<0))
{
int i;
- if (compiler->target_flags & ORC_TARGET_SSE_64BIT) {
+ if (compiler->target_flags & ORC_TARGET_MMX_64BIT) {
compiler->is_64bit = TRUE;
}
- if (compiler->target_flags & ORC_TARGET_SSE_FRAME_POINTER) {
+ if (compiler->target_flags & ORC_TARGET_MMX_FRAME_POINTER) {
compiler->use_frame_pointer = TRUE;
}
- if (!(compiler->target_flags & ORC_TARGET_SSE_SHORT_JUMPS)) {
+ if (!(compiler->target_flags & ORC_TARGET_MMX_SHORT_JUMPS)) {
compiler->long_jumps = TRUE;
}
};
enum {
- ORC_TARGET_SSE_SSE2 = (1<<0),
- ORC_TARGET_SSE_SSE3 = (1<<1),
- ORC_TARGET_SSE_SSSE3 = (1<<2),
- ORC_TARGET_SSE_SSE4_1 = (1<<3),
- ORC_TARGET_SSE_SSE4_2 = (1<<4),
- ORC_TARGET_SSE_SSE4A = (1<<5),
- ORC_TARGET_SSE_SSE5 = (1<<6),
- ORC_TARGET_SSE_FRAME_POINTER = (1<<7),
- ORC_TARGET_SSE_SHORT_JUMPS = (1<<8),
- ORC_TARGET_SSE_64BIT = (1<<9)
-};
-
-enum {
- ORC_TARGET_MMX_MMX = (1<<0),
- ORC_TARGET_MMX_MMXEXT = (1<<1),
- ORC_TARGET_MMX_3DNOW = (1<<2),
- ORC_TARGET_MMX_3DNOWEXT = (1<<3),
- ORC_TARGET_MMX_SSSE3 = (1<<4),
- ORC_TARGET_MMX_FRAME_POINTER = (1<<7),
- ORC_TARGET_MMX_SHORT_JUMPS = (1<<8),
- ORC_TARGET_MMX_64BIT = (1<<9)
-};
-
-enum {
ORC_TARGET_ALTIVEC_ALTIVEC = (1<<0)
};
#define ORC_COMPILE_RESULT_IS_FATAL(x) ((x) >= 0x200)
struct _OrcVariable {
+ /*< private >*/
char *name;
int size;
};
struct _OrcRule {
+ /*< private >*/
OrcRuleEmitFunc emit;
void *emit_user;
};
struct _OrcRuleSet {
+ /*< private >*/
OrcOpcodeSet *opcode_set;
int required_target_flags;
};
struct _OrcOpcodeSet {
+ /*< private >*/
int opcode_major;
char prefix[8];
};
struct _OrcInstruction {
+ /*< private >*/
OrcStaticOpcode *opcode;
int dest_args[ORC_STATIC_OPCODE_N_DEST];
int src_args[ORC_STATIC_OPCODE_N_SRC];
};
struct _OrcConstant {
+ /*< private >*/
int type;
int alloc_reg;
unsigned int value;
};
struct _OrcFixup {
+ /*< private >*/
unsigned char *ptr;
int type;
int label;
};
struct _OrcProgram {
+ /*< private >*/
OrcInstruction insns[ORC_N_INSNS];
int n_insns;
OrcVariable vars[ORC_N_VARIABLES];
- //int n_vars;
int n_src_vars;
int n_dest_vars;
int n_param_vars;
};
struct _OrcCompiler {
+ /*< private >*/
OrcProgram *program;
OrcTarget *target;
int n_insns;
OrcVariable vars[ORC_N_VARIABLES];
- //int n_vars;
int n_temp_vars;
unsigned char *codeptr;
};
struct _OrcOpcodeExecutor {
+ /*< private >*/
int src_values[ORC_STATIC_OPCODE_N_SRC];
int dest_values[ORC_STATIC_OPCODE_N_DEST];
};
struct _OrcExecutor {
+ /*< private >*/
OrcProgram *program;
int n;
int counter1;
OrcRuleSet rule_sets[ORC_N_RULE_SETS];
int n_rule_sets;
+
+ void *_unused[10];
};
#include <orc/orcx86.h>
-enum {
+typedef enum {
+ ORC_TARGET_SSE_SSE2 = (1<<0),
+ ORC_TARGET_SSE_SSE3 = (1<<1),
+ ORC_TARGET_SSE_SSSE3 = (1<<2),
+ ORC_TARGET_SSE_SSE4_1 = (1<<3),
+ ORC_TARGET_SSE_SSE4_2 = (1<<4),
+ ORC_TARGET_SSE_SSE4A = (1<<5),
+ ORC_TARGET_SSE_SSE5 = (1<<6),
+ ORC_TARGET_SSE_FRAME_POINTER = (1<<7),
+ ORC_TARGET_SSE_SHORT_JUMPS = (1<<8),
+ ORC_TARGET_SSE_64BIT = (1<<9)
+}OrcTargetSSEFlags;
+
+typedef enum {
X86_XMM0 = ORC_VEC_REG_BASE,
X86_XMM1,
X86_XMM2,
X86_XMM13,
X86_XMM14,
X86_XMM15
-};
+}OrcSSERegister;
#define ORC_SSE_SHUF(a,b,c,d) ((((a)&3)<<6)|(((b)&3)<<4)|(((c)&3)<<2)|(((d)&3)<<0))