summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2010-09-14 14:45:40 -0700
committerDavid Schleef <ds@schleef.org>2010-09-14 14:45:40 -0700
commit24b5cedb4434372c35309a8114c892e26d017c6a (patch)
treea93cb4e67b44e60423872c293b7e0c087c8d70f3
parent38bb6da67bea1f46c5faa5ea97439ea5efe96e08 (diff)
c: Fix x2 used with float opcodes
-rw-r--r--orc/orcprogram-c.c6
-rw-r--r--orc/orcutils.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/orc/orcprogram-c.c b/orc/orcprogram-c.c
index 7676a9f..7dfe6e4 100644
--- a/orc/orcprogram-c.c
+++ b/orc/orcprogram-c.c
@@ -68,7 +68,7 @@ orc_target_c_get_typedefs (void)
"#endif\n"
"typedef union { orc_int16 i; orc_int8 x2[2]; } orc_union16;\n"
"typedef union { orc_int32 i; float f; orc_int16 x2[2]; orc_int8 x4[4]; } orc_union32;\n"
- "typedef union { orc_int64 i; double f; orc_int32 x2[2]; orc_int16 x4[4]; } orc_union64;\n"
+ "typedef union { orc_int64 i; double f; orc_int32 x2[2]; float x2f[2]; orc_int16 x4[4]; } orc_union64;\n"
"#endif\n";
}
@@ -499,9 +499,9 @@ static void
c_get_name_float (char *name, OrcCompiler *p, OrcInstruction *insn, int var)
{
if (insn && (insn->flags & ORC_INSTRUCTION_FLAG_X2)) {
- sprintf(name, "var%d[%d].x2f", var, p->unroll_index);
+ sprintf(name, "var%d.x2f[%d]", var, p->unroll_index);
} else if (insn && (insn->flags & ORC_INSTRUCTION_FLAG_X4)) {
- sprintf(name, "var%d[%d].x4f", var, p->unroll_index);
+ sprintf(name, "var%d.x4f[%d]", var, p->unroll_index);
} else {
switch (p->vars[var].vartype) {
case ORC_VAR_TYPE_CONST:
diff --git a/orc/orcutils.h b/orc/orcutils.h
index 0923120..8c1c793 100644
--- a/orc/orcutils.h
+++ b/orc/orcutils.h
@@ -67,7 +67,7 @@ typedef unsigned long orc_uint64;
#endif
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]; } orc_union32;
-typedef union { orc_int64 i; double f; orc_int32 x2[2]; orc_int16 x4[4]; } orc_union64;
+typedef union { orc_int64 i; double f; orc_int32 x2[2]; float x2f[2]; orc_int16 x4[4]; } orc_union64;
#endif
#ifndef TRUE