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
  • kernel/genarch/src/softint/division.c

    r8e893ae rc7afcba7  
    2727 */
    2828
    29 /** @addtogroup genarch 
     29/** @addtogroup genarch
    3030 * @{
    3131 */
     
    186186}
    187187
     188int __divmodsi3(int a, int b, int *c)
     189{
     190        unsigned int rem;
     191        int result = (int) divandmod32(ABSVAL(a), ABSVAL(b), &rem);
     192       
     193        if (SGN(a) == SGN(b)) {
     194                *c = rem;
     195                return result;
     196        }
     197       
     198        *c = -rem;
     199        return -result;
     200}
     201
    188202unsigned int __udivmodsi3(unsigned int a, unsigned int b,
    189203    unsigned int *c)
     
    192206}
    193207
     208long long __divmoddi3(long long a, long long b, long long *c)
     209{
     210        unsigned long long rem;
     211        long long result = (int) divandmod64(ABSVAL(a), ABSVAL(b), &rem);
     212       
     213        if (SGN(a) == SGN(b)) {
     214                *c = rem;
     215                return result;
     216        }
     217       
     218        *c = -rem;
     219        return -result;
     220}
     221
    194222unsigned long long __udivmoddi3(unsigned long long a, unsigned long long b,
    195223    unsigned long long *c)
Note: See TracChangeset for help on using the changeset viewer.