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

Go to the source code of this file.

Functions

void softfloat_mul64To128M (uint64_t a, uint64_t b, uint32_t *zPtr)
 

Function Documentation

◆ softfloat_mul64To128M()

void softfloat_mul64To128M ( uint64_t a,
uint64_t b,
uint32_t * zPtr )

Definition at line 43 of file s_mul64To128M.c.

44{
45 uint32_t a32, a0, b32, b0;
46 uint64_t z0, mid1, z64, mid;
47
48 a32 = a>>32;
49 a0 = a;
50 b32 = b>>32;
51 b0 = b;
52 z0 = (uint64_t) a0 * b0;
53 mid1 = (uint64_t) a32 * b0;
54 mid = mid1 + (uint64_t) a0 * b32;
55 z64 = (uint64_t) a32 * b32;
56 z64 += (uint64_t) (mid < mid1)<<32 | mid>>32;
57 mid <<= 32;
58 z0 += mid;
59 zPtr[indexWord( 4, 1 )] = z0>>32;
60 zPtr[indexWord( 4, 0 )] = z0;
61 z64 += (z0 < mid);
62 zPtr[indexWord( 4, 3 )] = z64>>32;
63 zPtr[indexWord( 4, 2 )] = z64;
64
65}
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
#define indexWord(total, n)
unsigned int uint32_t
Definition stdint.h:126
unsigned __int64 uint64_t
Definition stdint.h:136