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

Go to the source code of this file.

Functions

struct uint128 softfloat_mul128By32 (uint64_t a64, uint64_t a0, uint32_t b)
 

Function Documentation

◆ softfloat_mul128By32()

struct uint128 softfloat_mul128By32 ( uint64_t a64,
uint64_t a0,
uint32_t b )

Definition at line 43 of file s_mul128By32.c.

44{
45 struct uint128 z;
46 uint_fast64_t mid;
47 uint_fast32_t carry;
48
49 z.v0 = a0 * b;
50 mid = (uint_fast64_t) (uint32_t) (a0>>32) * b;
51 carry = (uint32_t) ((uint_fast32_t) (z.v0>>32) - (uint_fast32_t) mid);
52 z.v64 = a64 * b + (uint_fast32_t) ((mid + carry)>>32);
53 return z;
54
55}
unsigned int uint32_t
Definition stdint.h:126
uint64_t uint_fast64_t
Definition stdint.h:157
uint32_t uint_fast32_t
Definition stdint.h:156