Changeset aec41c8 in mainline


Ignore:
Timestamp:
2018-01-16T19:00:48Z (6 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d39c46e0
Parents:
8348846
Message:

libsoftint, take two

Location:
uspace/lib/softint/generic
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/softint/generic/comparison.c

    r8348846 raec41c8  
    9191int ALIAS(__cmp, i2);
    9292int ALIAS(__ucmp, i2);
     93#else
     94
     95int __cmpdi2(long a, long b)
     96{
     97        if ((int)a < (int)b) {
     98                return LESSER;
     99        } else if ((int)a > (int)b) {
     100                return GREATER;
     101        } else {
     102                return EQUAL;
     103        }
     104}
     105
     106int __ucmpdi2(unsigned long a, unsigned long b)
     107{
     108        if ((int)a < (int)b) {
     109                return LESSER;
     110        } else if ((int)a > (int)b) {
     111                return GREATER;
     112        } else {
     113                return EQUAL;
     114        }
     115}
     116
    93117#endif
    94118
  • uspace/lib/softint/generic/multiplication.c

    r8348846 raec41c8  
    123123#if LONG_MAX == LLONG_MAX
    124124long ALIAS(__mul, i3);
     125#else
     126long __muldi3(long a, long b)
     127{
     128        return (int)a * (int)b;
     129}
    125130#endif
    126131
  • uspace/lib/softint/generic/shift.c

    r8348846 raec41c8  
    126126long long __aeabi_llsl(long long val, int shift)
    127127{
    128         return __ashldi3(val, shift);
     128        return __ashlti3(val, shift);
    129129}
    130130
    131131long long __aeabi_llsr(long long val, int shift)
    132132{
    133         return __lshrdi3(val, shift);
     133        return __lshrti3(val, shift);
    134134}
    135135
     
    138138long ALIAS(__ashr, i3);
    139139long ALIAS(__lshr, i3);
     140#else
     141
     142long __ashldi3(long val, int shift)
     143{
     144        return ((int) val) << shift;
     145}
     146
     147long __ashrdi3(long val, int shift)
     148{
     149        return ((int) val) >> shift;
     150}
     151
     152long __lshrdi3(long val, int shift)
     153{
     154        return ((unsigned int) val) >> shift;
     155}
     156
    140157#endif
    141158
Note: See TracChangeset for help on using the changeset viewer.