summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDavid Schleef <ds@ginger.bigkitten.com>2008-05-20 17:49:51 -0700
committerDavid Schleef <ds@ginger.bigkitten.com>2008-05-20 17:49:51 -0700
commit96ab77890292b54c861a9c4b208c827e177b919d (patch)
tree01de82eafb7e4beadae33dc1084364f0666125b3 /examples
parent87e3d77bd3a3398ea22c7645817ceeea547dc7eb (diff)
downloadliboil-96ab77890292b54c861a9c4b208c827e177b919d.tar.gz
[orc] changes to register allocation and addition emit functions to make
mmx target work
Diffstat (limited to 'examples')
-rw-r--r--examples/orc/jit.c16
-rw-r--r--examples/orc/simple.c2
2 files changed, 14 insertions, 4 deletions
diff --git a/examples/orc/jit.c b/examples/orc/jit.c
index 35df92c..868d9a4 100644
--- a/examples/orc/jit.c
+++ b/examples/orc/jit.c
@@ -39,6 +39,13 @@ main (int argc, char *argv[])
orc_program_append (p, "add_s16", t1, t1, offset);
orc_program_append (p, "rshift_s16", d1, t1, shift);
+#if 0
+ orc_program_append (p, "lshift_s16", t1, t1, shift);
+ orc_program_append (p, "sub_s16", t1, t1, shift);
+ orc_program_append (p, "mul_s16", t1, t1, shift);
+ //orc_program_append (p, "_loadi_s16", t1, t1, shift);
+#endif
+
ex = orc_executor_new (p);
orc_executor_set_n (ex, N);
@@ -46,9 +53,9 @@ main (int argc, char *argv[])
orc_executor_set_array (ex, s2, src2);
orc_executor_set_array (ex, d1, dest);
- orc_program_compile_x86 (p);
+ orc_program_compile (p);
- if (0) {
+ if (1) {
int i;
for(i=0;i<N;i++){
@@ -77,8 +84,11 @@ void
test1 (int16_t *dest, int16_t *src1, int16_t *src2, int n)
{
int i;
+ int16_t t1, t2;
for(i=0;i<n;i++){
- dest[i] = (src1[i] + src2[i] + 1)>>1;
+ t1 = src1[i] + src2[i];
+ t2 = t1 + 1;
+ dest[i] = t2>>1;
}
}
diff --git a/examples/orc/simple.c b/examples/orc/simple.c
index dac5864..4d80282 100644
--- a/examples/orc/simple.c
+++ b/examples/orc/simple.c
@@ -42,7 +42,7 @@ test1(void)
orc_program_append (p, "add_s16", d1, s1, s2);
- orc_program_compile_x86 (p);
+ orc_program_compile (p);
ex = orc_executor_new (p);
orc_executor_set_n (ex, N);