-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RISC-V: Introduce the -mlong-double-{64,128} option
Similarly to some other targets, this patch adds the ability to change the size of long double. This is to support the ABI deviation permitting long double to be 64-bit wide. Add a testcase checking that, whenever -mlong-double-64 is given, 64-bit double-precision instructions are used instead of calls to libgcc's 128-bit softfloat functions. FIXME: This patch is incomplete and unsafe until a mechanism is added that would propagate this option to the assembler and linker to ensure that 64-bit long double and 128-bit long double code can never be linked together. Signed-off-by: Artemiy Volkov <artemiy@synopsys.com>
- Loading branch information
1 parent
2677e8b
commit 15a88f9
Showing
3 changed files
with
26 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* { dg-do compile } */ | ||
/* { dg-require-effective-target rv32 } */ | ||
/* { dg-options "-march=rv32gc -mabi=ilp32d -mlong-double-64" } */ | ||
|
||
int __attribute__((noinline)) | ||
g (long double ld) | ||
{ | ||
return (int)ld; | ||
} | ||
|
||
int | ||
f (int x) | ||
{ | ||
return (long double) 3.141592; | ||
} | ||
|
||
/* { dg-final { scan-assembler-times "__fixtfsi" 0 } } */ |