aboutsummaryrefslogtreecommitdiffstats
path: root/devel/allegro/files/extra-patch-include-allegro-inline-fmaths.in
diff options
context:
space:
mode:
Diffstat (limited to 'devel/allegro/files/extra-patch-include-allegro-inline-fmaths.in')
-rw-r--r--devel/allegro/files/extra-patch-include-allegro-inline-fmaths.in43
1 files changed, 43 insertions, 0 deletions
diff --git a/devel/allegro/files/extra-patch-include-allegro-inline-fmaths.in b/devel/allegro/files/extra-patch-include-allegro-inline-fmaths.in
new file mode 100644
index 000000000000..657cff75a39f
--- /dev/null
+++ b/devel/allegro/files/extra-patch-include-allegro-inline-fmaths.in
@@ -0,0 +1,43 @@
+--- include/allegro/inline/fmaths.inl.orig Sun Jun 5 18:23:46 2005
++++ include/allegro/inline/fmaths.inl Thu Aug 11 18:53:53 2005
+@@ -103,40 +103,11 @@
+
+ AL_INLINE(fixed, fixmul, (fixed x, fixed y),
+ {
+- /* In benchmarks conducted circa May 2005 we found that, in the main:
+- * - IA32 machines performed faster with one implementation;
+- * - AMD64 and G4 machines performed faster with another implementation.
+- *
+- * Benchmarks were mainly done with differing versions of gcc.
+- * Results varied with other compilers, optimisation levels, etc.
+- * so this is not optimal, though a tenable compromise.
+- */
+- #if (defined ALLEGRO_I386) || (!defined LONG_LONG)
+-
+- fixed sign = (x^y) & 0x80000000;
+- int mask_x = x >> 31;
+- int mask_y = y >> 31;
+- int mask_result = sign >> 31;
+- fixed result;
+-
+- x = (x^mask_x) - mask_x;
+- y = (y^mask_y) - mask_y;
+-
+- result = ((y >> 8)*(x >> 8) +
+- (((y >> 8)*(x&0xff)) >> 8) +
+- (((x >> 8)*(y&0xff)) >> 8));
+-
+- return (result^mask_result) - mask_result;
+-
+- #else
+-
+ LONG_LONG lx = x;
+ LONG_LONG ly = y;
+ LONG_LONG lres = (lx*ly)>>16;
+ int res = lres;
+ return res;
+-
+- #endif
+ })
+
+