Changeset 9abe2e5 in mainline


Ignore:
Timestamp:
2017-05-04T22:23:34Z (8 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f233840
Parents:
db8626d
Message:

add support for [u]divmoddi4

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/include/genarch/softint/division.h

    rdb8626d r9abe2e5  
    6262extern unsigned long long __udivmoddi3(unsigned long long, unsigned long long,
    6363    unsigned long long *);
     64extern unsigned long long __udivmoddi4(unsigned long long, unsigned long long,
     65    unsigned long long *);
    6466
    6567#endif
  • kernel/genarch/src/softint/division.c

    rdb8626d r9abe2e5  
    226226}
    227227
     228unsigned long long __udivmoddi4(unsigned long long a, unsigned long long b,
     229    unsigned long long *c)
     230{
     231        return divandmod64(a, b, c);
     232}
     233
     234
     235
    228236/** @}
    229237 */
  • uspace/lib/softint/generic/division.c

    rdb8626d r9abe2e5  
    222222}
    223223
     224long long __divmoddi4(long long a, long long b, long long *c)
     225{
     226        unsigned long long rem;
     227        long long result = (int) divandmod64(ABSVAL(a), ABSVAL(b), &rem);
     228       
     229        if (SGN(a) == SGN(b)) {
     230                *c = rem;
     231                return result;
     232        }
     233       
     234        *c = -rem;
     235        return -result;
     236}
     237
    224238unsigned long long __udivmoddi3(unsigned long long a, unsigned long long b,
    225239    unsigned long long *c)
     
    228242}
    229243
     244unsigned long long __udivmoddi4(unsigned long long a, unsigned long long b,
     245    unsigned long long *c)
     246{
     247        return divandmod64(a, b, c);
     248}
     249
    230250/** @}
    231251 */
  • uspace/lib/softint/include/division.h

    rdb8626d r9abe2e5  
    5353
    5454extern long long __divmoddi3(long long, long long, long long *);
     55extern long long __divmoddi4(long long, long long, long long *);
    5556extern unsigned long long __udivmoddi3(unsigned long long, unsigned long long,
     57    unsigned long long *);
     58extern unsigned long long __udivmoddi4(unsigned long long, unsigned long long,
    5659    unsigned long long *);
    5760
Note: See TracChangeset for help on using the changeset viewer.