-
-
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.
rs6000: Guard fctid on PowerPC64 and PowerPC476
fctid is only supported on 64-bit Power processors and powerpc 476. It should be guarded by this condition. The patch fixes the issue. gcc/ PR target/112707 * config/rs6000/rs6000.h (TARGET_FCTID): Define. * config/rs6000/rs6000.md (lrint<mode>di2): Add guard TARGET_FCTID. * (lround<mode>di2): Replace TARGET_FPRND with TARGET_FCTID. gcc/testsuite/ PR target/112707 * gcc.target/powerpc/pr112707.h: New. * gcc.target/powerpc/pr112707-2.c: New. * gcc.target/powerpc/pr112707-3.c: New. * gcc.target/powerpc/pr88558-p7.c: Check fctid on ilp32 and has_arch_ppc64 as it's now guarded by powerpc64. * gcc.target/powerpc/pr88558-p8.c: Likewise. * gfortran.dg/nint_p7.f90: Add powerpc64 target requirement as lround<mode>di2 is now guarded by powerpc64.
- Loading branch information
Haochen Gui
committed
Dec 11, 2023
1 parent
46e342b
commit ae226cb
Showing
8 changed files
with
35 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* { dg-do compile } */ | ||
/* { dg-options "-O2 -mdejagnu-cpu=7450 -fno-math-errno" } */ | ||
/* { dg-require-effective-target ilp32 } */ | ||
/* { dg-skip-if "" { has_arch_ppc64 } } */ | ||
/* { dg-final { scan-assembler-not {\mfctid\M} } } */ | ||
|
||
/* powerpc 7450 doesn't support ppc64 (-m32 -mpowerpc64), so skips it. */ | ||
|
||
#include "pr112707.h" |
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,9 @@ | ||
/* { dg-do compile } */ | ||
/* { dg-options "-O2 -fno-math-errno -mdejagnu-cpu=476fp" } */ | ||
/* { dg-require-effective-target ilp32 } */ | ||
|
||
/* powerpc 476fp has hard float enabled which is required by fctid */ | ||
|
||
#include "pr112707.h" | ||
|
||
/* { dg-final { scan-assembler-times {\mfctid\M} 2 } } */ |
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 @@ | ||
long long test1 (double a) | ||
{ | ||
return __builtin_llrint (a); | ||
} | ||
|
||
long long test2 (float a) | ||
{ | ||
return __builtin_llrint (a); | ||
} | ||
|
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