Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Clang][LoongArch] Pass "f" and "d" features to cc1 to enable hard float
On LoongArch, currently neither of "f" and "d" feature is passed from clang driver to cc1 by default. This means the backend generates code for soft float. In order to run programs in current LoongArch machines (hard float environment) this patch temporarily enables "f" and "d" features. In future, we should conditionally turn on these features depend on various clang options, e.g. -mdouble-float, -msingle-float, -msoft-float and -mfpu.
- Loading branch information
1 parent
48aea4a
commit fcce256
Showing
4 changed files
with
29 additions
and
0 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 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,10 @@ | ||
// RUN: %clang --target=loongarch32 -S -emit-llvm %s -o - | FileCheck %s --check-prefix=LA32 | ||
// RUN: %clang --target=loongarch64 -S -emit-llvm %s -o - | FileCheck %s --check-prefix=LA64 | ||
|
||
// LA32: "target-features"="+d,+f" | ||
// LA64: "target-features"="+d,+f" | ||
|
||
/// Dummy function | ||
int foo(void) { | ||
return 3; | ||
} |