Changeset 88d5c1e in mainline for uspace/lib/softint


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.)
Location:
uspace/lib/softint
Files:
6 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)
  • uspace/lib/softint/include/comparison.h

    r8bcd727 r88d5c1e  
    3838
    3939/* Signed comparison (a < b => 0, a == b => 1, a > b => 2). */
    40 int __cmpdi2 (long long a, long long b);
     40extern int __cmpdi2(long long, long long);
    4141
    4242/* Unsigned comparison (a < b => 0, a == b => 1, a > b => 2). */
    43 int __ucmpdi2 (unsigned long long a, unsigned long long b);
     43extern int __ucmpdi2(unsigned long long, unsigned long long);
    4444
    4545#endif
  • uspace/lib/softint/include/division.h

    r8bcd727 r88d5c1e  
    2929/** @addtogroup softint
    3030 * @{
    31  */ 
     31 */
    3232/**
    3333 * @file
     
    4949extern unsigned long long __umoddi3(unsigned long long, unsigned long long);
    5050
     51extern int __divmodsi3(int, int, int *);
    5152extern unsigned int __udivmodsi3(unsigned int, unsigned int, unsigned int *);
     53
     54extern long long __divmoddi3(long long, long long, long long *);
    5255extern unsigned long long __udivmoddi3(unsigned long long, unsigned long long,
    5356    unsigned long long *);
  • uspace/lib/softint/include/lltype.h

    r8bcd727 r88d5c1e  
    3939#include <stdint.h>
    4040
    41 #define HALF_BIT_CNT (sizeof(int32_t) * sizeof(char))
    42 #define WHOLE_BIT_CNT (sizeof(int64_t) * sizeof(char))
     41#define HALF_BIT_CNT   (sizeof(int32_t) * sizeof(char))
     42#define WHOLE_BIT_CNT  (sizeof(int64_t) * sizeof(char))
    4343
    4444#ifdef __BE__
  • uspace/lib/softint/include/multiplication.h

    r8bcd727 r88d5c1e  
    2929/** @addtogroup softint
    3030 * @{
    31  */ 
     31 */
    3232/**
    3333 * @file
     
    3838
    3939/* 64 bit multiplication */
    40 long long __muldi3(long long a, long long b);
     40extern long long __muldi3(long long, long long);
    4141
    4242#endif
  • uspace/lib/softint/include/shift.h

    r8bcd727 r88d5c1e  
    3838
    3939/* Arithmetic/logical shift left. */
    40 long long __ashldi3 (long long val, int shift);
     40extern long long __ashldi3(long long, int);
    4141
    4242/* Arithmetic shift right. */
    43 long long __ashrdi3 (long long val, int shift);
     43extern long long __ashrdi3(long long, int);
    4444
    4545/* Logical shift right. */
    46 long long __lshrdi3 (long long val, int shift);
     46extern long long __lshrdi3(long long, int);
    4747
    4848#endif
Note: See TracChangeset for help on using the changeset viewer.