[xcc] minor performance tweaks
[riscv-isa-sim.git] / softfloat / s_shift128RightJam.c
1
2 #include <stdint.h>
3 #include "platform.h"
4 #include "primitives.h"
5
6 struct uint128
7 softfloat_shift128RightJam( uint64_t a64, uint64_t a0, unsigned int count )
8 {
9 unsigned int negCount;
10 struct uint128 z;
11
12 if ( count < 64 ) {
13 negCount = - count;
14 z.v64 = a64>>( count & 63 );
15 z.v0 =
16 a64<<( negCount & 63 ) | a0>>count
17 | ( (uint64_t) ( a0<<( negCount & 63 ) ) != 0 );
18 } else {
19 z.v64 = 0;
20 z.v0 =
21 ( count < 128 )
22 ? a64>>( count & 63 )
23 | ( ( ( a64 & ( ( (uint64_t) 1<<( count & 63 ) ) - 1 ) )
24 | a0 )
25 != 0 )
26 : ( ( a64 | a0 ) != 0 );
27 }
28 return z;
29
30 }
31