Eine aufbereitete Darstellung der Quelle

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

Benutzer

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 in Prozent
C=85 H=92 G=88

¤ Dauer der Verarbeitung: 0.15 Sekunden  (vorverarbeitet am  2026-06-18) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

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

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik