-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[SPARC] Properly handle CC for long double on sparc32 #162226
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
Changes from 16 commits
ff3ad98
84b1b6d
0c673ae
aee2895
f62d4df
b283fee
8724a59
5e8aa4a
f9ed024
ff6e10e
e38af2a
cb69bc6
34bfc88
69e93a8
16391d0
2481bb8
5b13c01
e383d75
291824c
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 |
|---|---|---|
| @@ -1,22 +1,52 @@ | ||
| // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --filter "^define |^entry:" --version 6 | ||
| // RUN: %clang_cc1 -triple sparc-unknown-unknown -emit-llvm %s -o - | FileCheck %s | ||
|
|
||
| // CHECK-LABEL: define{{.*}} { float, float } @p(ptr noundef byval({ float, float }) align 4 %a, ptr noundef byval({ float, float }) align 4 %b) #0 { | ||
| float __complex__ | ||
| // CHECK-LABEL: define dso_local { float, float } @p( | ||
| // CHECK-SAME: ptr noundef byval({ float, float }) align 4 [[A:%.*]], ptr noundef byval({ float, float }) align 4 [[B:%.*]]) #[[ATTR0:[0-9]+]] { | ||
| // CHECK: [[ENTRY:.*:]] | ||
| // | ||
| p (float __complex__ a, float __complex__ b) | ||
| { | ||
| return 0; | ||
| } | ||
|
|
||
| // CHECK-LABEL: define{{.*}} { double, double } @q(ptr noundef byval({ double, double }) align 8 %a, ptr noundef byval({ double, double }) align 8 %b) #0 { | ||
| double __complex__ | ||
| // CHECK-LABEL: define dso_local { double, double } @q( | ||
| // CHECK-SAME: ptr noundef byval({ double, double }) align 8 [[A:%.*]], ptr noundef byval({ double, double }) align 8 [[B:%.*]]) #[[ATTR0]] { | ||
| // CHECK: [[ENTRY:.*:]] | ||
| // | ||
| q (double __complex__ a, double __complex__ b) | ||
| { | ||
| return 0; | ||
| } | ||
|
|
||
| // CHECK-LABEL: define{{.*}} { i64, i64 } @r(ptr noundef byval({ i64, i64 }) align 8 %a, ptr noundef byval({ i64, i64 }) align 8 %b) #0 { | ||
| long long __complex__ | ||
| // CHECK-LABEL: define dso_local { i64, i64 } @r( | ||
| // CHECK-SAME: ptr noundef byval({ i64, i64 }) align 8 [[A:%.*]], ptr noundef byval({ i64, i64 }) align 8 [[B:%.*]]) #[[ATTR0]] { | ||
| // CHECK: [[ENTRY:.*:]] | ||
| // | ||
| r (long long __complex__ a, long long __complex__ b) | ||
| { | ||
| return 0; | ||
| } | ||
|
|
||
| long double | ||
| // CHECK-LABEL: define dso_local void @s( | ||
| // CHECK-SAME: ptr dead_on_unwind noalias writable sret(fp128) align 8 [[AGG_RESULT:%.*]], ptr noundef byval(fp128) align 8 [[TMP0:%.*]]) #[[ATTR0]] { | ||
| // CHECK: [[ENTRY:.*:]] | ||
| // | ||
| s(long double a) | ||
| { | ||
| return 0; | ||
| } | ||
s-barannikov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| long double _Complex | ||
| // CHECK-LABEL: define dso_local inreg { fp128, fp128 } @t( | ||
| // CHECK-SAME: ptr noundef byval({ fp128, fp128 }) align 8 [[A:%.*]]) #[[ATTR0]] { | ||
| // CHECK: [[ENTRY:.*:]] | ||
| // | ||
| t(long double _Complex a) | ||
| { | ||
| return 0; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1009,9 +1009,9 @@ else () | |
| list(APPEND BUILTIN_CFLAGS_${arch} -fomit-frame-pointer -DCOMPILER_RT_ARMHF_TARGET) | ||
| endif() | ||
|
|
||
| # For RISCV32, we must force enable int128 for compiling long | ||
| # For RISCV32 and 32-bit SPARC, we must force enable int128 for compiling long | ||
| # double routines. | ||
| if(COMPILER_RT_ENABLE_SOFTWARE_INT128 OR "${arch}" STREQUAL "riscv32") | ||
| if(COMPILER_RT_ENABLE_SOFTWARE_INT128 OR "${arch}" STREQUAL "riscv32" OR ("${arch}" STREQUAL "sparc" AND NOT CMAKE_COMPILER_IS_GNUCC)) | ||
|
||
| list(APPEND BUILTIN_CFLAGS_${arch} -fforce-enable-int128) | ||
| endif() | ||
|
|
||
|
|
||
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.
You probably also need to fix the datalayout
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.
It already has the
f128:64part, so I think I'm good here?