Changeset aa59fa0 in mainline
- Timestamp:
- 2006-03-16T00:32:41Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 585819d
- Parents:
- 69cdeec
- Files:
-
- 6 added
- 1 deleted
- 16 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
libc/include/endian.h
r69cdeec raa59fa0 27 27 */ 28 28 29 #ifndef __ ia32_ARCH_H__30 #define __ ia32_ARCH_H__29 #ifndef __LIBC__ENDIANS_H__ 30 #define __LIBC__ENDIANS_H__ 31 31 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 33 38 34 39 #endif -
libc/include/stdint.h
r69cdeec raa59fa0 27 27 */ 28 28 29 #ifndef __ ia32_TYPES_H__30 #define __ ia32_TYPES_H__29 #ifndef __LIBC__STDINT_H__ 30 #define __LIBC__STDINT_H__ 31 31 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> 36 34 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) 41 44 42 45 #define MAX_INT32 (0x7FFFFFFF) 43 46 #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) 47 49 48 50 #define MAX_INT64 (0x7FFFFFFFFFFFFFFFll) 49 51 #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) 55 54 56 55 #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 32 LIBC_PREFIX = ../libc 33 ## Setup toolchain 34 # 35 36 include $(LIBC_PREFIX)/Makefile.toolchain 37 38 CFLAGS +=-Iinclude -Iarch/$(ARCH)/include/ 39 40 ## Sources 41 # 42 43 GENERIC_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 54 ARCH_SOURCES = 55 56 GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) 57 58 .PHONY: all clean depend 59 60 all: libsoftfloat.a 61 62 -include Makefile.depend 2 63 3 64 clean: 65 -rm -f libsoftfloat.a Makefile.depend 66 find generic/ -name '*.o' -follow -exec rm \{\} \; 67 68 depend: 69 $(CC) $(DEFS) $(CFLAGS) -M $(GENERIC_SOURCES) > Makefile.depend 70 71 libsoftfloat.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 27 27 */ 28 28 29 #ifndef __ ia32_FUNCTIONS_H__30 #define __ ia32_FUNCTIONS_H__29 #ifndef __SOFTFLOAT_FUNCTIONS_H__ 30 #define __SOFTFLOAT_FUNCTIONS_H__ 31 31 32 32 #define float32_to_int(X) float32_to_int32(X); … … 62 62 #define ulonglong_to_float64(X) uint64_to_float64(X); 63 63 64 #endif 64 65 65 66 #endif -
softfloat/generic/add.c
r69cdeec raa59fa0 36 36 { 37 37 int expdiff; 38 __u32exp1, exp2,frac1, frac2;38 uint32_t exp1, exp2,frac1, frac2; 39 39 40 40 expdiff = a.parts.exp - b.parts.exp; … … 144 144 { 145 145 int expdiff; 146 __u32exp1, exp2;147 __u64frac1, frac2;146 uint32_t exp1, exp2; 147 uint64_t frac1, frac2; 148 148 149 149 expdiff = ((int )a.parts.exp) - b.parts.exp; -
softfloat/generic/common.c
r69cdeec raa59fa0 57 57 * @return valied float64 58 58 */ 59 float64 finishFloat64( __s32 cexp, __u64cfrac, char sign)59 float64 finishFloat64(int32_t cexp, uint64_t cfrac, char sign) 60 60 { 61 61 float64 result; … … 109 109 } 110 110 111 result.parts.exp = ( __u32)cexp;111 result.parts.exp = (uint32_t)cexp; 112 112 113 113 result.parts.fraction = ((cfrac >>(64 - FLOAT64_FRACTION_SIZE - 2 ) ) & (~FLOAT64_HIDDEN_BIT_MASK)); … … 119 119 * @param i 120 120 */ 121 int countZeroes64( __u64i)121 int countZeroes64(uint64_t i) 122 122 { 123 123 int j; … … 134 134 * @param i 135 135 */ 136 int countZeroes32( __u32i)136 int countZeroes32(uint32_t i) 137 137 { 138 138 int j; … … 149 149 * @param i 150 150 */ 151 int countZeroes8( __u8i)151 int countZeroes8(uint8_t i) 152 152 { 153 153 return zeroTable[i]; … … 158 158 * @param fraction part with hidden bit shifted to 30. bit 159 159 */ 160 void roundFloat32( __s32 *exp, __u32*fraction)160 void roundFloat32(int32_t *exp, uint32_t *fraction) 161 161 { 162 162 /* rounding - if first bit after fraction is set then round up */ … … 183 183 * @param fraction part with hidden bit shifted to 62. bit 184 184 */ 185 void roundFloat64( __s32 *exp, __u64*fraction)185 void roundFloat64(int32_t *exp, uint64_t *fraction) 186 186 { 187 187 /* rounding - if first bit after fraction is set then round up */ -
softfloat/generic/conversion.c
r69cdeec raa59fa0 35 35 { 36 36 float64 result; 37 __u64frac;37 uint64_t frac; 38 38 39 39 result.parts.sign = a.parts.sign; … … 74 74 { 75 75 float32 result; 76 __s32exp;77 __u64frac;76 int32_t exp; 77 uint64_t frac; 78 78 79 79 result.parts.sign = a.parts.sign; … … 84 84 85 85 if (isFloat64SigNaN(a)) { 86 result.parts.fraction = 0x 800000; /* set first bit of fraction nonzero */86 result.parts.fraction = 0x400000; /* set first bit of fraction nonzero */ 87 87 return result; 88 88 } … … 145 145 * @return unsigned integer 146 146 */ 147 static __u32_float32_to_uint32_helper(float32 a)148 { 149 __u32frac;147 static uint32_t _float32_to_uint32_helper(float32 a) 148 { 149 uint32_t frac; 150 150 151 151 if (a.parts.exp < FLOAT32_BIAS) { … … 173 173 * - now its the biggest or the smallest int 174 174 */ 175 __u32float32_to_uint32(float32 a)175 uint32_t float32_to_uint32(float32 a) 176 176 { 177 177 if (isFloat32NaN(a)) { … … 193 193 * - now its the biggest or the smallest int 194 194 */ 195 __s32float32_to_int32(float32 a)195 int32_t float32_to_int32(float32 a) 196 196 { 197 197 if (isFloat32NaN(a)) { … … 213 213 * @return unsigned integer 214 214 */ 215 static __u64_float64_to_uint64_helper(float64 a)216 { 217 __u64frac;215 static uint64_t _float64_to_uint64_helper(float64 a) 216 { 217 uint64_t frac; 218 218 219 219 if (a.parts.exp < FLOAT64_BIAS) { … … 241 241 * - now its the biggest or the smallest int 242 242 */ 243 __u64float64_to_uint64(float64 a)243 uint64_t float64_to_uint64(float64 a) 244 244 { 245 245 if (isFloat64NaN(a)) { … … 261 261 * - now its the biggest or the smallest int 262 262 */ 263 __s64float64_to_int64(float64 a)263 int64_t float64_to_int64(float64 a) 264 264 { 265 265 if (isFloat64NaN(a)) { … … 284 284 * @return unsigned integer 285 285 */ 286 static __u64_float32_to_uint64_helper(float32 a)287 { 288 __u64frac;286 static uint64_t _float32_to_uint64_helper(float32 a) 287 { 288 uint64_t frac; 289 289 290 290 if (a.parts.exp < FLOAT32_BIAS) { … … 312 312 * - now its the biggest or the smallest int 313 313 */ 314 __u64float32_to_uint64(float32 a)314 uint64_t float32_to_uint64(float32 a) 315 315 { 316 316 if (isFloat32NaN(a)) { … … 332 332 * - now its the biggest or the smallest int 333 333 */ 334 __s64float32_to_int64(float32 a)334 int64_t float32_to_int64(float32 a) 335 335 { 336 336 if (isFloat32NaN(a)) { … … 352 352 * - now its the biggest or the smallest int 353 353 */ 354 __u32float64_to_uint32(float64 a)354 uint32_t float64_to_uint32(float64 a) 355 355 { 356 356 if (isFloat64NaN(a)) { … … 365 365 } 366 366 367 return ( __u32)_float64_to_uint64_helper(a);367 return (uint32_t)_float64_to_uint64_helper(a); 368 368 } 369 369 … … 372 372 * - now its the biggest or the smallest int 373 373 */ 374 __s32float64_to_int32(float64 a)374 int32_t float64_to_int32(float64 a) 375 375 { 376 376 if (isFloat64NaN(a)) { … … 384 384 return MAX_INT32; 385 385 } 386 return ( __s32)_float64_to_uint64_helper(a);386 return (int32_t)_float64_to_uint64_helper(a); 387 387 } 388 388 … … 391 391 * 392 392 */ 393 float32 uint32_to_float32( __u32i)393 float32 uint32_to_float32(uint32_t i) 394 394 { 395 395 int counter; 396 __s32exp;396 int32_t exp; 397 397 float32 result; 398 398 … … 423 423 } 424 424 425 float32 int32_to_float32( __s32i)425 float32 int32_to_float32(int32_t i) 426 426 { 427 427 float32 result; 428 428 429 429 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); 433 433 } 434 434 … … 439 439 440 440 441 float32 uint64_to_float32( __u64i)441 float32 uint64_to_float32(uint64_t i) 442 442 { 443 443 int counter; 444 __s32 exp; 444 int32_t exp; 445 int32_t j; 445 446 float32 result; 446 447 … … 463 464 i >>= 1 + 32 - counter; 464 465 } 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; 469 471 result.parts.exp = exp; 470 472 return result; 471 473 } 472 474 473 float32 int64_to_float32( __s64i)475 float32 int64_to_float32(int64_t i) 474 476 { 475 477 float32 result; 476 478 477 479 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); 481 483 } 482 484 … … 490 492 * 491 493 */ 492 float64 uint32_to_float64( __u32i)494 float64 uint32_to_float64(uint32_t i) 493 495 { 494 496 int counter; 495 __s32exp;497 int32_t exp; 496 498 float64 result; 497 __u64frac;499 uint64_t frac; 498 500 499 501 result.parts.sign = 0; … … 520 522 } 521 523 522 float64 int32_to_float64( __s32i)524 float64 int32_to_float64(int32_t i) 523 525 { 524 526 float64 result; 525 527 526 528 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); 530 532 } 531 533 … … 536 538 537 539 538 float64 uint64_to_float64( __u64i)540 float64 uint64_to_float64(uint64_t i) 539 541 { 540 542 int counter; 541 __s32exp;543 int32_t exp; 542 544 float64 result; 543 545 … … 567 569 } 568 570 569 float64 int64_to_float64( __s64i)571 float64 int64_to_float64(int64_t i) 570 572 { 571 573 float64 result; 572 574 573 575 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); 577 579 } 578 580 -
softfloat/generic/div.c
r69cdeec raa59fa0 38 38 { 39 39 float32 result; 40 __s32aexp, bexp, cexp;41 __u64afrac, bfrac, cfrac;40 int32_t aexp, bexp, cexp; 41 uint64_t afrac, bfrac, cfrac; 42 42 43 43 result.parts.sign = a.parts.sign ^ b.parts.sign; … … 181 181 182 182 } else { 183 result.parts.exp = ( __u32)cexp;183 result.parts.exp = (uint32_t)cexp; 184 184 } 185 185 … … 192 192 { 193 193 float64 result; 194 __s64aexp, bexp, cexp;195 __u64afrac, bfrac, cfrac;196 __u64remlo, remhi;194 int64_t aexp, bexp, cexp; 195 uint64_t afrac, bfrac, cfrac; 196 uint64_t remlo, remhi; 197 197 198 198 result.parts.sign = a.parts.sign ^ b.parts.sign; … … 307 307 remlo = - remlo; 308 308 309 while (( __s64) remhi < 0) {309 while ((int64_t) remhi < 0) { 310 310 cfrac--; 311 311 remlo += bfrac; … … 321 321 } 322 322 323 __u64 divFloat64estim(__u64 a, __u64b)323 uint64_t divFloat64estim(uint64_t a, uint64_t b) 324 324 { 325 __u64bhi;326 __u64remhi, remlo;327 __u64result;325 uint64_t bhi; 326 uint64_t remhi, remlo; 327 uint64_t result; 328 328 329 329 if ( b <= a ) { … … 339 339 340 340 b <<= 32; 341 while ( ( __s64) remhi < 0 ) {341 while ( (int64_t) remhi < 0 ) { 342 342 result -= 0x1ll << 32; 343 343 remlo += b; -
softfloat/generic/mul.c
r69cdeec raa59fa0 38 38 { 39 39 float32 result; 40 __u64frac1, frac2;41 __s32exp;40 uint64_t frac1, frac2; 41 int32_t exp; 42 42 43 43 result.parts.sign = a.parts.sign ^ b.parts.sign; … … 174 174 { 175 175 float64 result; 176 __u64frac1, frac2;177 __s32exp;176 uint64_t frac1, frac2; 177 int32_t exp; 178 178 179 179 result.parts.sign = a.parts.sign ^ b.parts.sign; … … 258 258 * @param hi higher part of result 259 259 */ 260 void mul64integers( __u64 a,__u64 b, __u64 *lo, __u64*hi)260 void mul64integers(uint64_t a,uint64_t b, uint64_t *lo, uint64_t *hi) 261 261 { 262 __u64low, high, middle1, middle2;263 __u32alow, blow;262 uint64_t low, high, middle1, middle2; 263 uint32_t alow, blow; 264 264 265 265 alow = a & 0xFFFFFFFF; … … 269 269 b >>= 32; 270 270 271 low = (( __u64)alow) * blow;271 low = ((uint64_t)alow) * blow; 272 272 middle1 = a * blow; 273 273 middle2 = alow * b; … … 275 275 276 276 middle1 += middle2; 277 high += ((( __u64)(middle1 < middle2)) << 32) + (middle1 >> 32);277 high += (((uint64_t)(middle1 < middle2)) << 32) + (middle1 >> 32); 278 278 middle1 <<= 32; 279 279 low += middle1; -
softfloat/generic/softfloat.c
r69cdeec raa59fa0 39 39 #include<other.h> 40 40 41 #include<arch.h>42 #include<types.h>43 41 #include<functions.h> 44 42 … … 485 483 } 486 484 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 36 36 { 37 37 int expdiff; 38 __u32exp1, exp2, frac1, frac2;38 uint32_t exp1, exp2, frac1, frac2; 39 39 float32 result; 40 40 … … 147 147 { 148 148 int expdiff; 149 __u32exp1, exp2;150 __u64frac1, frac2;149 uint32_t exp1, exp2; 150 uint64_t frac1, frac2; 151 151 float64 result; 152 152 -
softfloat/include/common.h
r69cdeec raa59fa0 32 32 #include<sftypes.h> 33 33 34 float64 finishFloat64( __s32 cexp, __u64cfrac, char sign);34 float64 finishFloat64(int32_t cexp, uint64_t cfrac, char sign); 35 35 36 int countZeroes64( __u64i);37 int countZeroes32( __u32i);38 int countZeroes8( __u8i);36 int countZeroes64(uint64_t i); 37 int countZeroes32(uint32_t i); 38 int countZeroes8(uint8_t i); 39 39 40 void roundFloat32( __s32 *exp, __u32*fraction);41 void roundFloat64( __s32 *exp, __u64*fraction);40 void roundFloat32(int32_t *exp, uint32_t *fraction); 41 void roundFloat64(int32_t *exp, uint64_t *fraction); 42 42 43 43 #endif -
softfloat/include/conversion.h
r69cdeec raa59fa0 34 34 float32 convertFloat64ToFloat32(float64 a); 35 35 36 __u32float32_to_uint32(float32 a);37 __s32float32_to_int32(float32 a);36 uint32_t float32_to_uint32(float32 a); 37 int32_t float32_to_int32(float32 a); 38 38 39 __u64float32_to_uint64(float32 a);40 __s64float32_to_int64(float32 a);39 uint64_t float32_to_uint64(float32 a); 40 int64_t float32_to_int64(float32 a); 41 41 42 __u64float64_to_uint64(float64 a);43 __s64float64_to_int64(float64 a);42 uint64_t float64_to_uint64(float64 a); 43 int64_t float64_to_int64(float64 a); 44 44 45 __u32float64_to_uint32(float64 a);46 __s32float64_to_int32(float64 a);45 uint32_t float64_to_uint32(float64 a); 46 int32_t float64_to_int32(float64 a); 47 47 48 float32 uint32_to_float32( __u32i);49 float32 int32_to_float32( __s32i);48 float32 uint32_to_float32(uint32_t i); 49 float32 int32_to_float32(int32_t i); 50 50 51 float32 uint64_to_float32( __u64i);52 float32 int64_to_float32( __s64i);51 float32 uint64_to_float32(uint64_t i); 52 float32 int64_to_float32(int64_t i); 53 53 54 float64 uint32_to_float64( __u32i);55 float64 int32_to_float64( __s32i);54 float64 uint32_to_float64(uint32_t i); 55 float64 int32_to_float64(int32_t i); 56 56 57 float64 uint64_to_float64( __u64i);58 float64 int64_to_float64( __s64i);57 float64 uint64_to_float64(uint64_t i); 58 float64 int64_to_float64(int64_t i); 59 59 60 60 #endif -
softfloat/include/div.h
r69cdeec raa59fa0 33 33 float64 divFloat64(float64 a, float64 b); 34 34 35 __u64 divFloat64estim(__u64 a, __u64b);35 uint64_t divFloat64estim(uint64_t a, uint64_t b); 36 36 37 37 #endif -
softfloat/include/mul.h
r69cdeec raa59fa0 34 34 float64 mulFloat64(float64 a, float64 b); 35 35 36 void mul64integers( __u64 a,__u64 b, __u64 *lo, __u64*hi);36 void mul64integers(uint64_t a,uint64_t b, uint64_t *lo, uint64_t *hi); 37 37 38 38 #endif -
softfloat/include/sftypes.h
r69cdeec raa59fa0 30 30 #define __SFTYPES_H__ 31 31 32 #include < types.h>33 #include < arch.h>32 #include <endian.h> 33 #include <stdint.h> 34 34 35 35 typedef union { 36 36 float f; 37 __u32binary;37 uint32_t binary; 38 38 39 39 struct { 40 #if def __BIG_ENDIAN__41 __u32sign:1;42 __u32exp:8;43 __u32fraction:23;44 #elif defined __LITTLE_ENDIAN__45 __u32fraction:23;46 __u32exp:8;47 __u32sign: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; 48 48 #else 49 #error "Unknown endians."49 #error "Unknown endians." 50 50 #endif 51 51 } parts __attribute__ ((packed)); … … 54 54 typedef union { 55 55 double d; 56 __u64binary;56 uint64_t binary; 57 57 58 58 struct { 59 #if def __BIG_ENDIAN__60 __u64sign:1;61 __u64exp:11;62 __u64fraction:52;63 #elif defined __LITTLE_ENDIAN__64 __u64fraction:52;65 __u64exp:11;66 __u64sign: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; 67 67 #else 68 #error "Unknown endians."68 #error "Unknown endians." 69 69 #endif 70 70 } parts __attribute__ ((packed)); -
softfloat/include/softfloat.h
r69cdeec raa59fa0 158 158 int __gttf2(long double a, long double b); 159 159 160 160 /* Not implemented yet*/ 161 float __powisf2(float a, int b); 162 161 163 #endif 162 164 -
softint/Makefile
r69cdeec raa59fa0 41 41 # 42 42 43 ARCH_SOURCES = 44 43 45 GENERIC_SOURCES = \ 44 46 generic/division.c
Note:
See TracChangeset
for help on using the changeset viewer.