crafty problem
authorMatthias Braun <matze@braunis.de>
Sun, 21 Sep 2008 21:05:51 +0000 (21:05 +0000)
committerMatthias Braun <matze@braunis.de>
Sun, 21 Sep 2008 21:05:51 +0000 (21:05 +0000)
[r22151]

ir/be/test/codegen/crafty.c [new file with mode: 0644]

diff --git a/ir/be/test/codegen/crafty.c b/ir/be/test/codegen/crafty.c
new file mode 100644 (file)
index 0000000..ffd5def
--- /dev/null
@@ -0,0 +1,22 @@
+int first_ones[256];
+
+  int FirstOne(unsigned long long arg1)
+  {
+    union doub {
+      unsigned short i[4];
+      unsigned long long d;
+    };
+    union doub x;
+    x.d=arg1;
+
+    if (x.i[3])
+      return (first_ones[x.i[3]]);
+    if (x.i[2])
+      return (first_ones[x.i[2]]+16);
+    if (x.i[1])
+      return (first_ones[x.i[1]]+32);
+    if (x.i[0])
+      return (first_ones[x.i[0]]+48);
+
+    return(64);
+  }