Skip to content

Commit

Permalink
Rename DoubleFloatUnion to Float64Union
Browse files Browse the repository at this point in the history
  • Loading branch information
AngheloAlf committed Nov 14, 2023
1 parent a307be4 commit 4b458e6
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 10 deletions.
14 changes: 12 additions & 2 deletions include/gcc_vr4300/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

typedef __SIZE_TYPE__ size_t;

typedef __INT32_TYPE__ int32_t;
STATIC_ASSERT(sizeof(int32_t) == 4, "int32_t type's size is not 4");

typedef __INT64_TYPE__ int64_t;
STATIC_ASSERT(sizeof(int64_t) == 8, "int64_t type's size is not 8");

Expand All @@ -26,10 +29,17 @@ STATIC_ASSERT(sizeof(float128) == 16, "float128 type's size is not 16");

typedef int fcmp __attribute__ ((mode (__libgcc_cmp_return__)));

typedef union DoubleFloatUnion {
typedef union Float64Union {
float64 d;
int64_t ll;
uint64_t ull;
} DoubleFloatUnion;
} Float64Union;

#if ABI_N32 || ABI_N64
typedef union Float128Union {
float128 ld;
uint64_t hex[2];
} Float128Union;
#endif

#endif
2 changes: 1 addition & 1 deletion src/soft_float/float_from_int/__floatdidf.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ EXPORT(__floatdidf);
* https://gcc.gnu.org/onlinedocs/gccint/the-gcc-low-level-runtime-library/routines-for-floating-point-emulation.html#c.__floatdidf
*/
float64 __floatdidf(int64_t i) {
register DoubleFloatUnion dull;
register Float64Union dull;
register float64 ret;

dull.ll = i;
Expand Down
2 changes: 1 addition & 1 deletion src/soft_float/float_from_int/__floatdisf.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ EXPORT(__floatdisf);
* https://gcc.gnu.org/onlinedocs/gccint/the-gcc-low-level-runtime-library/routines-for-floating-point-emulation.html#c.__floatdisf
*/
float32 __floatdisf(int64_t i) {
register DoubleFloatUnion dull;
register Float64Union dull;
register float32 ret;

dull.ll = i;
Expand Down
2 changes: 1 addition & 1 deletion src/soft_float/float_from_int/__floatundidf.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ EXPORT(__floatundidf);
* https://gcc.gnu.org/onlinedocs/gccint/the-gcc-low-level-runtime-library/routines-for-floating-point-emulation.html#c.__floatundidf
*/
float64 __floatundidf(uint64_t i) {
register DoubleFloatUnion dull;
register Float64Union dull;
register float64 ret;

dull.ull = i;
Expand Down
2 changes: 1 addition & 1 deletion src/soft_float/float_from_int/__floatundisf.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ EXPORT(__floatundisf);
* https://gcc.gnu.org/onlinedocs/gccint/the-gcc-low-level-runtime-library/routines-for-floating-point-emulation.html#c.__floatundisf
*/
float32 __floatundisf(uint64_t i) {
register DoubleFloatUnion dull;
register Float64Union dull;
register float32 ret;

dull.ull = i;
Expand Down
2 changes: 1 addition & 1 deletion src/soft_float/int_from_float/__fixdfdi.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ EXPORT(__fixdfdi);
* https://gcc.gnu.org/onlinedocs/gccint/the-gcc-low-level-runtime-library/routines-for-floating-point-emulation.html#c.__fixdfdi
*/
int64_t __fixdfdi(float64 a) {
register DoubleFloatUnion dull;
register Float64Union dull;

__asm__("trunc.l.d %0, %1" : "=f"(dull.d) : "f"(a));
return dull.ll;
Expand Down
2 changes: 1 addition & 1 deletion src/soft_float/int_from_float/__fixsfdi.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ EXPORT(__fixsfdi);
* https://gcc.gnu.org/onlinedocs/gccint/the-gcc-low-level-runtime-library/routines-for-floating-point-emulation.html#c.__fixsfdi
*/
int64_t __fixsfdi(float32 a) {
register DoubleFloatUnion dull;
register Float64Union dull;

__asm__("trunc.l.s %0, %1" : "=f"(dull.d) : "f"(a));
return dull.ll;
Expand Down
2 changes: 1 addition & 1 deletion src/soft_float/int_from_float/__fixunsdfdi.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ uint64_t __fixunsdfdi(float64 a) {
return 0;
}

register DoubleFloatUnion dull;
register Float64Union dull;

__asm__("trunc.l.d %0, %1" : "=f"(dull.d) : "f"(a));
return dull.ull;
Expand Down
2 changes: 1 addition & 1 deletion src/soft_float/int_from_float/__fixunssfdi.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ uint64_t __fixunssfdi(float32 a) {
return 0;
}

register DoubleFloatUnion dull;
register Float64Union dull;

__asm__("trunc.l.s %0, %1" : "=f"(dull.d) : "f"(a));
return dull.ull;
Expand Down

0 comments on commit 4b458e6

Please sign in to comment.