diff options
Diffstat (limited to 'contrib/gcc/config/fixunssfsi.c')
-rw-r--r-- | contrib/gcc/config/fixunssfsi.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/contrib/gcc/config/fixunssfsi.c b/contrib/gcc/config/fixunssfsi.c new file mode 100644 index 0000000..f318749 --- /dev/null +++ b/contrib/gcc/config/fixunssfsi.c @@ -0,0 +1,17 @@ +/* Public domain. */ +typedef unsigned int USItype __attribute__ ((mode (SI))); +typedef int SItype __attribute__ ((mode (SI))); +typedef float SFtype __attribute__ ((mode (SF))); + +USItype __fixunssfsi (SFtype); + +#define SItype_MIN \ + (- ((SItype) (((USItype) 1 << ((sizeof (SItype) * 8) - 1)) - 1)) - 1) + +USItype +__fixunssfsi (SFtype a) +{ + if (a >= - (SFtype) SItype_MIN) + return (SItype) (a + SItype_MIN) - SItype_MIN; + return (SItype) a; +} |