Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
s_countLeadingZeros64.c File Reference
#include <stdint.h>
#include "platform.h"
#include "primitives.h"
Include dependency graph for s_countLeadingZeros64.c:

Go to the source code of this file.

Macros

#define softfloat_countLeadingZeros64   softfloat_countLeadingZeros64
 

Functions

uint_fast8_t softfloat_countLeadingZeros64 (uint64_t a)
 

Macro Definition Documentation

◆ softfloat_countLeadingZeros64

#define softfloat_countLeadingZeros64   softfloat_countLeadingZeros64

Definition at line 42 of file s_countLeadingZeros64.c.

Function Documentation

◆ softfloat_countLeadingZeros64()

uint_fast8_t softfloat_countLeadingZeros64 ( uint64_t a)

Definition at line 45 of file s_countLeadingZeros64.c.

46{
48 uint32_t a32;
49
50 count = 0;
51 a32 = a>>32;
52 if ( ! a32 ) {
53 count = 32;
54 a32 = a;
55 }
56 /*------------------------------------------------------------------------
57 | From here, result is current count + count leading zeros of `a32'.
58 *------------------------------------------------------------------------*/
59 if ( a32 < 0x10000 ) {
60 count += 16;
61 a32 <<= 16;
62 }
63 if ( a32 < 0x1000000 ) {
64 count += 8;
65 a32 <<= 8;
66 }
68 return count;
69
70}
int * count
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
const uint_least8_t softfloat_countLeadingZeros8[256]
unsigned int uint32_t
Definition stdint.h:126
uint8_t uint_fast8_t
Definition stdint.h:154