/uspace/trunk/softfloat/include/mul.h |
---|
33,7 → 33,7 |
float64 mulFloat64(float64 a, float64 b); |
void mul64integers(__u64 a,__u64 b, __u64 *lo, __u64 *hi); |
void mul64integers(uint64_t a,uint64_t b, uint64_t *lo, uint64_t *hi); |
#endif |
/uspace/trunk/softfloat/include/sftypes.h |
---|
29,24 → 29,24 |
#ifndef __SFTYPES_H__ |
#define __SFTYPES_H__ |
#include <types.h> |
#include <arch.h> |
#include <endian.h> |
#include <stdint.h> |
typedef union { |
float f; |
__u32 binary; |
uint32_t binary; |
struct { |
#ifdef __BIG_ENDIAN__ |
__u32 sign:1; |
__u32 exp:8; |
__u32 fraction:23; |
#elif defined __LITTLE_ENDIAN__ |
__u32 fraction:23; |
__u32 exp:8; |
__u32 sign:1; |
#if __BYTE_ORDER == __BIG_ENDIAN |
uint32_t sign:1; |
uint32_t exp:8; |
uint32_t fraction:23; |
#elif __BYTE_ORDER == __LITTLE_ENDIAN |
uint32_t fraction:23; |
uint32_t exp:8; |
uint32_t sign:1; |
#else |
#error "Unknown endians." |
#error "Unknown endians." |
#endif |
} parts __attribute__ ((packed)); |
} float32; |
53,19 → 53,19 |
typedef union { |
double d; |
__u64 binary; |
uint64_t binary; |
struct { |
#ifdef __BIG_ENDIAN__ |
__u64 sign:1; |
__u64 exp:11; |
__u64 fraction:52; |
#elif defined __LITTLE_ENDIAN__ |
__u64 fraction:52; |
__u64 exp:11; |
__u64 sign:1; |
#if __BYTE_ORDER == __BIG_ENDIAN |
uint64_t sign:1; |
uint64_t exp:11; |
uint64_t fraction:52; |
#elif __BYTE_ORDER == __LITTLE_ENDIAN |
uint64_t fraction:52; |
uint64_t exp:11; |
uint64_t sign:1; |
#else |
#error "Unknown endians." |
#error "Unknown endians." |
#endif |
} parts __attribute__ ((packed)); |
} float64; |
/uspace/trunk/softfloat/include/softfloat.h |
---|
157,6 → 157,8 |
int __gtdf2(double a, double b); |
int __gttf2(long double a, long double b); |
/* Not implemented yet*/ |
float __powisf2(float a, int b); |
#endif |
/uspace/trunk/softfloat/include/div.h |
---|
32,7 → 32,7 |
float32 divFloat32(float32 a, float32 b); |
float64 divFloat64(float64 a, float64 b); |
__u64 divFloat64estim(__u64 a, __u64 b); |
uint64_t divFloat64estim(uint64_t a, uint64_t b); |
#endif |
/uspace/trunk/softfloat/include/conversion.h |
---|
33,29 → 33,29 |
float32 convertFloat64ToFloat32(float64 a); |
__u32 float32_to_uint32(float32 a); |
__s32 float32_to_int32(float32 a); |
uint32_t float32_to_uint32(float32 a); |
int32_t float32_to_int32(float32 a); |
__u64 float32_to_uint64(float32 a); |
__s64 float32_to_int64(float32 a); |
uint64_t float32_to_uint64(float32 a); |
int64_t float32_to_int64(float32 a); |
__u64 float64_to_uint64(float64 a); |
__s64 float64_to_int64(float64 a); |
uint64_t float64_to_uint64(float64 a); |
int64_t float64_to_int64(float64 a); |
__u32 float64_to_uint32(float64 a); |
__s32 float64_to_int32(float64 a); |
uint32_t float64_to_uint32(float64 a); |
int32_t float64_to_int32(float64 a); |
float32 uint32_to_float32(__u32 i); |
float32 int32_to_float32(__s32 i); |
float32 uint32_to_float32(uint32_t i); |
float32 int32_to_float32(int32_t i); |
float32 uint64_to_float32(__u64 i); |
float32 int64_to_float32(__s64 i); |
float32 uint64_to_float32(uint64_t i); |
float32 int64_to_float32(int64_t i); |
float64 uint32_to_float64(__u32 i); |
float64 int32_to_float64(__s32 i); |
float64 uint32_to_float64(uint32_t i); |
float64 int32_to_float64(int32_t i); |
float64 uint64_to_float64(__u64 i); |
float64 int64_to_float64(__s64 i); |
float64 uint64_to_float64(uint64_t i); |
float64 int64_to_float64(int64_t i); |
#endif |
/uspace/trunk/softfloat/include/common.h |
---|
31,13 → 31,13 |
#include<sftypes.h> |
float64 finishFloat64(__s32 cexp, __u64 cfrac, char sign); |
float64 finishFloat64(int32_t cexp, uint64_t cfrac, char sign); |
int countZeroes64(__u64 i); |
int countZeroes32(__u32 i); |
int countZeroes8(__u8 i); |
int countZeroes64(uint64_t i); |
int countZeroes32(uint32_t i); |
int countZeroes8(uint8_t i); |
void roundFloat32(__s32 *exp, __u32 *fraction); |
void roundFloat64(__s32 *exp, __u64 *fraction); |
void roundFloat32(int32_t *exp, uint32_t *fraction); |
void roundFloat64(int32_t *exp, uint64_t *fraction); |
#endif |
/uspace/trunk/softfloat/generic/softfloat.c |
---|
38,8 → 38,6 |
#include<comparison.h> |
#include<other.h> |
#include<arch.h> |
#include<types.h> |
#include<functions.h> |
/* Arithmetic functions */ |
484,13 → 482,3 |
/* TODO: */ |
} |
float __mulsc3(float a, float b, float c, float d) |
{ |
/* TODO: */ |
} |
float __divsc3(float a, float b, float c, float d) |
{ |
/* TODO: */ |
} |
/uspace/trunk/softfloat/generic/div.c |
---|
37,8 → 37,8 |
float32 divFloat32(float32 a, float32 b) |
{ |
float32 result; |
__s32 aexp, bexp, cexp; |
__u64 afrac, bfrac, cfrac; |
int32_t aexp, bexp, cexp; |
uint64_t afrac, bfrac, cfrac; |
result.parts.sign = a.parts.sign ^ b.parts.sign; |
180,7 → 180,7 |
} |
} else { |
result.parts.exp = (__u32)cexp; |
result.parts.exp = (uint32_t)cexp; |
} |
result.parts.fraction = ((cfrac >> 6) & (~FLOAT32_HIDDEN_BIT_MASK)); |
191,9 → 191,9 |
float64 divFloat64(float64 a, float64 b) |
{ |
float64 result; |
__s64 aexp, bexp, cexp; |
__u64 afrac, bfrac, cfrac; |
__u64 remlo, remhi; |
int64_t aexp, bexp, cexp; |
uint64_t afrac, bfrac, cfrac; |
uint64_t remlo, remhi; |
result.parts.sign = a.parts.sign ^ b.parts.sign; |
306,7 → 306,7 |
remhi = afrac - remhi - ( remlo > 0); |
remlo = - remlo; |
while ((__s64) remhi < 0) { |
while ((int64_t) remhi < 0) { |
cfrac--; |
remlo += bfrac; |
remhi += ( remlo < bfrac ); |
320,11 → 320,11 |
} |
__u64 divFloat64estim(__u64 a, __u64 b) |
uint64_t divFloat64estim(uint64_t a, uint64_t b) |
{ |
__u64 bhi; |
__u64 remhi, remlo; |
__u64 result; |
uint64_t bhi; |
uint64_t remhi, remlo; |
uint64_t result; |
if ( b <= a ) { |
return 0xFFFFFFFFFFFFFFFFull; |
338,7 → 338,7 |
remlo = - remlo; |
b <<= 32; |
while ( (__s64) remhi < 0 ) { |
while ( (int64_t) remhi < 0 ) { |
result -= 0x1ll << 32; |
remlo += b; |
remhi += bhi + ( remlo < b ); |
/uspace/trunk/softfloat/generic/conversion.c |
---|
34,7 → 34,7 |
float64 convertFloat32ToFloat64(float32 a) |
{ |
float64 result; |
__u64 frac; |
uint64_t frac; |
result.parts.sign = a.parts.sign; |
result.parts.fraction = a.parts.fraction; |
73,8 → 73,8 |
float32 convertFloat64ToFloat32(float64 a) |
{ |
float32 result; |
__s32 exp; |
__u64 frac; |
int32_t exp; |
uint64_t frac; |
result.parts.sign = a.parts.sign; |
83,7 → 83,7 |
result.parts.exp = 0xFF; |
if (isFloat64SigNaN(a)) { |
result.parts.fraction = 0x800000; /* set first bit of fraction nonzero */ |
result.parts.fraction = 0x400000; /* set first bit of fraction nonzero */ |
return result; |
} |
144,9 → 144,9 |
* @param a floating point number in normalized form (no NaNs or Inf are checked ) |
* @return unsigned integer |
*/ |
static __u32 _float32_to_uint32_helper(float32 a) |
static uint32_t _float32_to_uint32_helper(float32 a) |
{ |
__u32 frac; |
uint32_t frac; |
if (a.parts.exp < FLOAT32_BIAS) { |
/*TODO: rounding*/ |
172,7 → 172,7 |
* FIXME: Im not sure what to return if overflow/underflow happens |
* - now its the biggest or the smallest int |
*/ |
__u32 float32_to_uint32(float32 a) |
uint32_t float32_to_uint32(float32 a) |
{ |
if (isFloat32NaN(a)) { |
return MAX_UINT32; |
192,7 → 192,7 |
* FIXME: Im not sure what to return if overflow/underflow happens |
* - now its the biggest or the smallest int |
*/ |
__s32 float32_to_int32(float32 a) |
int32_t float32_to_int32(float32 a) |
{ |
if (isFloat32NaN(a)) { |
return MAX_INT32; |
212,9 → 212,9 |
* @param a floating point number in normalized form (no NaNs or Inf are checked ) |
* @return unsigned integer |
*/ |
static __u64 _float64_to_uint64_helper(float64 a) |
static uint64_t _float64_to_uint64_helper(float64 a) |
{ |
__u64 frac; |
uint64_t frac; |
if (a.parts.exp < FLOAT64_BIAS) { |
/*TODO: rounding*/ |
240,7 → 240,7 |
* FIXME: Im not sure what to return if overflow/underflow happens |
* - now its the biggest or the smallest int |
*/ |
__u64 float64_to_uint64(float64 a) |
uint64_t float64_to_uint64(float64 a) |
{ |
if (isFloat64NaN(a)) { |
return MAX_UINT64; |
260,7 → 260,7 |
* FIXME: Im not sure what to return if overflow/underflow happens |
* - now its the biggest or the smallest int |
*/ |
__s64 float64_to_int64(float64 a) |
int64_t float64_to_int64(float64 a) |
{ |
if (isFloat64NaN(a)) { |
return MAX_INT64; |
283,9 → 283,9 |
* @param a floating point number in normalized form (no NaNs or Inf are checked ) |
* @return unsigned integer |
*/ |
static __u64 _float32_to_uint64_helper(float32 a) |
static uint64_t _float32_to_uint64_helper(float32 a) |
{ |
__u64 frac; |
uint64_t frac; |
if (a.parts.exp < FLOAT32_BIAS) { |
/*TODO: rounding*/ |
311,7 → 311,7 |
* FIXME: Im not sure what to return if overflow/underflow happens |
* - now its the biggest or the smallest int |
*/ |
__u64 float32_to_uint64(float32 a) |
uint64_t float32_to_uint64(float32 a) |
{ |
if (isFloat32NaN(a)) { |
return MAX_UINT64; |
331,7 → 331,7 |
* FIXME: Im not sure what to return if overflow/underflow happens |
* - now its the biggest or the smallest int |
*/ |
__s64 float32_to_int64(float32 a) |
int64_t float32_to_int64(float32 a) |
{ |
if (isFloat32NaN(a)) { |
return MAX_INT64; |
351,7 → 351,7 |
* FIXME: Im not sure what to return if overflow/underflow happens |
* - now its the biggest or the smallest int |
*/ |
__u32 float64_to_uint32(float64 a) |
uint32_t float64_to_uint32(float64 a) |
{ |
if (isFloat64NaN(a)) { |
return MAX_UINT32; |
364,7 → 364,7 |
return MAX_UINT32; |
} |
return (__u32)_float64_to_uint64_helper(a); |
return (uint32_t)_float64_to_uint64_helper(a); |
} |
/* Convert float64 to signed int32 |
371,7 → 371,7 |
* FIXME: Im not sure what to return if overflow/underflow happens |
* - now its the biggest or the smallest int |
*/ |
__s32 float64_to_int32(float64 a) |
int32_t float64_to_int32(float64 a) |
{ |
if (isFloat64NaN(a)) { |
return MAX_INT32; |
383,7 → 383,7 |
} |
return MAX_INT32; |
} |
return (__s32)_float64_to_uint64_helper(a); |
return (int32_t)_float64_to_uint64_helper(a); |
} |
/** Convert unsigned integer to float32 |
390,10 → 390,10 |
* |
* |
*/ |
float32 uint32_to_float32(__u32 i) |
float32 uint32_to_float32(uint32_t i) |
{ |
int counter; |
__s32 exp; |
int32_t exp; |
float32 result; |
result.parts.sign = 0; |
422,14 → 422,14 |
return result; |
} |
float32 int32_to_float32(__s32 i) |
float32 int32_to_float32(int32_t i) |
{ |
float32 result; |
if (i < 0) { |
result = uint32_to_float32((__u32)(-i)); |
result = uint32_to_float32((uint32_t)(-i)); |
} else { |
result = uint32_to_float32((__u32)i); |
result = uint32_to_float32((uint32_t)i); |
} |
result.parts.sign = i < 0; |
438,10 → 438,11 |
} |
float32 uint64_to_float32(__u64 i) |
float32 uint64_to_float32(uint64_t i) |
{ |
int counter; |
__s32 exp; |
int32_t exp; |
int32_t j; |
float32 result; |
result.parts.sign = 0; |
462,22 → 463,23 |
} else { |
i >>= 1 + 32 - counter; |
} |
j = (uint32_t)i; |
roundFloat32(&exp, &j); |
roundFloat32(&exp, &i); |
result.parts.fraction = i >> 7; |
result.parts.fraction = j >> 7; |
result.parts.exp = exp; |
return result; |
} |
float32 int64_to_float32(__s64 i) |
float32 int64_to_float32(int64_t i) |
{ |
float32 result; |
if (i < 0) { |
result = uint64_to_float32((__u64)(-i)); |
result = uint64_to_float32((uint64_t)(-i)); |
} else { |
result = uint64_to_float32((__u64)i); |
result = uint64_to_float32((uint64_t)i); |
} |
result.parts.sign = i < 0; |
489,12 → 491,12 |
* |
* |
*/ |
float64 uint32_to_float64(__u32 i) |
float64 uint32_to_float64(uint32_t i) |
{ |
int counter; |
__s32 exp; |
int32_t exp; |
float64 result; |
__u64 frac; |
uint64_t frac; |
result.parts.sign = 0; |
result.parts.fraction = 0; |
519,14 → 521,14 |
return result; |
} |
float64 int32_to_float64(__s32 i) |
float64 int32_to_float64(int32_t i) |
{ |
float64 result; |
if (i < 0) { |
result = uint32_to_float64((__u32)(-i)); |
result = uint32_to_float64((uint32_t)(-i)); |
} else { |
result = uint32_to_float64((__u32)i); |
result = uint32_to_float64((uint32_t)i); |
} |
result.parts.sign = i < 0; |
535,10 → 537,10 |
} |
float64 uint64_to_float64(__u64 i) |
float64 uint64_to_float64(uint64_t i) |
{ |
int counter; |
__s32 exp; |
int32_t exp; |
float64 result; |
result.parts.sign = 0; |
566,14 → 568,14 |
return result; |
} |
float64 int64_to_float64(__s64 i) |
float64 int64_to_float64(int64_t i) |
{ |
float64 result; |
if (i < 0) { |
result = uint64_to_float64((__u64)(-i)); |
result = uint64_to_float64((uint64_t)(-i)); |
} else { |
result = uint64_to_float64((__u64)i); |
result = uint64_to_float64((uint64_t)i); |
} |
result.parts.sign = i < 0; |
/uspace/trunk/softfloat/generic/add.c |
---|
35,7 → 35,7 |
float32 addFloat32(float32 a, float32 b) |
{ |
int expdiff; |
__u32 exp1, exp2,frac1, frac2; |
uint32_t exp1, exp2,frac1, frac2; |
expdiff = a.parts.exp - b.parts.exp; |
if (expdiff < 0) { |
143,8 → 143,8 |
float64 addFloat64(float64 a, float64 b) |
{ |
int expdiff; |
__u32 exp1, exp2; |
__u64 frac1, frac2; |
uint32_t exp1, exp2; |
uint64_t frac1, frac2; |
expdiff = ((int )a.parts.exp) - b.parts.exp; |
if (expdiff < 0) { |
/uspace/trunk/softfloat/generic/common.c |
---|
56,7 → 56,7 |
* @param cfrac fraction shifted 10 places left with added hidden bit |
* @return valied float64 |
*/ |
float64 finishFloat64(__s32 cexp, __u64 cfrac, char sign) |
float64 finishFloat64(int32_t cexp, uint64_t cfrac, char sign) |
{ |
float64 result; |
108,7 → 108,7 |
return result; |
} |
result.parts.exp = (__u32)cexp; |
result.parts.exp = (uint32_t)cexp; |
result.parts.fraction = ((cfrac >>(64 - FLOAT64_FRACTION_SIZE - 2 ) ) & (~FLOAT64_HIDDEN_BIT_MASK)); |
118,7 → 118,7 |
/** Counts leading zeroes in 64bit unsigned integer |
* @param i |
*/ |
int countZeroes64(__u64 i) |
int countZeroes64(uint64_t i) |
{ |
int j; |
for (j =0; j < 64; j += 8) { |
133,7 → 133,7 |
/** Counts leading zeroes in 32bit unsigned integer |
* @param i |
*/ |
int countZeroes32(__u32 i) |
int countZeroes32(uint32_t i) |
{ |
int j; |
for (j =0; j < 32; j += 8) { |
148,7 → 148,7 |
/** Counts leading zeroes in byte |
* @param i |
*/ |
int countZeroes8(__u8 i) |
int countZeroes8(uint8_t i) |
{ |
return zeroTable[i]; |
} |
157,7 → 157,7 |
* @param exp exponent |
* @param fraction part with hidden bit shifted to 30. bit |
*/ |
void roundFloat32(__s32 *exp, __u32 *fraction) |
void roundFloat32(int32_t *exp, uint32_t *fraction) |
{ |
/* rounding - if first bit after fraction is set then round up */ |
(*fraction) += (0x1 << 6); |
182,7 → 182,7 |
* @param exp exponent |
* @param fraction part with hidden bit shifted to 62. bit |
*/ |
void roundFloat64(__s32 *exp, __u64 *fraction) |
void roundFloat64(int32_t *exp, uint64_t *fraction) |
{ |
/* rounding - if first bit after fraction is set then round up */ |
(*fraction) += (0x1 << 9); |
/uspace/trunk/softfloat/generic/sub.c |
---|
35,7 → 35,7 |
float32 subFloat32(float32 a, float32 b) |
{ |
int expdiff; |
__u32 exp1, exp2, frac1, frac2; |
uint32_t exp1, exp2, frac1, frac2; |
float32 result; |
result.f = 0; |
146,8 → 146,8 |
float64 subFloat64(float64 a, float64 b) |
{ |
int expdiff; |
__u32 exp1, exp2; |
__u64 frac1, frac2; |
uint32_t exp1, exp2; |
uint64_t frac1, frac2; |
float64 result; |
result.d = 0; |
/uspace/trunk/softfloat/generic/mul.c |
---|
37,8 → 37,8 |
float32 mulFloat32(float32 a, float32 b) |
{ |
float32 result; |
__u64 frac1, frac2; |
__s32 exp; |
uint64_t frac1, frac2; |
int32_t exp; |
result.parts.sign = a.parts.sign ^ b.parts.sign; |
173,8 → 173,8 |
float64 mulFloat64(float64 a, float64 b) |
{ |
float64 result; |
__u64 frac1, frac2; |
__s32 exp; |
uint64_t frac1, frac2; |
int32_t exp; |
result.parts.sign = a.parts.sign ^ b.parts.sign; |
257,10 → 257,10 |
* @param lo lower part from result |
* @param hi higher part of result |
*/ |
void mul64integers(__u64 a,__u64 b, __u64 *lo, __u64 *hi) |
void mul64integers(uint64_t a,uint64_t b, uint64_t *lo, uint64_t *hi) |
{ |
__u64 low, high, middle1, middle2; |
__u32 alow, blow; |
uint64_t low, high, middle1, middle2; |
uint32_t alow, blow; |
alow = a & 0xFFFFFFFF; |
blow = b & 0xFFFFFFFF; |
268,13 → 268,13 |
a >>= 32; |
b >>= 32; |
low = ((__u64)alow) * blow; |
low = ((uint64_t)alow) * blow; |
middle1 = a * blow; |
middle2 = alow * b; |
high = a * b; |
middle1 += middle2; |
high += (((__u64)(middle1 < middle2)) << 32) + (middle1 >> 32); |
high += (((uint64_t)(middle1 < middle2)) << 32) + (middle1 >> 32); |
middle1 <<= 32; |
low += middle1; |
high += (low < middle1); |
/uspace/trunk/softfloat/Makefile |
---|
1,3 → 1,81 |
all: |
# |
# Copyright (C) 2005 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - Redistributions in binary form must reproduce the above copyright |
# notice, this list of conditions and the following disclaimer in the |
# documentation and/or other materials provided with the distribution. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
# |
## Common compiler flags |
# |
LIBC_PREFIX = ../libc |
## Setup toolchain |
# |
include $(LIBC_PREFIX)/Makefile.toolchain |
CFLAGS +=-Iinclude -Iarch/$(ARCH)/include/ |
## Sources |
# |
GENERIC_SOURCES = \ |
generic/add.c \ |
generic/common.c \ |
generic/comparison.c \ |
generic/conversion.c \ |
generic/div.c \ |
generic/mul.c \ |
generic/other.c \ |
generic/softfloat.c \ |
generic/sub.c |
ARCH_SOURCES = |
GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) |
.PHONY: all clean depend |
all: libsoftfloat.a |
-include Makefile.depend |
clean: |
-rm -f libsoftfloat.a Makefile.depend |
find generic/ -name '*.o' -follow -exec rm \{\} \; |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(GENERIC_SOURCES) > Makefile.depend |
libsoftfloat.a: depend $(ARCH_OBJECTS) $(GENERIC_OBJECTS) |
$(AR) rc libsoftfloat.a $(ARCH_OBJECTS) $(GENERIC_OBJECTS) |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
/uspace/trunk/softfloat/arch/sparc64/include/functions.h |
---|
0,0 → 1,65 |
/* |
* Copyright (C) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
#ifndef __SOFTFLOAT_FUNCTIONS_H__ |
#define __SOFTFLOAT_FUNCTIONS_H__ |
#define float32_to_int(X) float32_to_int32(X); |
#define float32_to_long(X) float32_to_int64(X); |
#define float32_to_longlong(X) float32_to_int64(X); |
#define float64_to_int(X) float64_to_int32(X); |
#define float64_to_long(X) float64_to_int64(X); |
#define float64_to_longlong(X) float64_to_int64(X); |
#define float32_to_uint(X) float32_to_uint32(X); |
#define float32_to_ulong(X) float32_to_uint64(X); |
#define float32_to_ulonglong(X) float32_to_uint64(X); |
#define float64_to_uint(X) float64_to_uint32(X); |
#define float64_to_ulong(X) float64_to_uint64(X); |
#define float64_to_ulonglong(X) float64_to_uint64(X); |
#define int_to_float32(X) int32_to_float32(X); |
#define long_to_float32(X) int64_to_float32(X); |
#define longlong_to_float32(X) int64_to_float32(X); |
#define int_to_float64(X) int32_to_float64(X); |
#define long_to_float64(X) int64_to_float64(X); |
#define longlong_to_float64(X) int64_to_float64(X); |
#define uint_to_float32(X) uint32_to_float32(X); |
#define ulong_to_float32(X) uint64_to_float32(X); |
#define ulonglong_to_float32(X) uint64_to_float32(X); |
#define uint_to_float64(X) uint32_to_float64(X); |
#define ulong_to_float64(X) uint64_to_float64(X); |
#define ulonglong_to_float64(X) uint64_to_float64(X); |
#endif |
/uspace/trunk/softfloat/arch/ia64/include/functions.h |
---|
0,0 → 1,65 |
/* |
* Copyright (C) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
#ifndef __SOFTFLOAT_FUNCTIONS_H__ |
#define __SOFTFLOAT_FUNCTIONS_H__ |
#define float32_to_int(X) float32_to_int32(X); |
#define float32_to_long(X) float32_to_int64(X); |
#define float32_to_longlong(X) float32_to_int64(X); |
#define float64_to_int(X) float64_to_int32(X); |
#define float64_to_long(X) float64_to_int64(X); |
#define float64_to_longlong(X) float64_to_int64(X); |
#define float32_to_uint(X) float32_to_uint32(X); |
#define float32_to_ulong(X) float32_to_uint64(X); |
#define float32_to_ulonglong(X) float32_to_uint64(X); |
#define float64_to_uint(X) float64_to_uint32(X); |
#define float64_to_ulong(X) float64_to_uint64(X); |
#define float64_to_ulonglong(X) float64_to_uint64(X); |
#define int_to_float32(X) int32_to_float32(X); |
#define long_to_float32(X) int64_to_float32(X); |
#define longlong_to_float32(X) int64_to_float32(X); |
#define int_to_float64(X) int32_to_float64(X); |
#define long_to_float64(X) int64_to_float64(X); |
#define longlong_to_float64(X) int64_to_float64(X); |
#define uint_to_float32(X) uint32_to_float32(X); |
#define ulong_to_float32(X) uint64_to_float32(X); |
#define ulonglong_to_float32(X) uint64_to_float32(X); |
#define uint_to_float64(X) uint32_to_float64(X); |
#define ulong_to_float64(X) uint64_to_float64(X); |
#define ulonglong_to_float64(X) uint64_to_float64(X); |
#endif |
/uspace/trunk/softfloat/arch/mips32eb/include/functions.h |
---|
0,0 → 1,65 |
/* |
* Copyright (C) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
#ifndef __SOFTFLOAT_FUNCTIONS_H__ |
#define __SOFTFLOAT_FUNCTIONS_H__ |
#define float32_to_int(X) float32_to_int32(X); |
#define float32_to_long(X) float32_to_int32(X); |
#define float32_to_longlong(X) float32_to_int64(X); |
#define float64_to_int(X) float64_to_int32(X); |
#define float64_to_long(X) float64_to_int32(X); |
#define float64_to_longlong(X) float64_to_int64(X); |
#define float32_to_uint(X) float32_to_uint32(X); |
#define float32_to_ulong(X) float32_to_uint32(X); |
#define float32_to_ulonglong(X) float32_to_uint64(X); |
#define float64_to_uint(X) float64_to_uint32(X); |
#define float64_to_ulong(X) float64_to_uint32(X); |
#define float64_to_ulonglong(X) float64_to_uint64(X); |
#define int_to_float32(X) int32_to_float32(X); |
#define long_to_float32(X) int32_to_float32(X); |
#define longlong_to_float32(X) int64_to_float32(X); |
#define int_to_float64(X) int32_to_float64(X); |
#define long_to_float64(X) int32_to_float64(X); |
#define longlong_to_float64(X) int64_to_float64(X); |
#define uint_to_float32(X) uint32_to_float32(X); |
#define ulong_to_float32(X) uint32_to_float32(X); |
#define ulonglong_to_float32(X) uint64_to_float32(X); |
#define uint_to_float64(X) uint32_to_float64(X); |
#define ulong_to_float64(X) uint32_to_float64(X); |
#define ulonglong_to_float64(X) uint64_to_float64(X); |
#endif |
/uspace/trunk/softfloat/arch/ppc32/include/functions.h |
---|
0,0 → 1,65 |
/* |
* Copyright (C) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
#ifndef __SOFTFLOAT_FUNCTIONS_H__ |
#define __SOFTFLOAT_FUNCTIONS_H__ |
#define float32_to_int(X) float32_to_int32(X); |
#define float32_to_long(X) float32_to_int32(X); |
#define float32_to_longlong(X) float32_to_int64(X); |
#define float64_to_int(X) float64_to_int32(X); |
#define float64_to_long(X) float64_to_int32(X); |
#define float64_to_longlong(X) float64_to_int64(X); |
#define float32_to_uint(X) float32_to_uint32(X); |
#define float32_to_ulong(X) float32_to_uint32(X); |
#define float32_to_ulonglong(X) float32_to_uint64(X); |
#define float64_to_uint(X) float64_to_uint32(X); |
#define float64_to_ulong(X) float64_to_uint32(X); |
#define float64_to_ulonglong(X) float64_to_uint64(X); |
#define int_to_float32(X) int32_to_float32(X); |
#define long_to_float32(X) int32_to_float32(X); |
#define longlong_to_float32(X) int64_to_float32(X); |
#define int_to_float64(X) int32_to_float64(X); |
#define long_to_float64(X) int32_to_float64(X); |
#define longlong_to_float64(X) int64_to_float64(X); |
#define uint_to_float32(X) uint32_to_float32(X); |
#define ulong_to_float32(X) uint32_to_float32(X); |
#define ulonglong_to_float32(X) uint64_to_float32(X); |
#define uint_to_float64(X) uint32_to_float64(X); |
#define ulong_to_float64(X) uint32_to_float64(X); |
#define ulonglong_to_float64(X) uint64_to_float64(X); |
#endif |
/uspace/trunk/softfloat/arch/amd64/include/functions.h |
---|
0,0 → 1,65 |
/* |
* Copyright (C) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
#ifndef __SOFTFLOAT_FUNCTIONS_H__ |
#define __SOFTFLOAT_FUNCTIONS_H__ |
#define float32_to_int(X) float32_to_int32(X); |
#define float32_to_long(X) float32_to_int64(X); |
#define float32_to_longlong(X) float32_to_int64(X); |
#define float64_to_int(X) float64_to_int32(X); |
#define float64_to_long(X) float64_to_int64(X); |
#define float64_to_longlong(X) float64_to_int64(X); |
#define float32_to_uint(X) float32_to_uint32(X); |
#define float32_to_ulong(X) float32_to_uint64(X); |
#define float32_to_ulonglong(X) float32_to_uint64(X); |
#define float64_to_uint(X) float64_to_uint32(X); |
#define float64_to_ulong(X) float64_to_uint64(X); |
#define float64_to_ulonglong(X) float64_to_uint64(X); |
#define int_to_float32(X) int32_to_float32(X); |
#define long_to_float32(X) int64_to_float32(X); |
#define longlong_to_float32(X) int64_to_float32(X); |
#define int_to_float64(X) int32_to_float64(X); |
#define long_to_float64(X) int64_to_float64(X); |
#define longlong_to_float64(X) int64_to_float64(X); |
#define uint_to_float32(X) uint32_to_float32(X); |
#define ulong_to_float32(X) uint64_to_float32(X); |
#define ulonglong_to_float32(X) uint64_to_float32(X); |
#define uint_to_float64(X) uint32_to_float64(X); |
#define ulong_to_float64(X) uint64_to_float64(X); |
#define ulonglong_to_float64(X) uint64_to_float64(X); |
#endif |
/uspace/trunk/softfloat/arch/mips32/include/functions.h |
---|
0,0 → 1,65 |
/* |
* Copyright (C) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
#ifndef __SOFTFLOAT_FUNCTIONS_H__ |
#define __SOFTFLOAT_FUNCTIONS_H__ |
#define float32_to_int(X) float32_to_int32(X); |
#define float32_to_long(X) float32_to_int32(X); |
#define float32_to_longlong(X) float32_to_int64(X); |
#define float64_to_int(X) float64_to_int32(X); |
#define float64_to_long(X) float64_to_int32(X); |
#define float64_to_longlong(X) float64_to_int64(X); |
#define float32_to_uint(X) float32_to_uint32(X); |
#define float32_to_ulong(X) float32_to_uint32(X); |
#define float32_to_ulonglong(X) float32_to_uint64(X); |
#define float64_to_uint(X) float64_to_uint32(X); |
#define float64_to_ulong(X) float64_to_uint32(X); |
#define float64_to_ulonglong(X) float64_to_uint64(X); |
#define int_to_float32(X) int32_to_float32(X); |
#define long_to_float32(X) int32_to_float32(X); |
#define longlong_to_float32(X) int64_to_float32(X); |
#define int_to_float64(X) int32_to_float64(X); |
#define long_to_float64(X) int32_to_float64(X); |
#define longlong_to_float64(X) int64_to_float64(X); |
#define uint_to_float32(X) uint32_to_float32(X); |
#define ulong_to_float32(X) uint32_to_float32(X); |
#define ulonglong_to_float32(X) uint64_to_float32(X); |
#define uint_to_float64(X) uint32_to_float64(X); |
#define ulong_to_float64(X) uint32_to_float64(X); |
#define ulonglong_to_float64(X) uint64_to_float64(X); |
#endif |
/uspace/trunk/softfloat/arch/ia32/include/types.h |
---|
File deleted |
/uspace/trunk/softfloat/arch/ia32/include/arch.h |
---|
File deleted |
/uspace/trunk/softfloat/arch/ia32/include/functions.h |
---|
26,8 → 26,8 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
#ifndef __ia32_FUNCTIONS_H__ |
#define __ia32_FUNCTIONS_H__ |
#ifndef __SOFTFLOAT_FUNCTIONS_H__ |
#define __SOFTFLOAT_FUNCTIONS_H__ |
#define float32_to_int(X) float32_to_int32(X); |
#define float32_to_long(X) float32_to_int32(X); |
61,6 → 61,5 |
#define ulong_to_float64(X) uint32_to_float64(X); |
#define ulonglong_to_float64(X) uint64_to_float64(X); |
#endif |
#endif |
/uspace/trunk/softint/Makefile.toolchain |
---|
File deleted |
/uspace/trunk/softint/Makefile |
---|
40,6 → 40,8 |
## Sources |
# |
ARCH_SOURCES = |
GENERIC_SOURCES = \ |
generic/division.c |
/uspace/trunk/libc/include/endian.h |
---|
0,0 → 1,39 |
/* |
* Copyright (C) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
#ifndef __LIBC__ENDIANS_H__ |
#define __LIBC__ENDIANS_H__ |
#define __LITTLE_ENDIAN 1234 |
#define __BIG_ENDIAN 4321 |
#define __PDP_ENDIAN 3412 |
/* TODO: move it to arch dependent directory */ |
#define __BYTE_ORDER __LITTLE_ENDIAN |
#endif |
/uspace/trunk/libc/include/stdint.h |
---|
0,0 → 1,56 |
/* |
* Copyright (C) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
#ifndef __LIBC__STDINT_H__ |
#define __LIBC__STDINT_H__ |
/* Definitions of types with fixed size*/ |
#include<types.h> |
#define MAX_INT8 (0x7F) |
#define MIN_INT8 (0x80) |
#define MAX_UINT8 (0xFFu) |
#define MIN_UINT8 (0u) |
#define MAX_INT16 (0x7FFF) |
#define MIN_INT16 (0x8000) |
#define MAX_UINT16 (0xFFFFu) |
#define MIN_UINT16 (0u) |
#define MAX_INT32 (0x7FFFFFFF) |
#define MIN_INT32 (0x80000000) |
#define MAX_UINT32 (0xFFFFFFFFu) |
#define MIN_UINT32 (0u) |
#define MAX_INT64 (0x7FFFFFFFFFFFFFFFll) |
#define MIN_INT64 (0x8000000000000000ll) |
#define MAX_UINT64 (0xFFFFFFFFFFFFFFFFull) |
#define MIN_UINT64 (0ull) |
#endif |