[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-09-06 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. Thanks @erichkeane. SPIR-V diagnostics seem to work fine. There are a few cases that are not handled, so I submitted D109315 to review them separately. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-06-16 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. This seems to do a lot of work that I think already exists, I believe I've seen that SPIRV targets already prohibit long-double, so doing another implementation specifically for x86 seems like the wrong approach. I'd suggest seeing if the SPIRV version works for

[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-06-16 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. @erichkeane, can you please check if this patch is OK for Clang? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98895/new/ https://reviews.llvm.org/D98895 ___ cfe-commits

[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-05-27 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei accepted this revision. pengfei added a comment. This revision is now accepted and ready to land. LGTM. But let's wait one or more days to see if others have more comments. Comment at: clang/lib/Sema/SemaChecking.cpp:4762 + + for (ParmVarDecl *Param :

[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-05-27 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic updated this revision to Diff 348219. asavonic added a comment. - Disabled double or float return for x86 targets - Refactored checks into a separate function. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98895/new/

[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-05-25 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: clang/test/Sema/x86-no-x87.c:2 +// RUN: %clang_cc1 -fsyntax-only -verify %s -triple x86_64-linux-gnu -target-feature -x87 +// RUN: %clang_cc1 -fsyntax-only -verify %s -triple i686-linux-gnu -target-feature -x87 +// RUN: %clang_cc1

[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-05-25 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added inline comments. Comment at: clang/test/Sema/x86-no-x87.c:2 +// RUN: %clang_cc1 -fsyntax-only -verify %s -triple x86_64-linux-gnu -target-feature -x87 +// RUN: %clang_cc1 -fsyntax-only -verify %s -triple i686-linux-gnu -target-feature -x87 +// RUN: %clang_cc1

[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-05-25 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: clang/test/Sema/x86-no-x87.c:2 +// RUN: %clang_cc1 -fsyntax-only -verify %s -triple x86_64-linux-gnu -target-feature -x87 +// RUN: %clang_cc1 -fsyntax-only -verify %s -triple i686-linux-gnu -target-feature -x87 +// RUN: %clang_cc1

[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-05-24 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic updated this revision to Diff 347443. asavonic added a comment. Added LIT run lines for i686 and windows targets. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98895/new/ https://reviews.llvm.org/D98895 Files:

[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-05-24 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added inline comments. Comment at: clang/test/Sema/x86-no-x87.c:48-61 +void assign2() { + struct st_long_double st; +#ifndef NOERROR + // expected-error@+2{{long double is not supported on this target}} +#endif + st.ld = 0.42; +} pengfei wrote: >

[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-05-19 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: clang/test/Sema/x86-no-x87.c:48-61 +void assign2() { + struct st_long_double st; +#ifndef NOERROR + // expected-error@+2{{long double is not supported on this target}} +#endif + st.ld = 0.42; +} asavonic wrote: >

[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-05-19 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added inline comments. Comment at: clang/test/Sema/x86-no-x87.c:48-61 +void assign2() { + struct st_long_double st; +#ifndef NOERROR + // expected-error@+2{{long double is not supported on this target}} +#endif + st.ld = 0.42; +} pengfei wrote: >

[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-05-18 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: clang/test/Sema/x86-no-x87.c:48-61 +void assign2() { + struct st_long_double st; +#ifndef NOERROR + // expected-error@+2{{long double is not supported on this target}} +#endif + st.ld = 0.42; +} These seems pass with

[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-05-18 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98895/new/ https://reviews.llvm.org/D98895 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-04-26 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. The option was added in D19658 and D13979 , but I'm not sure how it is supposed to work for SystemV ABI. GCC emits an error if long double type is used with -mno-x87: "test.c:37:1: error: x87 register

[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-03-18 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. I'm not sure that this is the right approach, but I wanted to get feedback on how the issue should be fixed. Currently, the compiler crashes on almost any code with `long double` (excluding cases where CG does not properly disable x87): long double foo(long double x,

[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-03-18 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic created this revision. asavonic added a reviewer: andrew.w.kaylor. Herald added a subscriber: pengfei. asavonic requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This patch attempts to fix a compiler crash that occurs when `long