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

Go to the source code of this file.

Functions

struct uint128_extra softfloat_shiftRightJam128Extra (uint64_t a64, uint64_t a0, uint64_t extra, uint_fast32_t dist)
 

Function Documentation

◆ softfloat_shiftRightJam128Extra()

struct uint128_extra softfloat_shiftRightJam128Extra ( uint64_t a64,
uint64_t a0,
uint64_t extra,
uint_fast32_t dist )

Definition at line 44 of file s_shiftRightJam128Extra.c.

46{
47 uint_fast8_t u8NegDist;
48 struct uint128_extra z;
49
50 u8NegDist = -dist;
51 if ( dist < 64 ) {
52 z.v.v64 = a64>>dist;
53 z.v.v0 = a64<<(u8NegDist & 63) | a0>>dist;
54 z.extra = a0<<(u8NegDist & 63);
55 } else {
56 z.v.v64 = 0;
57 if ( dist == 64 ) {
58 z.v.v0 = a64;
59 z.extra = a0;
60 } else {
61 extra |= a0;
62 if ( dist < 128 ) {
63 z.v.v0 = a64>>(dist & 63);
64 z.extra = a64<<(u8NegDist & 63);
65 } else {
66 z.v.v0 = 0;
67 z.extra = (dist == 128) ? a64 : (a64 != 0);
68 }
69 }
70 }
71 z.extra |= (extra != 0);
72 return z;
73
74}
uint8_t uint_fast8_t
Definition stdint.h:154
Here is the caller graph for this function: