<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/54960>54960</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
"-mlongcall" is not effective in ppc64
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
UmeshKalappa0
</td>
</tr>
</table>
<pre>
For the following code ,
#include<stdlib.h>
#include<math.h>
int callcos(int loops)
{
int i;
double x = 0.0;
for (i = 0; i < loops; ++i) {
x += cos(2.44);
printf("Test ");
}
return(x < 100.4);
}
and command-line used
/folk/prj-rust-dev/umesh/latest_vxworks/vxworks_22.06/compilers/llvm-12.0.1.2/LINUX64/bin/clang -mcpu=e6500 -mno-altivec -D_VX_CPU=_VX_PPCE6500 -mlong-double-64 -mhard-float -mabi=elfv2 -D__ppc -D__ppc__ -m64 -D__ppc64__ --target=ppc64 -mcmodel=medium -fno-strict-aliasing -ftls-model=local-exec -fno-builtin -fno-unwind-tables -fno-asynchronous-unwind-tables -nostdlibinc -nostdinc++ -Wno-unused-command-line-argument -mlongcall -S
call to cos was relatively even used "-mlongcall". like
addis 3, 2, .LCPI0_2@toc@ha
lfd 1, .LCPI0_2@toc@l(3)
bl cos
nop
and not the case for printf like
addis 3, 2, .L.str@toc@ha
addi 3, 3, .L.str@toc@l
addis 4, 2, .LC0@toc@ha
ld 4, .LC0@toc@l(4)
mr 12, 4
mtctr 4
bctrl
We think its the llvm issue (inconsistent) and needs to be fixed .
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx1VFuP2yoQ_jXOC8LC-NLkwQ9t0kjVqY5WOmdP-xZhg2O6GCzA2ey_PwN2Nsk2jSLDXBg-Zr6ZxvC3em8s8r1AnVHKvEp9RK3hAiV0m5BdQj4vX5pL3aqJiyTfOs-VbNI-yb8-sA7M9zc2qT1qmVKtcQldB0kZM8J-s5z99GXeIPg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