Changeset aa59fa0 in mainline


Ignore:
Timestamp:
2006-03-16T00:32:41Z (19 years ago)
Author:
Josef Cejka <malyzelenyhnus@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
585819d
Parents:
69cdeec
Message:

SoftFloat integrated into HelenOS uspace.

Files:
6 added
1 deleted
16 edited
2 moved

Legend:

Unmodified
Added
Removed
  • libc/include/endian.h

    r69cdeec raa59fa0  
    2727 */
    2828
    29 #ifndef __ia32_ARCH_H__
    30 #define __ia32_ARCH_H__
     29#ifndef __LIBC__ENDIANS_H__
     30#define __LIBC__ENDIANS_H__
    3131
    32 #define __LITTLE_ENDIAN__
     32#define __LITTLE_ENDIAN 1234
     33#define __BIG_ENDIAN    4321
     34#define __PDP_ENDIAN    3412
     35
     36/* TODO: move it to arch dependent directory */
     37#define __BYTE_ORDER __LITTLE_ENDIAN
    3338
    3439#endif
  • libc/include/stdint.h

    r69cdeec raa59fa0  
    2727 */
    2828
    29 #ifndef __ia32_TYPES_H__
    30 #define __ia32_TYPES_H__
     29#ifndef __LIBC__STDINT_H__
     30#define __LIBC__STDINT_H__
    3131
    32 typedef char __s8;
    33 typedef short __s16;
    34 typedef long __s32;
    35 typedef long long __s64;
     32/* Definitions of types with fixed size*/
     33#include<types.h>
    3634
    37 typedef unsigned char __u8;
    38 typedef unsigned short __u16;
    39 typedef unsigned long __u32;
    40 typedef unsigned long long __u64;
     35#define MAX_INT8 (0x7F)
     36#define MIN_INT8 (0x80)
     37#define MAX_UINT8 (0xFFu)
     38#define MIN_UINT8 (0u)
     39
     40#define MAX_INT16 (0x7FFF)
     41#define MIN_INT16 (0x8000)
     42#define MAX_UINT16 (0xFFFFu)
     43#define MIN_UINT16 (0u)
    4144
    4245#define MAX_INT32 (0x7FFFFFFF)
    4346#define MIN_INT32 (0x80000000)
    44 
    45 #define MAX_UINT32 (0xFFFFFFFF)
    46 #define MIN_UINT32 (0)
     47#define MAX_UINT32 (0xFFFFFFFFu)
     48#define MIN_UINT32 (0u)
    4749
    4850#define MAX_INT64 (0x7FFFFFFFFFFFFFFFll)
    4951#define MIN_INT64 (0x8000000000000000ll)
    50 
    51 #define MAX_UINT64 (0xFFFFFFFFFFFFFFFFll)
    52 #define MIN_UINT64 (0ll)
    53 
    54 
     52#define MAX_UINT64 (0xFFFFFFFFFFFFFFFFull)
     53#define MIN_UINT64 (0ull)
    5554
    5655#endif
  • softfloat/Makefile

    r69cdeec raa59fa0  
    1 all:
     1#
     2# Copyright (C) 2005 Martin Decky
     3# All rights reserved.
     4#
     5# Redistribution and use in source and binary forms, with or without
     6# modification, are permitted provided that the following conditions
     7# are met:
     8#
     9# - Redistributions of source code must retain the above copyright
     10#   notice, this list of conditions and the following disclaimer.
     11# - Redistributions in binary form must reproduce the above copyright
     12#   notice, this list of conditions and the following disclaimer in the
     13#   documentation and/or other materials provided with the distribution.
     14# - The name of the author may not be used to endorse or promote products
     15#   derived from this software without specific prior written permission.
     16#
     17# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     18# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     19# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     20# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     21# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     22# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     26# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     27#
     28
     29## Common compiler flags
     30#
     31
     32LIBC_PREFIX = ../libc
     33## Setup toolchain
     34#
     35
     36include $(LIBC_PREFIX)/Makefile.toolchain
     37
     38CFLAGS +=-Iinclude -Iarch/$(ARCH)/include/
     39
     40## Sources
     41#
     42
     43GENERIC_SOURCES =               \
     44        generic/add.c           \
     45        generic/common.c        \
     46        generic/comparison.c    \
     47        generic/conversion.c    \
     48        generic/div.c           \
     49        generic/mul.c           \
     50        generic/other.c         \
     51        generic/softfloat.c     \
     52        generic/sub.c
     53
     54ARCH_SOURCES =
     55
     56GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
     57
     58.PHONY: all clean depend
     59
     60all: libsoftfloat.a
     61
     62-include Makefile.depend
    263
    364clean:
     65        -rm -f libsoftfloat.a Makefile.depend
     66        find generic/ -name '*.o' -follow -exec rm \{\} \;
     67
     68depend:
     69        $(CC) $(DEFS) $(CFLAGS) -M $(GENERIC_SOURCES) > Makefile.depend
     70
     71libsoftfloat.a: depend $(ARCH_OBJECTS) $(GENERIC_OBJECTS)
     72        $(AR) rc libsoftfloat.a $(ARCH_OBJECTS) $(GENERIC_OBJECTS)
     73
     74%.o: %.S
     75        $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
     76
     77%.o: %.s
     78        $(AS) $(AFLAGS) $< -o $@
     79
     80%.o: %.c
     81        $(CC) $(DEFS) $(CFLAGS) -c $< -o $@
  • softfloat/arch/ia32/include/functions.h

    r69cdeec raa59fa0  
    2727 */
    2828
    29 #ifndef __ia32_FUNCTIONS_H__
    30 #define __ia32_FUNCTIONS_H__
     29#ifndef __SOFTFLOAT_FUNCTIONS_H__
     30#define __SOFTFLOAT_FUNCTIONS_H__
    3131
    3232#define float32_to_int(X) float32_to_int32(X);
     
    6262#define ulonglong_to_float64(X) uint64_to_float64(X);
    6363
     64#endif
    6465
    65 
    66 #endif
  • softfloat/generic/add.c

    r69cdeec raa59fa0  
    3636{
    3737        int expdiff;
    38         __u32 exp1, exp2,frac1, frac2;
     38        uint32_t exp1, exp2,frac1, frac2;
    3939       
    4040        expdiff = a.parts.exp - b.parts.exp;
     
    144144{
    145145        int expdiff;
    146         __u32 exp1, exp2;
    147         __u64 frac1, frac2;
     146        uint32_t exp1, exp2;
     147        uint64_t frac1, frac2;
    148148       
    149149        expdiff = ((int )a.parts.exp) - b.parts.exp;
  • softfloat/generic/common.c

    r69cdeec raa59fa0  
    5757 * @return valied float64
    5858 */
    59 float64 finishFloat64(__s32 cexp, __u64 cfrac, char sign)
     59float64 finishFloat64(int32_t cexp, uint64_t cfrac, char sign)
    6060{
    6161        float64 result;
     
    109109        }
    110110
    111         result.parts.exp = (__u32)cexp;
     111        result.parts.exp = (uint32_t)cexp;
    112112       
    113113        result.parts.fraction = ((cfrac >>(64 - FLOAT64_FRACTION_SIZE - 2 ) ) & (~FLOAT64_HIDDEN_BIT_MASK));
     
    119119 * @param i
    120120 */
    121 int countZeroes64(__u64 i)
     121int countZeroes64(uint64_t i)
    122122{
    123123        int j;
     
    134134 * @param i
    135135 */
    136 int countZeroes32(__u32 i)
     136int countZeroes32(uint32_t i)
    137137{
    138138        int j;
     
    149149 * @param i
    150150 */
    151 int countZeroes8(__u8 i)
     151int countZeroes8(uint8_t i)
    152152{
    153153        return zeroTable[i];
     
    158158 * @param fraction part with hidden bit shifted to 30. bit
    159159 */
    160 void roundFloat32(__s32 *exp, __u32 *fraction)
     160void roundFloat32(int32_t *exp, uint32_t *fraction)
    161161{
    162162        /* rounding - if first bit after fraction is set then round up */
     
    183183 * @param fraction part with hidden bit shifted to 62. bit
    184184 */
    185 void roundFloat64(__s32 *exp, __u64 *fraction)
     185void roundFloat64(int32_t *exp, uint64_t *fraction)
    186186{
    187187        /* rounding - if first bit after fraction is set then round up */
  • softfloat/generic/conversion.c

    r69cdeec raa59fa0  
    3535{
    3636        float64 result;
    37         __u64 frac;
     37        uint64_t frac;
    3838       
    3939        result.parts.sign = a.parts.sign;
     
    7474{
    7575        float32 result;
    76         __s32 exp;
    77         __u64 frac;
     76        int32_t exp;
     77        uint64_t frac;
    7878       
    7979        result.parts.sign = a.parts.sign;
     
    8484               
    8585                if (isFloat64SigNaN(a)) {
    86                         result.parts.fraction = 0x800000; /* set first bit of fraction nonzero */
     86                        result.parts.fraction = 0x400000; /* set first bit of fraction nonzero */
    8787                        return result;
    8888                }
     
    145145 * @return unsigned integer
    146146 */
    147 static __u32 _float32_to_uint32_helper(float32 a)
    148 {
    149         __u32 frac;
     147static uint32_t _float32_to_uint32_helper(float32 a)
     148{
     149        uint32_t frac;
    150150       
    151151        if (a.parts.exp < FLOAT32_BIAS) {
     
    173173 *      - now its the biggest or the smallest int
    174174 */
    175 __u32 float32_to_uint32(float32 a)
     175uint32_t float32_to_uint32(float32 a)
    176176{
    177177        if (isFloat32NaN(a)) {
     
    193193 *      - now its the biggest or the smallest int
    194194 */
    195 __s32 float32_to_int32(float32 a)
     195int32_t float32_to_int32(float32 a)
    196196{
    197197        if (isFloat32NaN(a)) {
     
    213213 * @return unsigned integer
    214214 */
    215 static __u64 _float64_to_uint64_helper(float64 a)
    216 {
    217         __u64 frac;
     215static uint64_t _float64_to_uint64_helper(float64 a)
     216{
     217        uint64_t frac;
    218218       
    219219        if (a.parts.exp < FLOAT64_BIAS) {
     
    241241 *      - now its the biggest or the smallest int
    242242 */
    243 __u64 float64_to_uint64(float64 a)
     243uint64_t float64_to_uint64(float64 a)
    244244{
    245245        if (isFloat64NaN(a)) {
     
    261261 *      - now its the biggest or the smallest int
    262262 */
    263 __s64 float64_to_int64(float64 a)
     263int64_t float64_to_int64(float64 a)
    264264{
    265265        if (isFloat64NaN(a)) {
     
    284284 * @return unsigned integer
    285285 */
    286 static __u64 _float32_to_uint64_helper(float32 a)
    287 {
    288         __u64 frac;
     286static uint64_t _float32_to_uint64_helper(float32 a)
     287{
     288        uint64_t frac;
    289289       
    290290        if (a.parts.exp < FLOAT32_BIAS) {
     
    312312 *      - now its the biggest or the smallest int
    313313 */
    314 __u64 float32_to_uint64(float32 a)
     314uint64_t float32_to_uint64(float32 a)
    315315{
    316316        if (isFloat32NaN(a)) {
     
    332332 *      - now its the biggest or the smallest int
    333333 */
    334 __s64 float32_to_int64(float32 a)
     334int64_t float32_to_int64(float32 a)
    335335{
    336336        if (isFloat32NaN(a)) {
     
    352352 *      - now its the biggest or the smallest int
    353353 */
    354 __u32 float64_to_uint32(float64 a)
     354uint32_t float64_to_uint32(float64 a)
    355355{
    356356        if (isFloat64NaN(a)) {
     
    365365        }
    366366       
    367         return (__u32)_float64_to_uint64_helper(a);     
     367        return (uint32_t)_float64_to_uint64_helper(a); 
    368368}
    369369
     
    372372 *      - now its the biggest or the smallest int
    373373 */
    374 __s32 float64_to_int32(float64 a)
     374int32_t float64_to_int32(float64 a)
    375375{
    376376        if (isFloat64NaN(a)) {
     
    384384                return MAX_INT32;
    385385        }
    386         return (__s32)_float64_to_uint64_helper(a);
     386        return (int32_t)_float64_to_uint64_helper(a);
    387387}       
    388388
     
    391391 *
    392392 */
    393 float32 uint32_to_float32(__u32 i)
     393float32 uint32_to_float32(uint32_t i)
    394394{
    395395        int counter;
    396         __s32 exp;
     396        int32_t exp;
    397397        float32 result;
    398398       
     
    423423}
    424424
    425 float32 int32_to_float32(__s32 i)
     425float32 int32_to_float32(int32_t i)
    426426{
    427427        float32 result;
    428428
    429429        if (i < 0) {
    430                 result = uint32_to_float32((__u32)(-i));
    431         } else {
    432                 result = uint32_to_float32((__u32)i);
     430                result = uint32_to_float32((uint32_t)(-i));
     431        } else {
     432                result = uint32_to_float32((uint32_t)i);
    433433        }
    434434       
     
    439439
    440440
    441 float32 uint64_to_float32(__u64 i)
     441float32 uint64_to_float32(uint64_t i)
    442442{
    443443        int counter;
    444         __s32 exp;
     444        int32_t exp;
     445        int32_t j;
    445446        float32 result;
    446447       
     
    463464                i >>= 1 + 32 - counter;
    464465        }
    465 
    466         roundFloat32(&exp, &i);
    467 
    468         result.parts.fraction = i >> 7;
     466       
     467        j = (uint32_t)i;
     468        roundFloat32(&exp, &j);
     469
     470        result.parts.fraction = j >> 7;
    469471        result.parts.exp = exp;
    470472        return result;
    471473}
    472474
    473 float32 int64_to_float32(__s64 i)
     475float32 int64_to_float32(int64_t i)
    474476{
    475477        float32 result;
    476478
    477479        if (i < 0) {
    478                 result = uint64_to_float32((__u64)(-i));
    479         } else {
    480                 result = uint64_to_float32((__u64)i);
     480                result = uint64_to_float32((uint64_t)(-i));
     481        } else {
     482                result = uint64_to_float32((uint64_t)i);
    481483        }
    482484       
     
    490492 *
    491493 */
    492 float64 uint32_to_float64(__u32 i)
     494float64 uint32_to_float64(uint32_t i)
    493495{
    494496        int counter;
    495         __s32 exp;
     497        int32_t exp;
    496498        float64 result;
    497         __u64 frac;
     499        uint64_t frac;
    498500       
    499501        result.parts.sign = 0;
     
    520522}
    521523
    522 float64 int32_to_float64(__s32 i)
     524float64 int32_to_float64(int32_t i)
    523525{
    524526        float64 result;
    525527
    526528        if (i < 0) {
    527                 result = uint32_to_float64((__u32)(-i));
    528         } else {
    529                 result = uint32_to_float64((__u32)i);
     529                result = uint32_to_float64((uint32_t)(-i));
     530        } else {
     531                result = uint32_to_float64((uint32_t)i);
    530532        }
    531533       
     
    536538
    537539
    538 float64 uint64_to_float64(__u64 i)
     540float64 uint64_to_float64(uint64_t i)
    539541{
    540542        int counter;
    541         __s32 exp;
     543        int32_t exp;
    542544        float64 result;
    543545       
     
    567569}
    568570
    569 float64 int64_to_float64(__s64 i)
     571float64 int64_to_float64(int64_t i)
    570572{
    571573        float64 result;
    572574
    573575        if (i < 0) {
    574                 result = uint64_to_float64((__u64)(-i));
    575         } else {
    576                 result = uint64_to_float64((__u64)i);
     576                result = uint64_to_float64((uint64_t)(-i));
     577        } else {
     578                result = uint64_to_float64((uint64_t)i);
    577579        }
    578580       
  • softfloat/generic/div.c

    r69cdeec raa59fa0  
    3838{
    3939        float32 result;
    40         __s32 aexp, bexp, cexp;
    41         __u64 afrac, bfrac, cfrac;
     40        int32_t aexp, bexp, cexp;
     41        uint64_t afrac, bfrac, cfrac;
    4242       
    4343        result.parts.sign = a.parts.sign ^ b.parts.sign;
     
    181181               
    182182        } else {
    183                 result.parts.exp = (__u32)cexp;
     183                result.parts.exp = (uint32_t)cexp;
    184184        }
    185185       
     
    192192{
    193193        float64 result;
    194         __s64 aexp, bexp, cexp;
    195         __u64 afrac, bfrac, cfrac;
    196         __u64 remlo, remhi;
     194        int64_t aexp, bexp, cexp;
     195        uint64_t afrac, bfrac, cfrac;
     196        uint64_t remlo, remhi;
    197197       
    198198        result.parts.sign = a.parts.sign ^ b.parts.sign;
     
    307307                remlo = - remlo;
    308308               
    309                 while ((__s64) remhi < 0) {
     309                while ((int64_t) remhi < 0) {
    310310                        cfrac--;
    311311                        remlo += bfrac;
     
    321321}
    322322
    323 __u64 divFloat64estim(__u64 a, __u64 b)
     323uint64_t divFloat64estim(uint64_t a, uint64_t b)
    324324{
    325         __u64 bhi;
    326         __u64 remhi, remlo;
    327         __u64 result;
     325        uint64_t bhi;
     326        uint64_t remhi, remlo;
     327        uint64_t result;
    328328       
    329329        if ( b <= a ) {
     
    339339
    340340        b <<= 32;
    341         while ( (__s64) remhi < 0 ) {
     341        while ( (int64_t) remhi < 0 ) {
    342342                        result -= 0x1ll << 32; 
    343343                        remlo += b;
  • softfloat/generic/mul.c

    r69cdeec raa59fa0  
    3838{
    3939        float32 result;
    40         __u64 frac1, frac2;
    41         __s32 exp;
     40        uint64_t frac1, frac2;
     41        int32_t exp;
    4242
    4343        result.parts.sign = a.parts.sign ^ b.parts.sign;
     
    174174{
    175175        float64 result;
    176         __u64 frac1, frac2;
    177         __s32 exp;
     176        uint64_t frac1, frac2;
     177        int32_t exp;
    178178
    179179        result.parts.sign = a.parts.sign ^ b.parts.sign;
     
    258258 * @param hi higher part of result
    259259 */
    260 void mul64integers(__u64 a,__u64 b, __u64 *lo, __u64 *hi)
     260void mul64integers(uint64_t a,uint64_t b, uint64_t *lo, uint64_t *hi)
    261261{
    262         __u64 low, high, middle1, middle2;
    263         __u32 alow, blow;
     262        uint64_t low, high, middle1, middle2;
     263        uint32_t alow, blow;
    264264
    265265        alow = a & 0xFFFFFFFF;
     
    269269        b >>= 32;
    270270       
    271         low = ((__u64)alow) * blow;
     271        low = ((uint64_t)alow) * blow;
    272272        middle1 = a * blow;
    273273        middle2 = alow * b;
     
    275275
    276276        middle1 += middle2;
    277         high += (((__u64)(middle1 < middle2)) << 32) + (middle1 >> 32);
     277        high += (((uint64_t)(middle1 < middle2)) << 32) + (middle1 >> 32);
    278278        middle1 <<= 32;
    279279        low += middle1;
  • softfloat/generic/softfloat.c

    r69cdeec raa59fa0  
    3939#include<other.h>
    4040
    41 #include<arch.h>
    42 #include<types.h>
    4341#include<functions.h>
    4442
     
    485483}
    486484
    487 float __mulsc3(float a, float b, float c, float d)
    488 {
    489 /* TODO: */
    490 }
    491 
    492 float __divsc3(float a, float b, float c, float d)
    493 {
    494 /* TODO: */
    495 }
    496 
  • softfloat/generic/sub.c

    r69cdeec raa59fa0  
    3636{
    3737        int expdiff;
    38         __u32 exp1, exp2, frac1, frac2;
     38        uint32_t exp1, exp2, frac1, frac2;
    3939        float32 result;
    4040
     
    147147{
    148148        int expdiff;
    149         __u32 exp1, exp2;
    150         __u64 frac1, frac2;
     149        uint32_t exp1, exp2;
     150        uint64_t frac1, frac2;
    151151        float64 result;
    152152
  • softfloat/include/common.h

    r69cdeec raa59fa0  
    3232#include<sftypes.h>
    3333
    34 float64 finishFloat64(__s32 cexp, __u64 cfrac, char sign);
     34float64 finishFloat64(int32_t cexp, uint64_t cfrac, char sign);
    3535
    36 int countZeroes64(__u64 i);
    37 int countZeroes32(__u32 i);
    38 int countZeroes8(__u8 i);
     36int countZeroes64(uint64_t i);
     37int countZeroes32(uint32_t i);
     38int countZeroes8(uint8_t i);
    3939
    40 void roundFloat32(__s32 *exp, __u32 *fraction);
    41 void roundFloat64(__s32 *exp, __u64 *fraction);
     40void roundFloat32(int32_t *exp, uint32_t *fraction);
     41void roundFloat64(int32_t *exp, uint64_t *fraction);
    4242
    4343#endif
  • softfloat/include/conversion.h

    r69cdeec raa59fa0  
    3434float32 convertFloat64ToFloat32(float64 a);
    3535
    36 __u32 float32_to_uint32(float32 a);
    37 __s32 float32_to_int32(float32 a);
     36uint32_t float32_to_uint32(float32 a);
     37int32_t float32_to_int32(float32 a);
    3838
    39 __u64 float32_to_uint64(float32 a);
    40 __s64 float32_to_int64(float32 a);
     39uint64_t float32_to_uint64(float32 a);
     40int64_t float32_to_int64(float32 a);
    4141
    42 __u64 float64_to_uint64(float64 a);
    43 __s64 float64_to_int64(float64 a);
     42uint64_t float64_to_uint64(float64 a);
     43int64_t float64_to_int64(float64 a);
    4444
    45 __u32 float64_to_uint32(float64 a);
    46 __s32 float64_to_int32(float64 a);
     45uint32_t float64_to_uint32(float64 a);
     46int32_t float64_to_int32(float64 a);
    4747
    48 float32 uint32_to_float32(__u32 i);
    49 float32 int32_to_float32(__s32 i);
     48float32 uint32_to_float32(uint32_t i);
     49float32 int32_to_float32(int32_t i);
    5050
    51 float32 uint64_to_float32(__u64 i);
    52 float32 int64_to_float32(__s64 i);
     51float32 uint64_to_float32(uint64_t i);
     52float32 int64_to_float32(int64_t i);
    5353
    54 float64 uint32_to_float64(__u32 i);
    55 float64 int32_to_float64(__s32 i);
     54float64 uint32_to_float64(uint32_t i);
     55float64 int32_to_float64(int32_t i);
    5656
    57 float64 uint64_to_float64(__u64 i);
    58 float64 int64_to_float64(__s64 i);
     57float64 uint64_to_float64(uint64_t i);
     58float64 int64_to_float64(int64_t i);
    5959
    6060#endif
  • softfloat/include/div.h

    r69cdeec raa59fa0  
    3333float64 divFloat64(float64 a, float64 b);
    3434
    35 __u64 divFloat64estim(__u64 a, __u64 b);
     35uint64_t divFloat64estim(uint64_t a, uint64_t b);
    3636
    3737#endif
  • softfloat/include/mul.h

    r69cdeec raa59fa0  
    3434float64 mulFloat64(float64 a, float64 b);
    3535
    36 void mul64integers(__u64 a,__u64 b, __u64 *lo, __u64 *hi);
     36void mul64integers(uint64_t a,uint64_t b, uint64_t *lo, uint64_t *hi);
    3737
    3838#endif
  • softfloat/include/sftypes.h

    r69cdeec raa59fa0  
    3030#define __SFTYPES_H__
    3131
    32 #include <types.h>
    33 #include <arch.h>
     32#include <endian.h>
     33#include <stdint.h>
    3434
    3535typedef union {
    3636        float f;
    37         __u32 binary;
     37        uint32_t binary;
    3838
    3939        struct  {
    40                 #ifdef __BIG_ENDIAN__
    41                 __u32 sign:1;
    42                 __u32 exp:8;
    43                 __u32 fraction:23;
    44                 #elif defined __LITTLE_ENDIAN__
    45                 __u32 fraction:23;
    46                 __u32 exp:8;
    47                 __u32 sign:1;
     40                #if __BYTE_ORDER == __BIG_ENDIAN
     41                uint32_t sign:1;
     42                uint32_t exp:8;
     43                uint32_t fraction:23;
     44                #elif __BYTE_ORDER == __LITTLE_ENDIAN
     45                uint32_t fraction:23;
     46                uint32_t exp:8;
     47                uint32_t sign:1;
    4848                #else
    49                 #error "Unknown endians."
     49                        #error "Unknown endians."
    5050                #endif
    5151                } parts __attribute__ ((packed));
     
    5454typedef union {
    5555        double d;
    56         __u64 binary;
     56        uint64_t binary;
    5757       
    5858        struct  {
    59                 #ifdef __BIG_ENDIAN__
    60                 __u64 sign:1;
    61                 __u64 exp:11;
    62                 __u64 fraction:52;
    63                 #elif defined __LITTLE_ENDIAN__
    64                 __u64 fraction:52;
    65                 __u64 exp:11;
    66                 __u64 sign:1;
     59                #if __BYTE_ORDER == __BIG_ENDIAN
     60                uint64_t sign:1;
     61                uint64_t exp:11;
     62                uint64_t fraction:52;
     63                #elif __BYTE_ORDER == __LITTLE_ENDIAN
     64                uint64_t fraction:52;
     65                uint64_t exp:11;
     66                uint64_t sign:1;
    6767                #else
    68                 #error "Unknown endians."
     68                        #error "Unknown endians."
    6969                #endif
    7070                } parts __attribute__ ((packed));
  • softfloat/include/softfloat.h

    r69cdeec raa59fa0  
    158158int __gttf2(long double a, long double b);
    159159 
    160  
     160/* Not implemented yet*/
     161float __powisf2(float a, int b);
     162
    161163#endif
    162164
  • softint/Makefile

    r69cdeec raa59fa0  
    4141#
    4242
     43ARCH_SOURCES =
     44
    4345GENERIC_SOURCES = \
    4446        generic/division.c
Note: See TracChangeset for help on using the changeset viewer.