Changeset 88d5c1e in mainline for uspace/lib/softint/generic


Ignore:
Timestamp:
2012-04-07T17:55:10Z (13 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
41455a22
Parents:
8bcd727
Message:

softfloat redesign

  • avoid hardwired type sizes, actual sizes are determined at compile-time
  • add basic support for x87 extended-precision data types (stored as 96bit long double)
  • a lot of coding style changes (removal of CamelCase, etc.)
File:
1 edited

Legend:

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

    r8bcd727 r88d5c1e  
    188188}
    189189
     190int __divmodsi3(int a, int b, int *c)
     191{
     192        unsigned int rem;
     193        int result = (int) divandmod32(ABSVAL(a), ABSVAL(b), &rem);
     194       
     195        if (SGN(a) == SGN(b)) {
     196                *c = rem;
     197                return result;
     198        }
     199       
     200        *c = -rem;
     201        return -result;
     202}
     203
    190204unsigned int __udivmodsi3(unsigned int a, unsigned int b,
    191205    unsigned int *c)
     
    194208}
    195209
     210long long __divmoddi3(long long a, long long b, long long *c)
     211{
     212        unsigned long long rem;
     213        long long result = (int) divandmod64(ABSVAL(a), ABSVAL(b), &rem);
     214       
     215        if (SGN(a) == SGN(b)) {
     216                *c = rem;
     217                return result;
     218        }
     219       
     220        *c = -rem;
     221        return -result;
     222}
     223
    196224unsigned long long __udivmoddi3(unsigned long long a, unsigned long long b,
    197225    unsigned long long *c)
Note: See TracChangeset for help on using the changeset viewer.