}
static void
-load_constant (void *data, int size, int value)
+load_constant (void *data, int size, orc_uint64 value)
{
switch (size) {
case 1:
if (var->vartype == ORC_VAR_TYPE_CONST) {
opcode_ex[j].src_ptrs[k] = tmpspace[insn->src_args[k]];
/* FIXME hack */
- load_constant (tmpspace[insn->src_args[k]], 4,
+ load_constant (tmpspace[insn->src_args[k]], 8,
var->value.i);
} else if (var->vartype == ORC_VAR_TYPE_PARAM) {
opcode_ex[j].src_ptrs[k] = tmpspace[insn->src_args[k]];
/* FIXME hack */
- load_constant (tmpspace[insn->src_args[k]], 4,
- ex->params[insn->src_args[k]]);
+ load_constant (tmpspace[insn->src_args[k]], 8,
+ (orc_uint64)ex->params[insn->src_args[k]] |
+ (((orc_uint64)ex->params[insn->src_args[k] +
+ (ORC_VAR_T1 - ORC_VAR_P1)])<<32));
} else if (var->vartype == ORC_VAR_TYPE_TEMP) {
opcode_ex[j].src_ptrs[k] = tmpspace[insn->src_args[k]];
} else if (var->vartype == ORC_VAR_TYPE_SRC) {
}
} else {
if (size == 8) {
- ORC_ASM_CODE(p," %s = (ex->params[%d] & 0xffffffff) | (((orc_uint64)(ex->params[%d + (ORC_VAR_T1 - ORC_VAR_P1)]) << 32);\n",
+ ORC_ASM_CODE(p," %s = (ex->params[%d] & 0xffffffff) | ((orc_uint64)(ex->params[%d + (ORC_VAR_T1 - ORC_VAR_P1)]) << 32);\n",
dest, insn->src_args[0], insn->src_args[0]);
} else {
ORC_ASM_CODE(p," %s = ex->params[%d];\n", dest,
(int)p->vars[insn->src_args[0]].value.i,
p->vars[insn->src_args[0]].value.f);
} else {
- ORC_ASM_CODE(p," %s = 0x%08x%08x; /* %gf */\n", dest,
+ ORC_ASM_CODE(p," %s = 0x%08x%08xULL; /* %gf */\n", dest,
(orc_uint32)(((orc_uint64)p->vars[insn->src_args[0]].value.i)>>32),
((orc_uint32)p->vars[insn->src_args[0]].value.i),
p->vars[insn->src_args[0]].value.f);
copyl d1, 2.0
-.init convert_fc32_to_int32_init
+
.function convert_fc32_to_int32
.source 8 src #one complex float
.dest 4 dst #one complex short
x2 convlw dst, lscaled
+.function param64
+.dest 8 d
+.param 8 s
+
+copyq d, s
+
+
+.function const64
+.dest 8 d
+.const 8 s 0x0123456789abcdef
+
+copyq d, s
+
+
var->size, (int)var->value.i, varnames[ORC_VAR_C1 + i]);
} else if (var->size > 4) {
REQUIRE(0,4,8,1);
- fprintf(output, " orc_program_add_constant_int64 (p, %d, 0x%08x%08x, \"%s\");\n",
+ fprintf(output, " orc_program_add_constant_int64 (p, %d, 0x%08x%08xULL, \"%s\");\n",
var->size, (orc_uint32)(((orc_uint64)var->value.i)>>32),
(orc_uint32)(var->value.i), varnames[ORC_VAR_C1 + i]);
}
for(i=0;i<8;i++){
var = &p->vars[ORC_VAR_C1 + i];
if (var->size) {
- if (var->value.i != 0x80000000) {
- fprintf(output, " orc_program_add_constant (p, %d, %u, \"%s\");\n",
- var->size, (int)var->value.i, varnames[ORC_VAR_C1 + i]);
+ if (var->size < 8) {
+ if (var->value.i != 0x80000000) {
+ fprintf(output, " orc_program_add_constant (p, %d, 0x%08x, \"%s\");\n",
+ var->size, (int)var->value.i, varnames[ORC_VAR_C1 + i]);
+ } else {
+ fprintf(output, " orc_program_add_constant (p, %d, 0x%08x, \"%s\");\n",
+ var->size, (int)var->value.i, varnames[ORC_VAR_C1 + i]);
+ }
} else {
- fprintf(output, " orc_program_add_constant (p, %d, 0x%08x, \"%s\");\n",
- var->size, (int)var->value.i, varnames[ORC_VAR_C1 + i]);
+ fprintf(output, " orc_program_add_constant_int64 (p, %d, "
+ "0x%08x%08xULL, \"%s\");\n",
+ var->size, (orc_uint32)(((orc_uint64)var->value.i)>>32),
+ (orc_uint32)(var->value.i), varnames[ORC_VAR_C1 + i]);
}
}
}