Changeset c7afcba7 in mainline for boot/genarch/src/division.c


Ignore:
Timestamp:
2012-04-07T17:50:49Z (12 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
446ac2a
Parents:
8e893ae
Message:

unification and cstyle

File:
1 edited

Legend:

Unmodified
Added
Removed
  • boot/genarch/src/division.c

    r8e893ae rc7afcba7  
    183183}
    184184
     185int __divmodsi3(int a, int b, int *c)
     186{
     187        unsigned int rem;
     188        int result = (int) divandmod32(ABSVAL(a), ABSVAL(b), &rem);
     189       
     190        if (SGN(a) == SGN(b)) {
     191                *c = rem;
     192                return result;
     193        }
     194       
     195        *c = -rem;
     196        return -result;
     197}
     198
    185199unsigned int __udivmodsi3(unsigned int a, unsigned int b,
    186200    unsigned int *c)
     
    189203}
    190204
     205long long __divmoddi3(long long a, long long b, long long *c)
     206{
     207        unsigned long long rem;
     208        long long result = (int) divandmod64(ABSVAL(a), ABSVAL(b), &rem);
     209       
     210        if (SGN(a) == SGN(b)) {
     211                *c = rem;
     212                return result;
     213        }
     214       
     215        *c = -rem;
     216        return -result;
     217}
     218
    191219unsigned long long __udivmoddi3(unsigned long long a, unsigned long long b,
    192220    unsigned long long *c)
Note: See TracChangeset for help on using the changeset viewer.