]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/powerpc/quad_float.h
Update.
[thirdparty/glibc.git] / sysdeps / powerpc / quad_float.h
1 /* Internal libc stuff for 128-bit IEEE FP emulation routines.
2 Copyright (C) 1997 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If not,
17 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
19
20 #ifndef _QUAD_FLOAT_H
21 #define _QUAD_FLOAT_H 1
22
23 #include <fenv_libc.h>
24
25 /* Returns the number of leading zero bits in 'x' (between 0 and 32
26 inclusive). 'x' is treated as being 32 bits long. */
27 #define cntlzw(x) \
28 ({ unsigned p = (x); \
29 unsigned r; \
30 asm ("cntlzw %0,%1" : "=r"(r) : "r"(p)); \
31 r; })
32
33 /* Returns the number of leading zero bits in 'x' (between 0 and 64
34 inclusive). 'x' is treated as being 64 bits long. */
35 #define cntlzd(x) \
36 ({ unsigned long long q = (x); \
37 unsigned int c1, c2; \
38 c1 = cntlzw(q >> 32); \
39 c2 = cntlzw(q); \
40 c1 + (-(c1 >> 5) & c2); })
41
42 #define shift_and_or
43
44 #endif /* quad_float.h */