在 2023/8/20 下午4:25, Xi Ruoyao 写道:
On Thu, 2023-08-17 at 15:20 +0800, Chenghui Pan wrote:
Seems ARMv8-A only guarantees to preserve low 64-bit value of
NEON/floating-point register value. I'm not sure that I modify the
testcase in the right way and maybe we need more investigations. Any
ideas or suggestion?
Hi, Ruoyao:
The implementation of hook loongarch_hard_regno_call_part_clobbered
results in all vector registers being caller saved registers.
So no data will be lost during the function call.
Sorry, the following sentence in GCC manual section 6.47.5.2 suggests my
test case is not valid:
"As with global register variables, it is recommended that you choose a
register that is normally saved and restored by function calls on your
machine, so that calls to library routines will not clobber it."
So when I use asm(name), the compiler has no obligation to guarantee
that it will ever work like a normal variable after a function call.
But I still need to verify that the compiler correctly understands only
the low 64 bits of the vector register is saved. I'll try to make
another test case...