mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
Update.
* string/test-ffs.c: Also test ffsl and ffsll. * sysdeps/powerpc/ffs.c: Don't define ffsl for ppc64.
This commit is contained in:
@ -1,5 +1,9 @@
|
|||||||
2004-04-03 Ulrich Drepper <drepper@redhat.com>
|
2004-04-03 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* string/test-ffs.c: Also test ffsl and ffsll.
|
||||||
|
|
||||||
|
* sysdeps/powerpc/ffs.c: Don't define ffsl for ppc64.
|
||||||
|
|
||||||
* sysdeps/powerpc/powerpc64/bits/atomic.h: Never use matching
|
* sysdeps/powerpc/powerpc64/bits/atomic.h: Never use matching
|
||||||
constraints for asm mem parameters.
|
constraints for asm mem parameters.
|
||||||
* sysdeps/powerpc/bits/atomic.h: Likewise.
|
* sysdeps/powerpc/bits/atomic.h: Likewise.
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
2004-04-03 Ulrich Drepper <drepper@redhat.com>
|
2004-04-03 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
|
||||||
|
matching constraints for asm mem parameters.
|
||||||
|
|
||||||
* tst-clock2.c (tf): Don't define unless needed.
|
* tst-clock2.c (tf): Don't define unless needed.
|
||||||
|
|
||||||
2004-03-30 H.J. Lu <hongjiu.lu@intel.com>
|
2004-03-30 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
@ -93,7 +93,7 @@
|
|||||||
" bne- 1b\n" \
|
" bne- 1b\n" \
|
||||||
"2: " __lll_acq_instr \
|
"2: " __lll_acq_instr \
|
||||||
: "=&r" (__val), "=m" (*futex) \
|
: "=&r" (__val), "=m" (*futex) \
|
||||||
: "r" (futex), "r" (1), "1" (*futex) \
|
: "r" (futex), "r" (1), "m" (*futex) \
|
||||||
: "cr0", "memory"); \
|
: "cr0", "memory"); \
|
||||||
__val; \
|
__val; \
|
||||||
})
|
})
|
||||||
@ -110,7 +110,7 @@
|
|||||||
" bne- 1b\n" \
|
" bne- 1b\n" \
|
||||||
"2: " __lll_acq_instr \
|
"2: " __lll_acq_instr \
|
||||||
: "=&r" (__val), "=m" (*futex) \
|
: "=&r" (__val), "=m" (*futex) \
|
||||||
: "r" (futex), "r" (2), "1" (*futex) \
|
: "r" (futex), "r" (2), "m" (*futex) \
|
||||||
: "cr0", "memory"); \
|
: "cr0", "memory"); \
|
||||||
__val; \
|
__val; \
|
||||||
})
|
})
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1994, 1997, 2000 Free Software Foundation, Inc.
|
/* Copyright (C) 1994, 1997, 2000, 2004 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Joel Sherrill (jsherril@redstone-emh2.army.mil),
|
Contributed by Joel Sherrill (jsherril@redstone-emh2.army.mil),
|
||||||
On-Line Applications Research Corporation.
|
On-Line Applications Research Corporation.
|
||||||
@ -28,24 +28,32 @@ main (void)
|
|||||||
int failures = 0;
|
int failures = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
auto void try (int value, int expected);
|
auto void try (const char *name, long long int param, int value,
|
||||||
|
int expected);
|
||||||
|
|
||||||
void try (int value, int expected)
|
void try (const char *name, long long int param, int value, int expected)
|
||||||
{
|
{
|
||||||
if (ffs (value) != expected)
|
if (value != expected)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "%#x expected %d got %d\n",
|
printf ("%s(%#llx) expected %d got %d\n",
|
||||||
value, expected, ffs (value));
|
name, param, expected, value);
|
||||||
++failures;
|
++failures;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
printf ("%s(%#llx) as expected %d\n", name, param, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
try (0, 0);
|
#define TEST(fct, type) \
|
||||||
for (i=0 ; i<32 ; i++)
|
try (#fct, 0, fct ((type) 0), 0); \
|
||||||
try (1<<i, i+1);
|
for (i=0 ; i < 8 * sizeof (type); i++) \
|
||||||
for (i=0 ; i<32 ; i++)
|
try (#fct, 1ll << i, fct (((type) 1) << i), i + 1); \
|
||||||
try ((~0 >> i) << i, i+1);
|
for (i=0 ; i < 8 * sizeof (type) ; i++) \
|
||||||
try (0x80008000, 16);
|
try (#fct, (~0ll >> i) << i, fct ((~((type) 0) >> i) << i), i + 1); \
|
||||||
|
try (#fct, 0x80008000, fct ((type) 0x80008000), 16)
|
||||||
|
|
||||||
|
TEST (ffs, int);
|
||||||
|
TEST (ffsl, long int);
|
||||||
|
TEST (ffsll, long long int);
|
||||||
|
|
||||||
if (failures)
|
if (failures)
|
||||||
printf ("Test FAILED! %d failure%s.\n", failures, &"s"[failures == 1]);
|
printf ("Test FAILED! %d failure%s.\n", failures, &"s"[failures == 1]);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* Find first set bit in a word, counted from least significant end.
|
/* Find first set bit in a word, counted from least significant end.
|
||||||
For PowerPC.
|
For PowerPC.
|
||||||
Copyright (C) 1991, 1992, 1997, 1998 Free Software Foundation, Inc.
|
Copyright (C) 1991, 1992, 1997, 1998, 2004 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Torbjorn Granlund (tege@sics.se).
|
Contributed by Torbjorn Granlund (tege@sics.se).
|
||||||
|
|
||||||
@ -20,6 +20,7 @@
|
|||||||
02111-1307 USA. */
|
02111-1307 USA. */
|
||||||
|
|
||||||
#define ffsl __something_else
|
#define ffsl __something_else
|
||||||
|
#include <limits.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#undef ffs
|
#undef ffs
|
||||||
@ -35,8 +36,10 @@ __ffs (int x)
|
|||||||
return 32 - cnt;
|
return 32 - cnt;
|
||||||
}
|
}
|
||||||
weak_alias (__ffs, ffs)
|
weak_alias (__ffs, ffs)
|
||||||
|
#if ULONG_MAX == UINT_MAX
|
||||||
#undef ffsl
|
#undef ffsl
|
||||||
weak_alias (__ffs, ffsl)
|
weak_alias (__ffs, ffsl)
|
||||||
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#include <sysdeps/generic/ffs.c>
|
#include <sysdeps/generic/ffs.c>
|
||||||
|
Reference in New Issue
Block a user