| The Gaudi Framework v28r2-patches (bc4ad17a)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

pfmlib_comp_x86_64.h
Go to the documentation of this file.
1 /*
2 * X86-64 compiler specific macros
3 *
4 * Copyright (c) 2005-2006 Hewlett-Packard Development Company, L.P.
5 * Contributed by Stephane Eranian <eranian@hpl.hp.com>
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
11 * of the Software, and to permit persons to whom the Software is furnished to do so,
12 * subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in all
15 * copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
21 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
22 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24 #ifndef __PFMLIB_COMP_X86_64_H__
25 #define __PFMLIB_COMP_X86_64_H__
26
27 #ifndef __PFMLIB_COMP_H__
28 #error "you should never include this file directly, use pfmlib_comp.h"
29 #endif
30
31 #ifndef __x86_64__
32 #error "you should not be including this file"
33 #endif
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 static inline unsigned long
40 pfmlib_popcnt(unsigned long v)
41 {
42 unsigned long sum = 0;
43
44 for(; v ; v >>=1) {
45 if (v & 0x1) sum++;
46 }
47 return sum;
48 }
49
50 #ifdef __cplusplus /* extern C */
51 }
52 #endif
53
54 #endif /* __PFMLIB_COMP_IA64_H__ */
sum
double sum(double x, double y, double z)
Definition: 3DoubleFuncTest.cpp:25