summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Cloos <cloos@jhcloos.com>2011-04-04 11:36:03 -0400
committerJames Cloos <cloos@jhcloos.com>2011-04-04 11:51:08 -0400
commit94dc0c20554f3a3d709711f2c43ac65ab7c68afe (patch)
treee074cfdf51f34ce606020f84e5c047ea8bafd631
parent948a8fb674c99ff41ae108b986721a4fd15c6a0e (diff)
* src/base/ftcalc.c (FT_MulFix): Produce more efficient assembly.HEADmaster
Improve the version of FT_MulFix() which is used when a sixty-four bit interger type is available.
-rw-r--r--ChangeLog4
-rw-r--r--src/base/ftcalc.c20
2 files changed, 7 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 0744fa5b..af3c9084 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-04-04 James Cloos <cloos@jhcloos.com>
+ * src/base/ftcalc.c (FT_MulFix): Produce more efficient
+ assembly.
+
2011-04-04 Werner Lemberg <wl@gnu.org>
Fix formatting of autofit debug dumps.
diff --git a/src/base/ftcalc.c b/src/base/ftcalc.c
index 3892fabf..b7866abc 100644
--- a/src/base/ftcalc.c
+++ b/src/base/ftcalc.c
@@ -202,25 +202,11 @@
#else
- FT_Int s = 1;
- FT_Long c;
+ FT_Int64 c;
+ c = (FT_Int64)a * b;
- if ( a < 0 )
- {
- a = -a;
- s = -1;
- }
-
- if ( b < 0 )
- {
- b = -b;
- s = -s;
- }
-
- c = (FT_Long)( ( (FT_Int64)a * b + 0x8000L ) >> 16 );
-
- return ( s > 0 ) ? c : -c;
+ return (FT_Long)((c + 0x8000 - (c < 0)) >> 16);
#endif /* FT_MULFIX_ASSEMBLER */
}