This repository has been archived by the owner on May 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Use softfp instead of *PBITS
- Remove riscv-fp.c.
- long double and struct {long double} always pass in memory.- Loading branch information
1 parent
254d044
commit 54b21fc
Showing
8 changed files
with
130 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
|
|
||
| #ifdef __riscv32 | ||
|
|
||
| #define _FP_W_TYPE_SIZE 32 | ||
| #define _FP_W_TYPE unsigned long | ||
| #define _FP_WS_TYPE signed long | ||
| #define _FP_I_TYPE long | ||
|
|
||
| #define _FP_MUL_MEAT_S(R,X,Y) \ | ||
| _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm) | ||
| #define _FP_MUL_MEAT_D(R,X,Y) \ | ||
| _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm) | ||
| #define _FP_MUL_MEAT_Q(R,X,Y) \ | ||
| _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm) | ||
|
|
||
| #define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_udiv_norm(S,R,X,Y) | ||
| #define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_2_udiv(D,R,X,Y) | ||
| #define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_4_udiv(Q,R,X,Y) | ||
|
|
||
| #define _FP_NANFRAC_S ((_FP_QNANBIT_S << 1) - 1) | ||
| #define _FP_NANFRAC_D ((_FP_QNANBIT_D << 1) - 1), -1 | ||
| #define _FP_NANFRAC_Q ((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1 | ||
|
|
||
| #else | ||
|
|
||
| #define _FP_W_TYPE_SIZE 64 | ||
| #define _FP_W_TYPE unsigned long long | ||
| #define _FP_WS_TYPE signed long long | ||
| #define _FP_I_TYPE long long | ||
|
|
||
| #define _FP_MUL_MEAT_S(R,X,Y) \ | ||
| _FP_MUL_MEAT_1_imm(_FP_WFRACBITS_S,R,X,Y) | ||
| #define _FP_MUL_MEAT_D(R,X,Y) \ | ||
| _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm) | ||
| #define _FP_MUL_MEAT_Q(R,X,Y) \ | ||
| _FP_MUL_MEAT_2_wide_3mul(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm) | ||
|
|
||
| #define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_imm(S,R,X,Y,_FP_DIV_HELP_imm) | ||
| #define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_1_udiv_norm(D,R,X,Y) | ||
| #define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_2_udiv(Q,R,X,Y) | ||
|
|
||
| #define _FP_NANFRAC_S ((_FP_QNANBIT_S << 1) - 1) | ||
| #define _FP_NANFRAC_D ((_FP_QNANBIT_D << 1) - 1) | ||
| #define _FP_NANFRAC_Q ((_FP_QNANBIT_Q << 1) - 1), -1 | ||
|
|
||
| #endif | ||
|
|
||
| #ifdef __riscv64 | ||
| typedef int TItype __attribute__ ((mode (TI))); | ||
| typedef unsigned int UTItype __attribute__ ((mode (TI))); | ||
| #define TI_BITS (__CHAR_BIT__ * (int)sizeof(TItype)) | ||
| #endif | ||
|
|
||
| /* The type of the result of a floating point comparison. This must | ||
| match __libgcc_cmp_return__ in GCC for the target. */ | ||
| typedef int __gcc_CMPtype __attribute__ ((mode (__libgcc_cmp_return__))); | ||
| #define CMPtype __gcc_CMPtype | ||
|
|
||
| #define _FP_NANSIGN_S 0 | ||
| #define _FP_NANSIGN_D 0 | ||
| #define _FP_NANSIGN_Q 0 | ||
|
|
||
| #define _FP_KEEPNANFRACP 1 | ||
| #define _FP_QNANNEGATEDP 0 | ||
|
|
||
|
|
||
| /* From my experiments it seems X is chosen unless one of the | ||
| NaNs is sNaN, in which case the result is NANSIGN/NANFRAC. */ | ||
| #define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \ | ||
| do { \ | ||
| if ((_FP_FRAC_HIGH_RAW_##fs(X) | \ | ||
| _FP_FRAC_HIGH_RAW_##fs(Y)) & _FP_QNANBIT_##fs) \ | ||
| { \ | ||
| R##_s = _FP_NANSIGN_##fs; \ | ||
| _FP_FRAC_SET_##wc(R,_FP_NANFRAC_##fs); \ | ||
| } \ | ||
| else \ | ||
| { \ | ||
| R##_s = X##_s; \ | ||
| _FP_FRAC_COPY_##wc(R,X); \ | ||
| } \ | ||
| R##_c = FP_CLS_NAN; \ | ||
| } while (0) | ||
|
|
||
| #define _FP_TININESS_AFTER_ROUNDING 0 | ||
|
|
||
| #define __LITTLE_ENDIAN 1234 | ||
| #define __BIG_ENDIAN 4321 | ||
|
|
||
| #if defined __big_endian__ | ||
| # define __BYTE_ORDER __BIG_ENDIAN | ||
| #else | ||
| # define __BYTE_ORDER __LITTLE_ENDIAN | ||
| #endif | ||
|
|
||
|
|
||
| /* Define ALIASNAME as a strong alias for NAME. */ | ||
| # define strong_alias(name, aliasname) _strong_alias(name, aliasname) | ||
| # define _strong_alias(name, aliasname) \ | ||
| extern __typeof (name) aliasname __attribute__ ((alias (#name))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,6 @@ | ||
| LIB2ADD += $(srcdir)/config/riscv/riscv-fp.c \ | ||
| $(srcdir)/config/riscv/save-restore.S \ | ||
| LIB2ADD += $(srcdir)/config/riscv/save-restore.S \ | ||
| $(srcdir)/config/riscv/muldi3.S \ | ||
| $(srcdir)/config/riscv/multi3.S \ | ||
| $(srcdir)/config/riscv/div.S \ | ||
| $(srcdir)/config/riscv/atomic.c \ | ||
|
|
||
| FPBIT = true | ||
|
|
||
| ifeq ($(double_type_size),64) | ||
| DPBIT = true | ||
| endif | ||
|
|
||
| ifeq ($(long_double_type_size),128) | ||
| TPBIT = true | ||
| endif |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| softfp_float_modes += tf | ||
| softfp_int_modes += ti | ||
| softfp_extensions += sftf dftf | ||
| softfp_truncations += tfsf tfdf |