#define ORC_ISNAN(x) ((((x)&0x7f800000) == 0x7f800000) && (((x)&0x007fffff) != 0))
#define ORC_DENORMAL_DOUBLE(x) ((x) & ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == 0) ? ORC_UINT64_C(0xfff0000000000000) : ORC_UINT64_C(0xffffffffffffffff)))
#define ORC_ISNAN_DOUBLE(x) ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == ORC_UINT64_C(0x7ff0000000000000)) && (((x)&ORC_UINT64_C(0x000fffffffffffff)) != 0))
+#ifndef ORC_RESTRICT
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define ORC_RESTRICT restrict
#elif defined(__GNUC__) && __GNUC__ >= 4
#else
#define ORC_RESTRICT
#endif
+#endif
/* end Orc C target preamble */
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]; float x2f[2]; orc_int16 x4[4]; } orc_union64;
#endif
+#ifndef ORC_RESTRICT
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#define ORC_RESTRICT restrict
+#elif defined(__GNUC__) && __GNUC__ >= 4
+#define ORC_RESTRICT __restrict__
+#else
+#define ORC_RESTRICT
+#endif
+#endif
-void orc_memcpy (void * d1, const void * s1, int n);
-void orc_memset (void * d1, int p1, int n);
+void orc_memcpy (void * ORC_RESTRICT d1, const void * s1, int n);
+void orc_memset (void * ORC_RESTRICT d1, int p1, int n);
/* begin Orc C target preamble */
#define ORC_ISNAN(x) ((((x)&0x7f800000) == 0x7f800000) && (((x)&0x007fffff) != 0))
#define ORC_DENORMAL_DOUBLE(x) ((x) & ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == 0) ? ORC_UINT64_C(0xfff0000000000000) : ORC_UINT64_C(0xffffffffffffffff)))
#define ORC_ISNAN_DOUBLE(x) ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == ORC_UINT64_C(0x7ff0000000000000)) && (((x)&ORC_UINT64_C(0x000fffffffffffff)) != 0))
+#ifndef ORC_RESTRICT
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define ORC_RESTRICT restrict
#elif defined(__GNUC__) && __GNUC__ >= 4
#else
#define ORC_RESTRICT
#endif
+#endif
/* end Orc C target preamble */
/* orc_memcpy */
#ifdef DISABLE_ORC
void
-orc_memcpy (void * d1, const void * s1, int n){
+orc_memcpy (void * ORC_RESTRICT d1, const void * s1, int n){
int i;
orc_int8 * ORC_RESTRICT ptr0;
const orc_int8 * ORC_RESTRICT ptr4;
}
void
-orc_memcpy (void * d1, const void * s1, int n)
+orc_memcpy (void * ORC_RESTRICT d1, const void * s1, int n)
{
OrcExecutor _ex, *ex = &_ex;
static int p_inited = 0;
if (!p_inited) {
orc_once_mutex_lock ();
if (!p_inited) {
- OrcCompileResult result;
OrcProgram *p;
p = orc_program_new ();
orc_program_append_2 (p, "copyb", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1);
- result = orc_program_compile (p);
+ orc_program_compile (p);
c = orc_program_take_code (p);
orc_program_free (p);
}
/* orc_memset */
#ifdef DISABLE_ORC
void
-orc_memset (void * d1, int p1, int n){
+orc_memset (void * ORC_RESTRICT d1, int p1, int n){
int i;
orc_int8 * ORC_RESTRICT ptr0;
orc_int8 var32;
}
void
-orc_memset (void * d1, int p1, int n)
+orc_memset (void * ORC_RESTRICT d1, int p1, int n)
{
OrcExecutor _ex, *ex = &_ex;
static int p_inited = 0;
if (!p_inited) {
orc_once_mutex_lock ();
if (!p_inited) {
- OrcCompileResult result;
OrcProgram *p;
p = orc_program_new ();
orc_program_append_2 (p, "copyb", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1);
- result = orc_program_compile (p);
+ orc_program_compile (p);
c = orc_program_take_code (p);
orc_program_free (p);
}
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]; float x2f[2]; orc_int16 x4[4]; } orc_union64;
#endif
-void orc_memcpy (void * d1, const void * s1, int n);
-void orc_memset (void * d1, int p1, int n);
+#ifndef ORC_RESTRICT
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#define ORC_RESTRICT restrict
+#elif defined(__GNUC__) && __GNUC__ >= 4
+#define ORC_RESTRICT __restrict__
+#else
+#define ORC_RESTRICT
+#endif
+#endif
+void orc_memcpy (void * ORC_RESTRICT d1, const void * s1, int n);
+void orc_memset (void * ORC_RESTRICT d1, int p1, int n);
#ifdef __cplusplus
}
"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]; float x2f[2]; orc_int16 x4[4]; } orc_union64;\n"
+ "#endif\n"
+ "#ifndef ORC_RESTRICT\n"
+ "#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L\n"
+ "#define ORC_RESTRICT restrict\n"
+ "#elif defined(__GNUC__) && __GNUC__ >= 4\n"
+ "#define ORC_RESTRICT __restrict__\n"
+ "#else\n"
+ "#define ORC_RESTRICT\n"
+ "#endif\n"
"#endif\n";
}
"#define ORC_ISNAN(x) ((((x)&0x7f800000) == 0x7f800000) && (((x)&0x007fffff) != 0))\n"
"#define ORC_DENORMAL_DOUBLE(x) ((x) & ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == 0) ? ORC_UINT64_C(0xfff0000000000000) : ORC_UINT64_C(0xffffffffffffffff)))\n"
"#define ORC_ISNAN_DOUBLE(x) ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == ORC_UINT64_C(0x7ff0000000000000)) && (((x)&ORC_UINT64_C(0x000fffffffffffff)) != 0))\n"
+ "#ifndef ORC_RESTRICT\n"
"#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L\n"
"#define ORC_RESTRICT restrict\n"
"#elif defined(__GNUC__) && __GNUC__ >= 4\n"
"#else\n"
"#define ORC_RESTRICT\n"
"#endif\n"
+ "#endif\n"
"/* end Orc C target preamble */\n\n";
}
if (var->size) {
if (need_comma) fprintf(output, ", ");
if (var->type_name) {
- fprintf(output, "%s * %s", var->type_name,
+ fprintf(output, "%s * ORC_RESTRICT %s", var->type_name,
varnames[ORC_VAR_D1 + i]);
} else {
- fprintf(output, "orc_uint%d * %s", var->size*8,
+ fprintf(output, "orc_uint%d * ORC_RESTRICT %s", var->size*8,
varnames[ORC_VAR_D1 + i]);
}
if (p->is_2d) {
if (var->size) {
if (need_comma) fprintf(output, ", ");
if (var->type_name) {
- fprintf(output, "%s * %s", var->type_name,
+ fprintf(output, "%s * ORC_RESTRICT %s", var->type_name,
varnames[ORC_VAR_A1 + i]);
} else {
- fprintf(output, "orc_uint%d * %s", var->size*8,
+ fprintf(output, "orc_uint%d * ORC_RESTRICT %s", var->size*8,
varnames[ORC_VAR_A1 + i]);
}
need_comma = TRUE;
if (var->size) {
if (need_comma) fprintf(output, ", ");
if (var->type_name) {
- fprintf(output, "const %s * %s", var->type_name,
+ fprintf(output, "const %s * ORC_RESTRICT %s", var->type_name,
varnames[ORC_VAR_S1 + i]);
} else {
- fprintf(output, "const orc_uint%d * %s", var->size*8,
+ fprintf(output, "const orc_uint%d * ORC_RESTRICT %s", var->size*8,
varnames[ORC_VAR_S1 + i]);
}
if (p->is_2d) {