aboutsummaryrefslogtreecommitdiff
path: root/softfloat/s_shortShift128ExtraRightJam.c
blob: cd2d77121e9293be273f0616326f0a6622fb542e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// See LICENSE.SoftFloat for license details.


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

struct uint128_extra
 softfloat_shortShift128ExtraRightJam(
     uint64_t a64, uint64_t a0, uint64_t extra, unsigned int count )
{
    unsigned int negCount;
    struct uint128_extra z;

    negCount = - count;
    z.v64 = a64>>count;
    z.v0 = a64<<( negCount & 63 ) | a0>>count;
    z.extra = a0<<( negCount & 63 ) | ( extra != 0 );
    return z;

}