Commit 07c01caf authored by Olivier Crête's avatar Olivier Crête 👻

Make it ANSI-C

Use /* */ instead of //
Define _GNU_SOURCE in the ORC_CFLAGS
parent 7f7ad3f2
......@@ -184,7 +184,7 @@ AM_CONDITIONAL(ENABLE_BACKEND_MIPS, test "x$ENABLE_BACKEND_MIPS" = "xyes")
AC_DEFINE(ORC_EXPORTS, 1, [Defined for compiling internal code])
ORC_CFLAGS="$ORC_CFLAGS \$(ERROR_CFLAGS) -I\$(top_srcdir)"
ORC_CFLAGS="$ORC_CFLAGS \$(ERROR_CFLAGS) -I\$(top_srcdir) -D_GNU_SOURCE"
AC_SUBST(ERROR_CFLAGS)
AC_SUBST(ORC_CFLAGS)
......
......@@ -21,7 +21,7 @@
#ifdef HAVE_MMAP
/* This can be used to test non-zero high-32-bits of pointers. */
//#define USE_MMAP
/* #define USE_MMAP */
#endif
#define EXTEND_ROWS 16
......
......@@ -173,7 +173,7 @@ oil_profile_stamp_default (void)
return ts;
#elif defined(__GNUC__) && defined(HAVE_ARM) && defined(USE_CORTEX_A8_COUNTER)
unsigned int ts;
//__asm__ __volatile__(" mrc p14, 0, %0, c1, c0, 0 \n" : "=r" (ts));
/* __asm__ __volatile__(" mrc p14, 0, %0, c1, c0, 0 \n" : "=r" (ts)); */
__asm__ __volatile__(" mrc p15, 0, %0, c9, c13, 0 \n" : "=r" (ts));
return ts;
#elif defined(_MSC_VER) && defined(HAVE_I386)
......
......@@ -109,7 +109,7 @@ orc_test_gcc_compile (OrcProgram *p)
return ORC_TEST_FAILED;
}
if (!ORC_COMPILE_RESULT_IS_SUCCESSFUL(result)) {
//printf (" no code generated: %s\n", orc_program_get_error (p));
/* printf (" no code generated: %s\n", orc_program_get_error (p)); */
return ORC_TEST_INDETERMINATE;
}
......@@ -232,7 +232,7 @@ orc_test_gcc_compile_neon (OrcProgram *p)
result = orc_program_compile_full (p, target, flags);
if (!ORC_COMPILE_RESULT_IS_SUCCESSFUL(result)) {
//printf (" no code generated: %s\n", orc_program_get_error (p));
/* printf (" no code generated: %s\n", orc_program_get_error (p)); */
return ORC_TEST_INDETERMINATE;
}
......@@ -326,7 +326,7 @@ orc_test_gcc_compile_c64x (OrcProgram *p)
result = orc_program_compile_full (p, target, flags);
if (!ORC_COMPILE_RESULT_IS_SUCCESSFUL(result)) {
//printf (" no code generated: %s\n", orc_program_get_error (p));
/* printf (" no code generated: %s\n", orc_program_get_error (p)); */
return ORC_TEST_INDETERMINATE;
}
......@@ -346,7 +346,7 @@ orc_test_gcc_compile_c64x (OrcProgram *p)
ret = system (cmd);
if (ret != 0) {
ORC_ERROR ("compiler failed");
//printf("%s\n", orc_program_get_asm_code (p));
/* printf("%s\n", orc_program_get_asm_code (p)); */
return ORC_TEST_INDETERMINATE;
}
......@@ -585,7 +585,7 @@ orc_test_compare_output_full (OrcProgram *program, int flags)
goto out;
}
if (!ORC_COMPILE_RESULT_IS_SUCCESSFUL(result)) {
//printf (" no code generated: %s\n", orc_program_get_error (program));
/* printf (" no code generated: %s\n", orc_program_get_error (program)); */
ret = ORC_TEST_INDETERMINATE;
goto out;
}
......@@ -985,7 +985,7 @@ orc_test_performance_full (OrcProgram *program, int flags,
result = orc_program_compile_full (program, target, flags);
if (!ORC_COMPILE_RESULT_IS_SUCCESSFUL(result)) {
//printf("compile failed\n");
/* printf("compile failed\n"); */
orc_program_reset (program);
return 0;
}
......@@ -994,7 +994,7 @@ orc_test_performance_full (OrcProgram *program, int flags,
if (program->constant_n > 0) {
n = program->constant_n;
} else {
//n = 64 + (orc_random(&rand_context)&0xf);
/* n = 64 + (orc_random(&rand_context)&0xf); */
n = 1000;
}
......@@ -1113,7 +1113,7 @@ orc_test_gcc_compile_mips (OrcProgram *p)
result = orc_program_compile_full (p, target, flags);
if (!ORC_COMPILE_RESULT_IS_SUCCESSFUL(result)) {
//printf (" no code generated: %s\n", orc_program_get_error (p));
/* printf (" no code generated: %s\n", orc_program_get_error (p)); */
return ORC_TEST_INDETERMINATE;
}
......
......@@ -54,7 +54,7 @@ orc_arm_reg_name (int reg)
"r4", "r5", "r6", "r7",
"r8", "r9", "r10", "r11",
"ip", "sp", "lr", "pc" };
//"r12", "r13", "r14", "r15" };
/* "r12", "r13", "r14", "r15" }; */
#endif
if (reg < ORC_GP_REG_BASE || reg >= ORC_GP_REG_BASE+16) {
......
......@@ -78,7 +78,7 @@ orc_bytecode_from_program (OrcProgram *p)
bytecode_append_string (bytecode, p->name);
}
#if 0
//if (!is_inline) {
/* if (!is_inline) { */
if (p->backup_function) {
bytecode_append_code (bytecode, ORC_BC_SET_BACKUP_FUNCTION);
bytecode_pointer (bytecode, p->backup_function);
......@@ -105,7 +105,7 @@ orc_bytecode_from_program (OrcProgram *p)
if (var->size) {
bytecode_append_code (bytecode, ORC_BC_ADD_ACCUMULATOR);
bytecode_append_int (bytecode, var->size);
//bytecode_append_int (bytecode, var->alignment);
/* bytecode_append_int (bytecode, var->alignment); */
}
}
for(i=0;i<8;i++){
......@@ -377,7 +377,7 @@ orc_bytecode_parse_function (OrcProgram *program, const orc_uint8 *bytecode)
{
OrcBytecodeParse _parse;
OrcBytecodeParse *parse = &_parse;
//int in_function = FALSE;
/* int in_function = FALSE; */
int bc;
int size;
int alignment;
......@@ -397,7 +397,7 @@ orc_bytecode_parse_function (OrcProgram *program, const orc_uint8 *bytecode)
/* FIXME this is technically an error */
return 0;
case ORC_BC_BEGIN_FUNCTION:
//in_function = TRUE;
/* in_function = TRUE; */
break;
case ORC_BC_END_FUNCTION:
return 0;
......
......@@ -170,7 +170,7 @@ orc_code_allocate_codemem (OrcCode *code, int size)
code->code = ORC_PTR_OFFSET(region->write_ptr, chunk->offset);
code->exec = ORC_PTR_OFFSET(region->exec_ptr, chunk->offset);
code->code_size = size;
//compiler->codeptr = ORC_PTR_OFFSET(region->write_ptr, chunk->offset);
/* compiler->codeptr = ORC_PTR_OFFSET(region->write_ptr, chunk->offset); */
}
void
......
......@@ -81,8 +81,8 @@ orc_check_neon_proc_auxv (void)
}
if (aux[0] == AT_HWCAP) {
//if (aux[1] & 64) flags |= ORC_TARGET_NEON_VFP;
//if (aux[1] & 512) flags |= ORC_TARGET_NEON_IWMMXT;
/* if (aux[1] & 64) flags |= ORC_TARGET_NEON_VFP; */
/* if (aux[1] & 512) flags |= ORC_TARGET_NEON_IWMMXT; */
if (aux[1] & 4096) flags |= ORC_TARGET_NEON_NEON;
if (aux[1] & 128) flags |= ORC_TARGET_ARM_EDSP;
ORC_INFO("arm hwcap %08x", aux[1]);
......
......@@ -200,7 +200,7 @@ orc_cpu_detect_arch(void)
orc_check_altivec_fault();
#endif
//_orc_profile_stamp = orc_profile_stamp_tb;
/* _orc_profile_stamp = orc_profile_stamp_tb; */
}
......
......@@ -388,8 +388,8 @@ orc_sse_detect_cpuid_intel (orc_uint32 level)
case 28:
orc_x86_microarchitecture = ORC_X86_BONNELL;
break;
//orc_x86_microarchitecture = ORC_X86_WESTMERE;
//orc_x86_microarchitecture = ORC_X86_SANDY_BRIDGE;
/* orc_x86_microarchitecture = ORC_X86_WESTMERE; */
/* orc_x86_microarchitecture = ORC_X86_SANDY_BRIDGE; */
}
} else if (_orc_cpu_family == 15) {
orc_x86_microarchitecture = ORC_X86_NETBURST;
......
......@@ -49,7 +49,7 @@ orc_executor_run (OrcExecutor *ex)
}
if (func) {
func (ex);
//ORC_ERROR("counters %d %d %d", ex->counter1, ex->counter2, ex->counter3);
/* ORC_ERROR("counters %d %d %d", ex->counter1, ex->counter2, ex->counter3); */
} else {
orc_executor_emulate (ex);
}
......@@ -68,7 +68,7 @@ orc_executor_run_backup (OrcExecutor *ex)
}
if (func) {
func (ex);
//ORC_ERROR("counters %d %d %d", ex->counter1, ex->counter2, ex->counter3);
/* ORC_ERROR("counters %d %d %d", ex->counter1, ex->counter2, ex->counter3); */
} else {
orc_executor_emulate (ex);
}
......
......@@ -84,7 +84,7 @@ orc_parse_full (const char *code, OrcProgram ***programs, char **log)
p = parser->line;
end = p + strlen (p);
//printf("%d: %s\n", parser->line_number, parser->line);
/* printf("%d: %s\n", parser->line_number, parser->line); */
while (p[0] == ' ' || p[0] == '\t') p++;
......@@ -93,7 +93,7 @@ orc_parse_full (const char *code, OrcProgram ***programs, char **log)
}
if (p[0] == '#') {
//printf("comment: %s\n", p+1);
/* printf("comment: %s\n", p+1); */
continue;
}
......@@ -118,9 +118,9 @@ orc_parse_full (const char *code, OrcProgram ***programs, char **log)
{
int i;
for(i=0;i<n_tokens;i++){
//printf("'%s' ", token[i]);
/* printf("'%s' ", token[i]); */
}
//printf("\n");
/* printf("\n"); */
}
if (token[0][0] == '.') {
......
......@@ -646,7 +646,7 @@ powerpc_get_constant_full (OrcCompiler *p, int value0, int value1,
void powerpc_emit_ret (OrcCompiler *compiler)
{
ORC_ASM_CODE(compiler," ret\n");
//*compiler->codeptr++ = 0xc3;
/* *compiler->codeptr++ = 0xc3; */
}
void
......
......@@ -40,7 +40,7 @@ powerpc_emit_prologue (OrcCompiler *compiler)
for(i=POWERPC_R13;i<=POWERPC_R31;i++){
if (compiler->used_regs[i]) {
//powerpc_emit_push (compiler, 4, i);
/* powerpc_emit_push (compiler, 4, i); */
}
}
}
......@@ -52,7 +52,7 @@ powerpc_emit_epilogue (OrcCompiler *compiler)
for(i=POWERPC_R31;i>=POWERPC_R31;i--){
if (compiler->used_regs[i]) {
//powerpc_emit_pop (compiler, 4, i);
/* powerpc_emit_pop (compiler, 4, i); */
}
}
......@@ -188,7 +188,7 @@ orc_compiler_powerpc_assemble (OrcCompiler *compiler)
int k;
OrcInstruction *insn;
OrcStaticOpcode *opcode;
//OrcVariable *args[10];
/* OrcVariable *args[10]; */
OrcRule *rule;
int label_outer_loop_start;
int label_loop_start;
......@@ -224,7 +224,7 @@ orc_compiler_powerpc_assemble (OrcCompiler *compiler)
(int)ORC_STRUCT_OFFSET(OrcExecutorAlt, m_index));
}
//powerpc_load_constants (compiler);
/* powerpc_load_constants (compiler); */
powerpc_load_inner_constants (compiler);
for(k=0;k<4;k++){
......@@ -232,7 +232,7 @@ orc_compiler_powerpc_assemble (OrcCompiler *compiler)
if (compiler->vars[ORC_VAR_A1 + k].name == NULL) continue;
//powerpc_emit_VX_2(p, "vxor", 0x100004c4, reg, reg, reg);
/* powerpc_emit_VX_2(p, "vxor", 0x100004c4, reg, reg, reg); */
powerpc_emit_vxor (compiler, var->alloc, var->alloc, var->alloc);
}
......@@ -278,7 +278,7 @@ orc_compiler_powerpc_assemble (OrcCompiler *compiler)
switch (var->vartype) {
case ORC_VAR_TYPE_SRC:
case ORC_VAR_TYPE_DEST:
//powerpc_emit_load_src (compiler, var);
/* powerpc_emit_load_src (compiler, var); */
break;
case ORC_VAR_TYPE_CONST:
break;
......@@ -305,7 +305,7 @@ orc_compiler_powerpc_assemble (OrcCompiler *compiler)
switch (var->vartype) {
case ORC_VAR_TYPE_DEST:
//powerpc_emit_store_dest (compiler, var);
/* powerpc_emit_store_dest (compiler, var); */
break;
case ORC_VAR_TYPE_TEMP:
break;
......
......@@ -78,7 +78,7 @@ orc_arm_emit_epilogue (OrcCompiler *compiler)
if (regs) orc_arm_emit_pop (compiler, regs);
orc_arm_emit_bx_lr (compiler);
//orc_arm_dump_insns (compiler);
/* orc_arm_dump_insns (compiler); */
}
static OrcTarget orc_arm_target = {
......@@ -130,7 +130,7 @@ orc_compiler_orc_arm_init (OrcCompiler *compiler)
for(i=ORC_GP_REG_BASE;i<ORC_GP_REG_BASE+9;i++){
compiler->valid_regs[i] = 1;
}
//compiler->valid_regs[ORC_ARM_SB] = 0;
/* compiler->valid_regs[ORC_ARM_SB] = 0; */
compiler->valid_regs[ORC_ARM_IP] = 0;
compiler->valid_regs[ORC_ARM_SP] = 0;
compiler->valid_regs[ORC_ARM_LR] = 0;
......@@ -161,16 +161,16 @@ orc_arm_load_constants_outer (OrcCompiler *compiler)
if (compiler->vars[i].name == NULL) continue;
switch (compiler->vars[i].vartype) {
case ORC_VAR_TYPE_CONST:
//orc_arm_emit_load_imm (compiler, compiler->vars[i].alloc,
// (int)compiler->vars[i].value);
/* orc_arm_emit_load_imm (compiler, compiler->vars[i].alloc, */
/* (int)compiler->vars[i].value); */
break;
case ORC_VAR_TYPE_PARAM:
ORC_PROGRAM_ERROR(compiler,"unimplemented");
return;
/* FIXME offset is too large */
//orc_arm_loadw (compiler, compiler->vars[i].alloc,
// compiler->exec_reg,
// (int)ORC_STRUCT_OFFSET(OrcExecutor, params[i]));
/* orc_arm_loadw (compiler, compiler->vars[i].alloc, */
/* compiler->exec_reg, */
/* (int)ORC_STRUCT_OFFSET(OrcExecutor, params[i])); */
break;
case ORC_VAR_TYPE_SRC:
case ORC_VAR_TYPE_DEST:
......@@ -228,9 +228,9 @@ orc_arm_emit_load_src (OrcCompiler *compiler, OrcVariable *var)
if (var->ptr_register == 0) {
int i;
i = var - compiler->vars;
//orc_arm_emit_mov_memoffset_reg (compiler, orc_arm_ptr_size,
// (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[i]),
// compiler->exec_reg, X86_ECX);
/* orc_arm_emit_mov_memoffset_reg (compiler, orc_arm_ptr_size, */
/* (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[i]), */
/* compiler->exec_reg, X86_ECX); */
ptr_reg = ORC_ARM_PC;
} else {
ptr_reg = var->ptr_register;
......@@ -238,23 +238,23 @@ orc_arm_emit_load_src (OrcCompiler *compiler, OrcVariable *var)
switch (var->size << compiler->loop_shift) {
case 1:
orc_arm_loadb (compiler, var->alloc, ptr_reg, 0);
//orc_arm_emit_mov_memoffset_reg (compiler, 1, 0, ptr_reg, X86_ECX);
//orc_arm_emit_mov_reg_arm (compiler, X86_ECX, var->alloc);
/* orc_arm_emit_mov_memoffset_reg (compiler, 1, 0, ptr_reg, X86_ECX); */
/* orc_arm_emit_mov_reg_arm (compiler, X86_ECX, var->alloc); */
break;
case 2:
orc_arm_loadw (compiler, var->alloc, ptr_reg, 0);
//orc_arm_emit_mov_memoffset_reg (compiler, 2, 0, ptr_reg, X86_ECX);
//orc_arm_emit_mov_reg_arm (compiler, X86_ECX, var->alloc);
/* orc_arm_emit_mov_memoffset_reg (compiler, 2, 0, ptr_reg, X86_ECX); */
/* orc_arm_emit_mov_reg_arm (compiler, X86_ECX, var->alloc); */
break;
case 4:
orc_arm_loadl (compiler, var->alloc, ptr_reg, 0);
//orc_arm_emit_mov_memoffset_arm (compiler, 4, 0, ptr_reg, var->alloc);
/* orc_arm_emit_mov_memoffset_arm (compiler, 4, 0, ptr_reg, var->alloc); */
break;
//case 8:
//orc_arm_emit_mov_memoffset_arm (compiler, 8, 0, ptr_reg, var->alloc);
/* case 8: */
/* orc_arm_emit_mov_memoffset_arm (compiler, 8, 0, ptr_reg, var->alloc); */
break;
//case 16:
//orc_arm_emit_mov_memoffset_arm (compiler, 16, 0, ptr_reg, var->alloc);
/* case 16: */
/* orc_arm_emit_mov_memoffset_arm (compiler, 16, 0, ptr_reg, var->alloc); */
break;
default:
ORC_COMPILER_ERROR(compiler, "bad size %d", var->size << compiler->loop_shift);
......@@ -266,8 +266,8 @@ orc_arm_emit_store_dest (OrcCompiler *compiler, OrcVariable *var)
{
int ptr_reg;
if (var->ptr_register == 0) {
//orc_arm_emit_mov_memoffset_reg (compiler, orc_arm_ptr_size,
// var->ptr_offset, compiler->exec_reg, X86_ECX);
/* orc_arm_emit_mov_memoffset_reg (compiler, orc_arm_ptr_size, */
/* var->ptr_offset, compiler->exec_reg, X86_ECX); */
ptr_reg = ORC_ARM_PC;
} else {
ptr_reg = var->ptr_register;
......@@ -275,26 +275,26 @@ orc_arm_emit_store_dest (OrcCompiler *compiler, OrcVariable *var)
switch (var->size << compiler->loop_shift) {
case 1:
orc_arm_storeb (compiler, ptr_reg, 0, var->alloc);
//orc_arm_emit_mov_orc_arm_reg (compiler, var->alloc, X86_ECX);
//orc_arm_emit_mov_reg_memoffset (compiler, 1, X86_ECX, 0, ptr_reg);
/* orc_arm_emit_mov_orc_arm_reg (compiler, var->alloc, X86_ECX); */
/* orc_arm_emit_mov_reg_memoffset (compiler, 1, X86_ECX, 0, ptr_reg); */
break;
case 2:
orc_arm_storew (compiler, ptr_reg, 0, var->alloc);
//orc_arm_emit_mov_orc_arm_reg (compiler, var->alloc, X86_ECX);
//orc_arm_emit_mov_reg_memoffset (compiler, 2, X86_ECX, 0, ptr_reg);
/* orc_arm_emit_mov_orc_arm_reg (compiler, var->alloc, X86_ECX); */
/* orc_arm_emit_mov_reg_memoffset (compiler, 2, X86_ECX, 0, ptr_reg); */
break;
case 4:
orc_arm_storel (compiler, ptr_reg, 0, var->alloc);
//orc_arm_emit_mov_orc_arm_memoffset (compiler, 4, var->alloc, 0, ptr_reg,
// var->is_aligned, var->is_uncached);
/* orc_arm_emit_mov_orc_arm_memoffset (compiler, 4, var->alloc, 0, ptr_reg, */
/* var->is_aligned, var->is_uncached); */
break;
case 8:
//orc_arm_emit_mov_orc_arm_memoffset (compiler, 8, var->alloc, 0, ptr_reg,
// var->is_aligned, var->is_uncached);
/* orc_arm_emit_mov_orc_arm_memoffset (compiler, 8, var->alloc, 0, ptr_reg, */
/* var->is_aligned, var->is_uncached); */
break;
case 16:
//orc_arm_emit_mov_orc_arm_memoffset (compiler, 16, var->alloc, 0, ptr_reg,
// var->is_aligned, var->is_uncached);
/* orc_arm_emit_mov_orc_arm_memoffset (compiler, 16, var->alloc, 0, ptr_reg, */
/* var->is_aligned, var->is_uncached); */
break;
default:
ORC_COMPILER_ERROR(compiler, "bad size %d", var->size << compiler->loop_shift);
......@@ -396,7 +396,7 @@ orc_arm_emit_loop (OrcCompiler *compiler)
switch (compiler->vars[insn->src_args[k]].vartype) {
case ORC_VAR_TYPE_SRC:
case ORC_VAR_TYPE_DEST:
//orc_arm_emit_load_src (compiler, &compiler->vars[insn->src_args[k]]);
/* orc_arm_emit_load_src (compiler, &compiler->vars[insn->src_args[k]]); */
break;
case ORC_VAR_TYPE_CONST:
break;
......@@ -427,7 +427,7 @@ orc_arm_emit_loop (OrcCompiler *compiler)
switch (compiler->vars[insn->dest_args[k]].vartype) {
case ORC_VAR_TYPE_DEST:
//orc_arm_emit_store_dest (compiler, &compiler->vars[insn->dest_args[k]]);
/* orc_arm_emit_store_dest (compiler, &compiler->vars[insn->dest_args[k]]); */
break;
case ORC_VAR_TYPE_TEMP:
break;
......@@ -447,10 +447,10 @@ orc_arm_emit_loop (OrcCompiler *compiler)
compiler->vars[k].ptr_register,
compiler->vars[k].size << compiler->loop_shift);
} else {
//orc_arm_emit_add_imm_memoffset (compiler, orc_arm_ptr_size,
// compiler->vars[k].size << compiler->loop_shift,
// (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[k]),
// compiler->exec_reg);
/* orc_arm_emit_add_imm_memoffset (compiler, orc_arm_ptr_size, */
/* compiler->vars[k].size << compiler->loop_shift, */
/* (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[k]), */
/* compiler->exec_reg); */
}
}
}
......
......@@ -8,7 +8,7 @@
#include <orc/orcprogram.h>
#include <orc/orcdebug.h>
//static const char *c_get_type_name (int size);
/* static const char *c_get_type_name (int size); */
void orc_c_init (void);
......@@ -52,8 +52,8 @@ orc_target_c64x_c_get_asm_preamble (void)
" int counter3;\n"
" void *arrays[ORC_N_VARIABLES];\n"
" int params[ORC_N_VARIABLES];\n"
" //OrcVariable vars[ORC_N_VARIABLES];\n"
" //OrcVariable *args[ORC_OPCODE_N_ARGS];\n"
" /* OrcVariable vars[ORC_N_VARIABLES]; */\n"
" /* OrcVariable *args[ORC_OPCODE_N_ARGS]; */\n"
"};\n"
"#define ORC_CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x)))\n"
"#define ORC_ABS(a) ((a)<0 ? -(a) : (a))\n"
......
......@@ -83,7 +83,7 @@ orc_neon_emit_epilogue (OrcCompiler *compiler)
if (regs) orc_arm_emit_pop (compiler, regs);
orc_arm_emit_bx_lr (compiler);
//arm_dump_insns (compiler);
/* arm_dump_insns (compiler); */
}
static OrcTarget neon_target = {
......@@ -137,7 +137,7 @@ orc_compiler_neon_init (OrcCompiler *compiler)
for(i=ORC_VEC_REG_BASE+0;i<ORC_VEC_REG_BASE+32;i+=2){
compiler->valid_regs[i] = 1;
}
//compiler->valid_regs[ORC_ARM_SB] = 0;
/* compiler->valid_regs[ORC_ARM_SB] = 0; */
compiler->valid_regs[ORC_ARM_IP] = 0;
compiler->valid_regs[ORC_ARM_SP] = 0;
compiler->valid_regs[ORC_ARM_LR] = 0;
......@@ -330,9 +330,9 @@ orc_neon_emit_load_src (OrcCompiler *compiler, OrcVariable *var, int unroll_inde
if (var->ptr_register == 0) {
int i;
i = var - compiler->vars;
//arm_emit_mov_memoffset_reg (compiler, arm_ptr_size,
// (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[i]),
// p->exec_reg, X86_ECX);
/* arm_emit_mov_memoffset_reg (compiler, arm_ptr_size, */
/* (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[i]), */
/* p->exec_reg, X86_ECX); */
ptr_reg = ORC_ARM_PC;
} else {
ptr_reg = var->ptr_register;
......@@ -378,8 +378,8 @@ orc_neon_emit_store_dest (OrcCompiler *compiler, OrcVariable *var)
{
int ptr_reg;
if (var->ptr_register == 0) {
//arm_emit_mov_memoffset_reg (compiler, arm_ptr_size,
// var->ptr_offset, p->exec_reg, X86_ECX);
/* arm_emit_mov_memoffset_reg (compiler, arm_ptr_size, */
/* var->ptr_offset, p->exec_reg, X86_ECX); */
ptr_reg = ORC_ARM_PC;
} else {
ptr_reg = var->ptr_register;
......@@ -748,7 +748,7 @@ orc_neon_emit_loop (OrcCompiler *compiler, int unroll_index)
switch (compiler->vars[insn->src_args[k]].vartype) {
case ORC_VAR_TYPE_SRC:
case ORC_VAR_TYPE_DEST:
//orc_neon_emit_load_src (compiler, &compiler->vars[insn->src_args[k]], unroll_index);
/* orc_neon_emit_load_src (compiler, &compiler->vars[insn->src_args[k]], unroll_index); */
break;
case ORC_VAR_TYPE_CONST:
break;
......@@ -788,7 +788,7 @@ orc_neon_emit_loop (OrcCompiler *compiler, int unroll_index)
switch (compiler->vars[insn->dest_args[k]].vartype) {
case ORC_VAR_TYPE_DEST:
//orc_neon_emit_store_dest (compiler, &compiler->vars[insn->dest_args[k]]);
/* orc_neon_emit_store_dest (compiler, &compiler->vars[insn->dest_args[k]]); */
break;
case ORC_VAR_TYPE_TEMP:
break;
......@@ -808,10 +808,10 @@ orc_neon_emit_loop (OrcCompiler *compiler, int unroll_index)
compiler->vars[k].ptr_register,
compiler->vars[k].size << compiler->loop_shift);
} else {
//arm_emit_add_imm_memoffset (compiler, arm_ptr_size,
// compiler->vars[k].size << compiler->loop_shift,
// (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[k]),
// p->exec_reg);
/* arm_emit_add_imm_memoffset (compiler, arm_ptr_size, */
/* compiler->vars[k].size << compiler->loop_shift, */
/* (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[k]), */
/* p->exec_reg); */
}
}
}
......
......@@ -343,7 +343,7 @@ RULE(addb, "vaddubm", 0x10000000)
RULE(addssb, "vaddsbs", 0x10000300)
RULE(addusb, "vaddubs", 0x10000200)
RULE(andb, "vand", 0x10000404)
//RULE(andnb, "vandc", 0x10000444)
/* RULE(andnb, "vandc", 0x10000444) */
RULE(avgsb, "vavgsb", 0x10000502)
RULE(avgub, "vavgub", 0x10000402)
RULE(cmpeqb, "vcmpequb", 0x10000006)
......@@ -365,7 +365,7 @@ RULE(addw, "vadduhm", 0x10000040)
RULE(addssw, "vaddshs", 0x10000340)
RULE(addusw, "vadduhs", 0x10000240)
RULE(andw, "vand", 0x10000404)
//RULE(andnw, "vandc", 0x10000444)
/* RULE(andnw, "vandc", 0x10000444) */
RULE(avgsw, "vavgsh", 0x10000542)
RULE(avguw, "vavguh", 0x10000442)
RULE(cmpeqw, "vcmpequh", 0x10000046)
......@@ -387,7 +387,7 @@ RULE(addl, "vadduwm", 0x10000080)
RULE(addssl, "vaddsws", 0x10000380)
RULE(addusl, "vadduws", 0x10000280)
RULE(andl, "vand", 0x10000404)
//RULE(andnl, "vandc", 0x10000444)
/* RULE(andnl, "vandc", 0x10000444) */
RULE(avgsl, "vavgsw", 0x10000582)
RULE(avgul, "vavguw", 0x10000482)
RULE(cmpeql, "vcmpequw", 0x10000086)
......
......@@ -441,7 +441,7 @@ mmx_rule_ldresnearl (OrcCompiler *compiler, void *user, OrcInstruction *insn)
orc_x86_emit_mov_memindex_mmx (compiler, 4, 0,
src->ptr_register, compiler->gp_tmpreg, 2, tmp, FALSE);
#ifdef MMX
//orc_mmx_emit_punpckldq (compiler, tmp, dest->alloc);
/* orc_mmx_emit_punpckldq (compiler, tmp, dest->alloc); */
orc_mmx_emit_psllq_imm (compiler, 8*4*i, tmp);
orc_mmx_emit_por (compiler, tmp, dest->alloc);
#else
......@@ -710,11 +710,11 @@ BINARY(maxsb,pmaxsb,0x383c)
BINARY(maxub,pmaxub,0xde)
BINARY(minsb,pminsb,0x3838)
BINARY(minub,pminub,0xda)
//BINARY(mullb,pmullb,0xd5)
//BINARY(mulhsb,pmulhb,0xe5)
//BINARY(mulhub,pmulhub,0xe4)
/* BINARY(mullb,pmullb,0xd5) */
/* BINARY(mulhsb,pmulhb,0xe5) */
/* BINARY(mulhub,pmulhub,0xe4) */
BINARY(orb,por,0xeb)
//UNARY(signb,psignb,0x3808)
/* UNARY(signb,psignb,0x3808) */
BINARY(subb,psubb,0xf8)
BINARY(subssb,psubsb,0xe8)
BINARY(subusb,psubusb,0xd8)
......@@ -737,7 +737,7 @@ BINARY(mullw,pmullw,0xd5)
BINARY(mulhsw,pmulhw,0xe5)
BINARY(mulhuw,pmulhuw,0xe4)
BINARY(orw,por,0xeb)
//UNARY(signw,psignw,0x3809)
/* UNARY(signw,psignw,0x3809) */
BINARY(subw,psubw,0xf9)
BINARY(subssw,psubsw,0xe9)
BINARY(subusw,psubusw,0xd9)
......@@ -745,11 +745,11 @@ BINARY(xorw,pxor,0xef)
UNARY(absl,pabsd,0x381e)
BINARY(addl,paddd,0xfe)
//BINARY(addssl,paddsd,0xed)
//BINARY(addusl,paddusd,0xdd)
/* BINARY(addssl,paddsd,0xed) */
/* BINARY(addusl,paddusd,0xdd) */
BINARY(andl,pand,0xdb)
BINARY(andnl,pandn,0xdf)
//BINARY(avgul,pavgd,0xe3)
/* BINARY(avgul,pavgd,0xe3) */
BINARY(cmpeql,pcmpeqd,0x76)
BINARY(cmpgtsl,pcmpgtd,0x66)
BINARY(maxsl,pmaxsd,0x383d)
......@@ -757,13 +757,13 @@ BINARY(maxul,pmaxud,0x383f)
BINARY(minsl,pminsd,0x3839)
BINARY(minul,pminud,0x383b)
BINARY(mulll,pmulld,0x3840)
//BINARY(mulhsl,pmulhd,0xe5)
//BINARY(mulhul,pmulhud,0xe4)
/* BINARY(mulhsl,pmulhd,0xe5) */
/* BINARY(mulhul,pmulhud,0xe4) */
BINARY(orl,por,0xeb)
//UNARY(signl,psignd,0x380a)
/* UNARY(signl,psignd,0x380a) */
BINARY(subl,psubd,0xfa)
//BINARY(subssl,psubsd,0xe9)
//BINARY(subusl,psubusd,0xd9)
/* BINARY(subssl,psubsd,0xe9) */
/* BINARY(subusl,psubusd,0xd9) */
BINARY(xorl,pxor,0xef)
BINARY(andq,pand,0xdb)
......@@ -932,10 +932,10 @@ static void
mmx_rule_shift (OrcCompiler *p, void *user, OrcInstruction *insn)
{
int type = ORC_PTR_TO_INT(user);
//int imm_code1[] = { 0x71, 0x71, 0x71, 0x72, 0x72, 0x72, 0x73, 0x73 };
//int imm_code2[] = { 6, 2, 4, 6, 2, 4, 6, 2 };
//int reg_code[] = { 0xf1, 0xd1, 0xe1, 0xf2, 0xd2, 0xe2, 0xf3, 0xd3 };
//const char *code[] = { "psllw", "psrlw", "psraw", "pslld", "psrld", "psrad", "psllq", "psrlq" };
/* int imm_code1[] = { 0x71, 0x71, 0x71, 0x72, 0x72, 0x72, 0x73, 0x73 }; */
/* int imm_code2[] = { 6, 2, 4, 6, 2, 4, 6, 2 }; */
/* int reg_code[] = { 0xf1, 0xd1, 0xe1, 0xf2, 0xd2, 0xe2, 0xf3, 0xd3 }; */
/* const char *code[] = { "psllw", "psrlw", "psraw", "pslld", "psrld", "psrad", "psllq", "psrlq" }; */
const int opcodes[] = { ORC_X86_psllw, ORC_X86_psrlw, ORC_X86_psraw,
ORC_X86_pslld, ORC_X86_psrld, ORC_X86_psrad, ORC_X86_psllq,
ORC_X86_psrlq };
......@@ -1652,7 +1652,7 @@ mmx_rule_mululq (OrcCompiler *p, void *user, OrcInstruction *insn)
static void
mmx_rule_select0lw (OrcCompiler *p, void *user, OrcInstruction *insn)
{
//int src = p->vars[insn->src_args[0]].alloc;
/* int src = p->vars[insn->src_args[0]].alloc; */
int dest = p->vars[insn->dest_args[0]].alloc;
/* FIXME slow */
......@@ -1666,7 +1666,7 @@ mmx_rule_select0lw (OrcCompiler *p, void *user, OrcInstruction *insn)
static void
mmx_rule_select1lw (OrcCompiler *p, void *user, OrcInstruction *insn)
{
//int src = p->vars[insn->src_args[0]].alloc;
/* int src = p->vars[insn->src_args[0]].alloc; */
int dest = p->vars[insn->dest_args[0]].alloc;
/* FIXME slow */
......@@ -1706,7 +1706,7 @@ mmx_rule_select1ql (OrcCompiler *p, void *user, OrcInstruction *insn)
static void
mmx_rule_select0wb (OrcCompiler *p, void *user, OrcInstruction *insn)
{
//int src = p->vars[insn->src_args[0]].alloc;
/* int src = p->vars[insn->src_args[0]].alloc; */
int dest = p->vars[insn->dest_args[0]].alloc;
/* FIXME slow */
......@@ -1720,7 +1720,7 @@ mmx_rule_select0wb (OrcCompiler *p, void *user, OrcInstruction *insn)
static void
mmx_rule_select1wb (OrcCompiler *p, void *user, OrcInstruction *insn)
{
//int src = p->vars[insn->src_args[0]].alloc;
/* int src = p->vars[insn->src_args[0]].alloc; */
int dest = p->vars[insn->dest_args[0]].alloc;
/* FIXME slow */
......@@ -2245,11 +2245,11 @@ mmx_rule_addssl_slow (OrcCompiler *p, void *user, OrcInstruction *insn)
orc_mmx_emit_psrad_imm (p, 31, tmp2);
tmp = orc_compiler_get_constant (p, 4, 0x80000000);
orc_mmx_emit_pxor (p, tmp, tmp2); // clamped value
orc_mmx_emit_pxor (p, tmp, tmp2); /* clamped value */
orc_mmx_emit_pand (p, tmp3, tmp2);
orc_mmx_emit_paddd (p, src, dest);
orc_mmx_emit_pandn (p, dest, tmp3); // tmp is mask: ~0 is for clamping
orc_mmx_emit_pandn (p, dest, tmp3); /* tmp is mask: ~0 is for clamping */
orc_mmx_emit_movq (p, tmp3, dest);
orc_mmx_emit_por (p, tmp2, dest);
......@@ -2321,11 +2321,11 @@ mmx_rule_subssl_slow (OrcCompiler *p, void *user, OrcInstruction *insn)
orc_mmx_emit_pslld_imm (p, 1, tmp2);
orc_mmx_emit_movq (p, tmp, tmp3);
orc_mmx_emit_pxor (p, tmp2, tmp3);
orc_mmx_emit_psrad_imm (p, 31, tmp3); // tmp3 is mask: ~0 is for clamping
orc_mmx_emit_psrad_imm (p, 31, tmp3); /* tmp3 is mask: ~0 is for clamping */
orc_mmx_emit_psrad_imm (p, 31, tmp2);
tmp = orc_compiler_get_constant (p, 4, 0x80000000);
orc_mmx_emit_pxor (p, tmp, tmp2); // clamped value
orc_mmx_emit_pxor (p, tmp, tmp2); /* clamped value */
orc_mmx_emit_pand (p, tmp3, tmp2);
orc_mmx_emit_psubd (p, src, dest);
......@@ -2816,7 +2816,7 @@ orc_compiler_mmx_register_rules (OrcTarget *target)
orc_rule_register (rule_set, "convql", mmx_rule_convql, NULL);
orc_rule_register (rule_set, "convslq", mmx_rule_convslq, NULL);
orc_rule_register (rule_set, "convulq", mmx_rule_convulq, NULL);
//orc_rule_register (rule_set, "convsssql", mmx_rule_convsssql, NULL);
/* orc_rule_register (rule_set, "convsssql", mmx_rule_convsssql, NULL); */
orc_rule_register (rule_set, "mulsbw", mmx_rule_mulsbw, NULL);
orc_rule_register (rule_set, "mulubw", mmx_rule_mulubw, NULL);
......
This diff is collapsed.
......@@ -441,7 +441,7 @@ sse_rule_ldresnearl (OrcCompiler *compiler, void *user, OrcInstruction *insn)
orc_x86_emit_mov_memindex_sse (compiler, 4, 0,
src->ptr_register, compiler->gp_tmpreg, 2, tmp, FALSE);
#ifdef MMX
//orc_mmx_emit_punpckldq (compiler, tmp, dest->alloc);
/* orc_mmx_emit_punpckldq (compiler, tmp, dest->alloc); */
orc_sse_emit_psllq_imm (compiler, 8*4*i, tmp);
orc_sse_emit_por (compiler, tmp, dest->alloc);
#else
......@@ -710,11 +710,11 @@ BINARY(maxsb,pmaxsb,0x383c)
BINARY(maxub,pmaxub,0xde)
BINARY(minsb,pminsb,0x3838)
BINARY(minub,pminub,0xda)
//BINARY(mullb,pmullb,0xd5)