aboutsummaryrefslogtreecommitdiff
path: root/softfloat/s_mul128By64To192.c
blob: dfa8825c1d2e8261912cd32b8db9b702f5c81f6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

#include <stdint.h>
#include "platform.h"
#include "primitives.h"

struct uint192
 softfloat_mul128By64To192( uint64_t a64, uint64_t a0, uint64_t b )
{
    struct uint128 p0, p64;
    struct uint192 z;

    p0 = softfloat_mul64To128( a0, b );
    z.v0 = p0.v0;
    p64 = softfloat_mul64To128( a64, b );
    z.v64 = p64.v0 + p0.v64;
    z.v128 = p64.v64 + ( z.v64 < p64.v0 );
    return z;

}