[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [patches] [PATCH] Make libm smaller using wrappers



Maxim Kuvyrkov wrote:
Joseph S. Myers wrote:
...
All new tests should be using the test-skeleton infrastructure if possible.

Noted.  I'll update the testcase.

I've attached the incremental patch that fixes the new test and removes the outdated comment.

OK to commit?

...

The work I've done follows the above recipe for ldbl-* functions. The wrappers for dbl-64/ can be optimized a bit due to the fact that there's only one dbl implementation, so alias handling does not require special attention. One can use dbl-wrap/fn.c instead of dbl-wrap/fn-wrap.c and have the alias directives right there.

I've looked through the patch to refresh my memory and the above statement appears to be a bit misleading. In fact all dbl-* and most of the ldbl-* functions override the canonical implementation with [l]dbl-wrap/fn.c (not [l]dbl-wrap/fn-wrap.c). That is because only s_<something>.c files do tricky symbol manipulations; e_<something>.c files, which usually are the ones that take a lot of space, are easier to handle.

Regards,

--
Maxim Kuvyrkov
CodeSourcery
maxim@xxxxxxxxxxxxxxxx
(650) 331-3385 x724
commit 76f08695012866e05613c77d58a79825f55fa1bd
Author: Maxim Kuvyrkov <maxim@xxxxxxxxxxxxxxxx>
Date:   Thu Nov 19 05:21:09 2009 -0800

    fix

diff --git a/math/gen-libm-test.pl b/math/gen-libm-test.pl
index b916506..3a8f5c5 100755
--- a/math/gen-libm-test.pl
+++ b/math/gen-libm-test.pl
@@ -649,7 +649,6 @@ sub get_ulps {
 
   if ($type eq 'complex') {
     my ($res);
-    # Return 0 instead of BUILD_COMPLEX (0,0)
     if (!exists $results{$test}{'real'}{'ulp'}{$float} &&
 	!exists $results{$test}{'imag'}{'ulp'}{$float}) {
       return "BUILD_COMPLEX ($default_ulp, $default_ulp)";
diff --git a/math/test-dbl-wrap.c b/math/test-dbl-wrap.c
index c5dfe2d..07be1dd 100644
--- a/math/test-dbl-wrap.c
+++ b/math/test-dbl-wrap.c
@@ -3,8 +3,8 @@
 
 #define N 4
 
-int
-main (void)
+static int
+do_test (int argc, char *argv[])
 {
   int i;
   int result = 0;
@@ -106,3 +106,5 @@ main (void)
 
   return result;
 }
+
+#include "../test-skeleton.c"