-int
-orc_program_mmx_allocate_register (OrcProgram *program, int data_reg)
-{
- int i;
- int klass;
- int offset;
-
- if (data_reg) {
- klass = program->data_register_class;
- } else {
- klass = ORC_REGCLASS_GP;
- }
- offset = klass << 5;
-
- for(i=offset;i<offset+32;i++){
- if (program->valid_regs[i] &&
- !program->save_regs[i] &&
- program->alloc_regs[i] == 0) {
- program->alloc_regs[i]++;
- program->used_regs[i] = 1;
- return i;
- }
- }
- for(i=offset;i<offset+32;i++){
- if (program->valid_regs[i] &&
- program->alloc_regs[i] == 0) {
- program->alloc_regs[i]++;
- program->used_regs[i] = 1;
- return i;
- }
- }
-
- printf("register overflow\n");
- return 0;
-}
-
-
void orc_program_rewrite_vars (OrcProgram *program);
void orc_program_dump (OrcProgram *program);
program->used_regs[i] = 0;
}
- program->data_register_class = 2;
program->rule_set = ORC_RULE_MMX_1;
}
POWERPC_R29,
POWERPC_R30,
POWERPC_R31,
- POWERPC_V0 = ORC_VEC1_REG_BASE,
+ POWERPC_V0 = ORC_VEC_REG_BASE,
POWERPC_V1,
POWERPC_V2,
POWERPC_V3,
POWERPC_V28,
POWERPC_V29,
POWERPC_V30,
- POWERPC_V31,
- POWERPC_F0 = ORC_VEC2_REG_BASE,
- POWERPC_F1,
- POWERPC_F2,
- POWERPC_F3,
- POWERPC_F4,
- POWERPC_F5,
- POWERPC_F6,
- POWERPC_F7,
- POWERPC_F8,
- POWERPC_F9,
- POWERPC_F10,
- POWERPC_F11,
- POWERPC_F12,
- POWERPC_F13,
- POWERPC_F14,
- POWERPC_F15,
- POWERPC_F16,
- POWERPC_F17,
- POWERPC_F18,
- POWERPC_F19,
- POWERPC_F20,
- POWERPC_F21,
- POWERPC_F22,
- POWERPC_F23,
- POWERPC_F24,
- POWERPC_F25,
- POWERPC_F26,
- POWERPC_F27,
- POWERPC_F28,
- POWERPC_F29,
- POWERPC_F30,
- POWERPC_F31
+ POWERPC_V31
};
const char *
for(i=0;i<32;i++){
program->valid_regs[POWERPC_R0+i] = 1;
- program->valid_regs[POWERPC_F0+i] = 1;
program->valid_regs[POWERPC_V0+i] = 1;
}
program->valid_regs[POWERPC_R0] = 0; /* used for temp space */
for(i=14;i<32;i++){
program->save_regs[POWERPC_R0 + i] = 1;
- program->save_regs[POWERPC_F0 + i] = 1;
}
for(i=20;i<32;i++){
program->save_regs[POWERPC_V0 + i] = 1;
}
- program->data_register_class = 2;
-
program->rule_set = ORC_RULE_ALTIVEC_1;
program->n_per_loop = 4;
program->loop_shift = 2;
void orc_program_sse_register_rules (void);
-int
-orc_program_sse_allocate_register (OrcProgram *program, int data_reg)
-{
- int i;
- int klass;
- int offset;
-
- if (data_reg) {
- klass = program->data_register_class;
- } else {
- klass = ORC_REGCLASS_GP;
- }
- offset = klass << 5;
-
- for(i=offset;i<offset+32;i++){
- if (program->valid_regs[i] &&
- !program->save_regs[i] &&
- program->alloc_regs[i] == 0) {
- program->alloc_regs[i]++;
- program->used_regs[i] = 1;
- return i;
- }
- }
- for(i=offset;i<offset+32;i++){
- if (program->valid_regs[i] &&
- program->alloc_regs[i] == 0) {
- program->alloc_regs[i]++;
- program->used_regs[i] = 1;
- return i;
- }
- }
-
- printf("register overflow\n");
- return 0;
-}
-
-
void orc_program_rewrite_vars (OrcProgram *program);
void orc_program_dump (OrcProgram *program);
program->used_regs[i] = 0;
}
- program->data_register_class = 3;
program->rule_set = ORC_RULE_SSE_1;
}
void orc_program_rewrite_vars2 (OrcProgram *program);
void orc_program_do_regs (OrcProgram *program);
-int _orc_default_target = ORC_TARGET_MMX;
+int _orc_default_target = ORC_TARGET_SSE;
OrcProgram *
orc_program_new (void)
orc_program_allocate_register (OrcProgram *program, int data_reg)
{
int i;
- int klass;
int offset;
if (data_reg) {
- klass = program->data_register_class;
+ offset = ORC_VEC_REG_BASE;
} else {
- klass = ORC_REGCLASS_GP;
+ offset = ORC_GP_REG_BASE;
}
- offset = klass << 5;
for(i=offset;i<offset+32;i++){
if (program->valid_regs[i] &&
#define ORC_N_LABELS 100
#define ORC_GP_REG_BASE 32
-#define ORC_VEC1_REG_BASE 64
-#define ORC_VEC2_REG_BASE 96
+#define ORC_VEC_REG_BASE 64
#define ORC_REGCLASS_GP 1
+#define ORC_REGCLASS_VEC 2
#define ORC_OPCODE_N_ARGS 4
#define ORC_OPCODE_N_RULES 12
int error;
- int data_register_class;
-
int valid_regs[ORC_N_REGS];
int save_regs[ORC_N_REGS];
int used_regs[ORC_N_REGS];
X86_R12,
X86_R13,
X86_R14,
- X86_R15,
- X86_MM0 = ORC_VEC1_REG_BASE,
+ X86_R15
+};
+
+enum {
+ X86_MM0 = ORC_VEC_REG_BASE,
X86_MM1,
X86_MM2,
X86_MM3,
X86_MM4,
X86_MM5,
X86_MM6,
- X86_MM7,
- X86_XMM0 = ORC_VEC2_REG_BASE,
+ X86_MM7
+};
+
+enum {
+ X86_XMM0 = ORC_VEC_REG_BASE,
X86_XMM1,
X86_XMM2,
X86_XMM3,