Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  popcount.h   Sprache: C

 
/*
 * popcount.h
 *
 * This header file contains various declaration for population count
 *
 * Version Log:
 *   0.1  18 March 2008 (first released to public -- GUAVA 3.3)   
 *  
 * CJ, Tjhai 
 * email: ctjhai@plymouth.ac.uk
 * Homepage: www.plymouth.ac.uk/staff/ctjhai
 *
 */


#ifndef _POPCOUNT_H
#define _POPCOUNT_H

#include "config.h"

/* Global variable -- only used for LUT-based popcount */
#if defined(POPCOUNT_LUT8) || defined(POPCOUNT_LUT16)
extern unsigned short *__popcnt_LUT;
#endif

/* Function prototypes */
void init_popcount(void);
void __init_popcount_LUT(void);
void clear_popcount(void);
void __clear_popcount_LUT(void);

/* The following contains the macros that actually do the population count */
#if defined(POPCOUNT_LUT8)  /* 8-bit LUT */
if BITS_PER_LONG == 64 /* 64-bit machine */
 define popcount(__v)   (__popcnt_LUT[__v & 0xFFUL] + __popcnt_LUT[(__v>>8) & 0xFFUL] + \
                          __popcnt_LUT[(__v>>16) & 0xFFUL] + __popcnt_LUT[(__v>>24) & 0xFFUL] + \
                          __popcnt_LUT[(__v>>32) & 0xFFUL] + __popcnt_LUT[(__v>>40) & 0xFFUL] + \
                          __popcnt_LUT[(__v>>48) & 0xFFUL] + __popcnt_LUT[(__v>>56) & 0xFFUL])
else     /* 32-bit machine */
 define popcount(__v)   (__popcnt_LUT[__v & 0xFFU] + __popcnt_LUT[(__v>>8) & 0xFFU] + \
                          __popcnt_LUT[(__v>>16) & 0xFFU] + __popcnt_LUT[(__v>>24) & 0xFFU])
endif     
#elif defined(POPCOUNT_LUT16) /* 16-bit LUT */
if BITS_PER_LONG == 64 /* 64-bit machine */
 define popcount(__v)   (__popcnt_LUT[__v & 0xFFFFUL] + __popcnt_LUT[(__v>>16) & 0xFFFFUL] + \
                          __popcnt_LUT[(__v>>32) & 0xFFFFUL] + __popcnt_LUT[(__v>>48) & 0xFFFFUL])
else     /* 32-bit machine */
 define popcount(__v)   (__popcnt_LUT[__v & 0xFFFFU] + __popcnt_LUT[(__v>>16) & 0xFFFFU])
endif     
#elif defined(POPCOUNT_STD)
 unsigned int popcount(unsigned long x);
#endif

#endif /* _POPCOUNT_H */

Messung V0.5
C=96 H=100 G=97

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge