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

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

struct uint64_extra
 softfloat_shift64ExtraRightJam(
     uint64_t a, uint64_t extra, unsigned int count )
{
    struct uint64_extra z;

    if ( count < 64 ) {
        z.v = a>>count;
        z.extra = a<<( ( - count ) & 63 );
    } else {
        z.v = 0;
        z.extra = ( count == 64 ) ? a : ( a != 0 );
    }
    z.extra |= ( extra != 0 );
    return z;

}