-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[flang] Warn when F128 is unsupported #102147
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -161,19 +161,33 @@ end function ieee_round_ne | |
G(1) G(2) G(4) G(8) G(16) | ||
#define SPECIFICS_L(G) \ | ||
G(1) G(2) G(4) G(8) | ||
|
||
#if FLANG_SUPPORT_R16 | ||
#if __x86_64__ | ||
#define SPECIFICS_R(G) \ | ||
G(2) G(3) G(4) G(8) G(10) G(16) | ||
#else | ||
#define SPECIFICS_R(G) \ | ||
G(2) G(3) G(4) G(8) G(16) | ||
#endif | ||
#else | ||
#if __x86_64__ | ||
#define SPECIFICS_R(G) \ | ||
G(2) G(3) G(4) G(8) G(10) | ||
#else | ||
#define SPECIFICS_R(G) \ | ||
G(2) G(3) G(4) G(8) | ||
#endif | ||
#endif | ||
|
||
#define SPECIFICS_II(G) \ | ||
G(1,1) G(1,2) G(1,4) G(1,8) G(1,16) \ | ||
G(2,1) G(2,2) G(2,4) G(2,8) G(2,16) \ | ||
G(4,1) G(4,2) G(4,4) G(4,8) G(4,16) \ | ||
G(8,1) G(8,2) G(8,4) G(8,8) G(8,16) \ | ||
G(16,1) G(16,2) G(16,4) G(16,8) G(16,16) | ||
|
||
#if FLANG_SUPPORT_R16 | ||
#if __x86_64__ | ||
#define SPECIFICS_RI(G) \ | ||
G(2,1) G(2,2) G(2,4) G(2,8) G(2,16) \ | ||
|
@@ -190,7 +204,24 @@ end function ieee_round_ne | |
G(8,1) G(8,2) G(8,4) G(8,8) G(8,16) \ | ||
G(16,1) G(16,2) G(16,4) G(16,8) G(16,16) | ||
#endif | ||
#else | ||
#if __x86_64__ | ||
#define SPECIFICS_RI(G) \ | ||
G(2,1) G(2,2) G(2,4) G(2,8) \ | ||
G(3,1) G(3,2) G(3,4) G(3,8) \ | ||
G(4,1) G(4,2) G(4,4) G(4,8) \ | ||
G(8,1) G(8,2) G(8,4) G(8,8) \ | ||
G(10,1) G(10,2) G(10,4) G(10,8) | ||
#else | ||
#define SPECIFICS_RI(G) \ | ||
G(2,1) G(2,2) G(2,4) G(2,8) \ | ||
G(3,1) G(3,2) G(3,4) G(3,8) \ | ||
G(4,1) G(4,2) G(4,4) G(4,8) \ | ||
G(8,1) G(8,2) G(8,4) G(8,8) | ||
#endif | ||
#endif | ||
|
||
#if FLANG_SUPPORT_R16 | ||
#if __x86_64__ | ||
#define SPECIFICS_RR(G) \ | ||
G(2,2) G(2,3) G(2,4) G(2,8) G(2,10) G(2,16) \ | ||
|
@@ -207,6 +238,22 @@ end function ieee_round_ne | |
G(8,2) G(8,3) G(8,4) G(8,8) G(8,16) \ | ||
G(16,2) G(16,3) G(16,4) G(16,8) G(16,16) | ||
#endif | ||
#else | ||
#if __x86_64__ | ||
#define SPECIFICS_RR(G) \ | ||
G(2,2) G(2,3) G(2,4) G(2,8) G(2,10) \ | ||
G(3,2) G(3,3) G(3,4) G(3,8) G(3,10) \ | ||
G(4,2) G(4,3) G(4,4) G(4,8) G(4,10) \ | ||
G(8,2) G(8,3) G(8,4) G(8,8) G(8,10) \ | ||
G(10,2) G(10,3) G(10,4) G(10,8) G(10,10) | ||
#else | ||
#define SPECIFICS_RR(G) \ | ||
G(2,2) G(2,3) G(2,4) G(2,8) \ | ||
G(3,2) G(3,3) G(3,4) G(3,8) \ | ||
G(4,2) G(4,3) G(4,4) G(4,8) \ | ||
G(8,2) G(8,3) G(8,4) G(8,8) | ||
#endif | ||
#endif | ||
|
||
#define IEEE_CLASS_R(XKIND) \ | ||
elemental type(ieee_class_type) function ieee_class_a##XKIND(x); \ | ||
|
@@ -462,8 +509,10 @@ end function ieee_real_a##AKIND##_i##KKIND; | |
interface ieee_real | ||
SPECIFICS_I(IEEE_REAL_I) | ||
SPECIFICS_R(IEEE_REAL_R) | ||
#if FLANG_SUPPORT_R16 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe these intrinsics may work for targets where Maybe we can just issue a warning about incomplete real*16 support and do not change the module file? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These should still be enabled when libquadmath is linked: https://github.com/llvm/llvm-project/pull/102147/files#diff-b856c78ebb5a2b3c7fb791b499183206a28b6f7989d4c60fbbe9b8fbaaabe3ffR46 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I disabled these parts of the library when REAL16 is unsupported because we also disable REAL10 on unsupported machines. Is something different about REAL16 that means we should just build with warnings? |
||
SPECIFICS_II(IEEE_REAL_II) | ||
SPECIFICS_RI(IEEE_REAL_RI) | ||
#endif | ||
end interface ieee_real | ||
public :: ieee_real | ||
#undef IEEE_REAL_I | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
! REQUIRES: flang-supports-f128-math | ||
! RUN: bbc -emit-fir -o - %s | FileCheck %s | ||
|
||
! CHECK-LABEL: func @_QQmain | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as below. Some basic real*16 operations may still work, but math may not. I think it may be too much to disable it all.