diff options
author | Andrew Waterman <waterman@cs.berkeley.edu> | 2016-10-25 02:06:08 -0700 |
---|---|---|
committer | Andrew Waterman <waterman@cs.berkeley.edu> | 2016-10-25 02:10:02 -0700 |
commit | a1e7a925c16f8ff34c5a6d794bfe9b9d5660268f (patch) | |
tree | c1e354f6263132ee60d32d9c787ea343bb3eabcf /newlib | |
parent | 1261c826a419c9d303c644a8d2e719124cf9b440 (diff) | |
download | riscv-gnu-toolchain-a1e7a925c16f8ff34c5a6d794bfe9b9d5660268f.zip riscv-gnu-toolchain-a1e7a925c16f8ff34c5a6d794bfe9b9d5660268f.tar.gz riscv-gnu-toolchain-a1e7a925c16f8ff34c5a6d794bfe9b9d5660268f.tar.bz2 |
Overhaul floating-point command-line arguments
- -march controls which instructions may be emitted, and does not
affect ABI.
- -mno-float is equivalent to passing neither F for D to -march;
-msingle-float is equivalent to passing F but not D to -march;
and -mdouble-float is equivalent to passing F and D to -march.
- -mfloat-abi controls which calling convention is used: "soft" means
no args passed in registers; "single" means only single-precision
values are passed in regisers; "double" means single- and
double-precision values are passed in registers.
- -mfloat-abi defaults to "soft" if the D extension is not present,
or "double" if it is.
- GCC will issue an error if -mfloat-abi requires an extension not
provided by -march, but vice-versa is OK.
Closes #187 (I hope).
@kito-cheng can you test this and let me know what I need to fix?
Diffstat (limited to 'newlib')
-rw-r--r-- | newlib/newlib/libc/machine/riscv/setjmp.S | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/newlib/newlib/libc/machine/riscv/setjmp.S b/newlib/newlib/libc/machine/riscv/setjmp.S index 6d5da40..8aadbcc 100644 --- a/newlib/newlib/libc/machine/riscv/setjmp.S +++ b/newlib/newlib/libc/machine/riscv/setjmp.S @@ -8,14 +8,14 @@ # define SZREG 4 #endif -#ifdef __riscv_flen +#ifndef __riscv_float_abi_soft /* For ABI uniformity, reserve 8 bytes for floats, even if double-precision floating-point is not supported in hardware. */ # define SZFREG 8 -# if __riscv_flen == 32 +# ifdef __riscv_float_abi_single # define FREG_L flw # define FREG_S fsw -# elif __riscv_flen == 64 +# elif defined(__riscv_float_abi_double) # define FREG_L fld # define FREG_S fsd # else @@ -41,7 +41,7 @@ setjmp: REG_S s11,12*SZREG(a0) REG_S sp, 13*SZREG(a0) -#ifdef __riscv_flen +#ifndef __riscv_float_abi_soft FREG_S fs0, 14*SZREG+ 0*SZFREG(a0) FREG_S fs1, 14*SZREG+ 1*SZFREG(a0) FREG_S fs2, 14*SZREG+ 2*SZFREG(a0) @@ -77,7 +77,7 @@ longjmp: REG_L s11,12*SZREG(a0) REG_L sp, 13*SZREG(a0) -#ifdef __riscv_flen +#ifndef __riscv_float_abi_soft FREG_L fs0, 14*SZREG+ 0*SZFREG(a0) FREG_L fs1, 14*SZREG+ 1*SZFREG(a0) FREG_L fs2, 14*SZREG+ 2*SZFREG(a0) |