}
const char *
-orc_target_c_get_asm_preamble (void)
+orc_target_c_get_typedefs (void)
{
- return "\n"
- "/* begin Orc C target preamble */\n"
+ return
"#ifndef _ORC_INTEGER_TYPEDEFS_\n"
"#define _ORC_INTEGER_TYPEDEFS_\n"
"#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L\n"
"#endif\n"
"typedef union { orc_int32 i; float f; } orc_union32;\n"
"typedef union { orc_int64 i; double f; } orc_union64;\n"
- "#endif\n"
+ "#endif\n";
+}
+
+const char *
+orc_target_c_get_asm_preamble (void)
+{
+ return "\n"
+ "/* begin Orc C target preamble */\n"
"#define ORC_CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x)))\n"
"#define ORC_ABS(a) ((a)<0 ? -(a) : (a))\n"
"#define ORC_MIN(a,b) ((a)<(b) ? (a) : (b))\n"
output_code_header (programs[i], output);
}
fprintf(output, "\n");
+ fprintf(output, "%s", orc_target_c_get_typedefs ());
fprintf(output, "%s", orc_target_get_asm_preamble ("c"));
fprintf(output, "\n");
for(i=0;i<n;i++){
fprintf(output, "extern \"C\" {\n");
fprintf(output, "#endif\n");
fprintf(output, "\n");
+ fprintf(output, "%s", orc_target_c_get_typedefs ());
+ fprintf(output, "\n");
for(i=0;i<n;i++){
output_code_header (programs[i], output);
}
fprintf(output, "#include <%s>\n", include_file);
}
fprintf(output, "\n");
+ fprintf(output, "%s", orc_target_c_get_typedefs ());
fprintf(output, "%s", orc_target_get_asm_preamble ("c"));
fprintf(output, "\n");
for(i=0;i<n;i++){
fprintf(output, "%s * %s", var->type_name,
varnames[ORC_VAR_D1 + i]);
} else {
- fprintf(output, "uint%d_t * %s", var->size*8,
+ fprintf(output, "orc_uint%d * %s", var->size*8,
varnames[ORC_VAR_D1 + i]);
}
if (p->is_2d) {
fprintf(output, "%s * %s", var->type_name,
varnames[ORC_VAR_A1 + i]);
} else {
- fprintf(output, "uint%d_t * %s", var->size*8,
+ fprintf(output, "orc_uint%d * %s", var->size*8,
varnames[ORC_VAR_A1 + i]);
}
need_comma = TRUE;
fprintf(output, "const %s * %s", var->type_name,
varnames[ORC_VAR_S1 + i]);
} else {
- fprintf(output, "const uint%d_t * %s", var->size*8,
+ fprintf(output, "const orc_uint%d * %s", var->size*8,
varnames[ORC_VAR_S1 + i]);
}
if (p->is_2d) {