qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Illegal instruction reported by qemu-ppc with -cpu 7400


From: Matheus K. Ferst
Subject: Re: Illegal instruction reported by qemu-ppc with -cpu 7400
Date: Mon, 14 Mar 2022 09:34:18 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

On 12/03/2022 23:51, Khem Raj wrote:
Hi All

I have built an app with musl C library for ppc32 using clang 14.0.0
and I am using -mcpu=7400 to compile the whole thing including musl.
This fails to run on qemu usermode reporting illegal instruction, a
bit of digging revealed that it's caused by opcode in strspn()
function from musl where clang is emitting vxor instruction and that's
where qemu ppc bails out.

Here is asm file generated by clang

https://paste.debian.net/1233982/

gcc ( 11.2 )

https://paste.debian.net/1233983/

As you can see the disassembly for gcc does not have vxor or any other
altivec instructions in it.
When I add -mno-altivec to clang then the issue is gone or when I use
-mcpu=power5 the issue is gone too.

This is preprocessed strspn.i
https://paste.debian.net/1233987/

I wonder if qemu-ppc -mcpu 7400 should have understood vxor instruction or not ?

Hi Khem,

A quick test suggests that vxor is working with -cpu 7400:
$ cat > vxor.c << EOF
int main(void)
{
    asm volatile ("vxor 2, 2, 2\n\t" ::: "v2");
    return 0;
}
EOF
$ powerpc64-linux-gnu-gcc -m32 -mcpu=7400 vxor.c -o vxor -static
$ qemu-ppc -cpu 7400 vxor
$ echo $?
0

Can you show us the command line you used? What version of QEMU are you running?

--
Matheus K. Ferst
Instituto de Pesquisas ELDORADO <http://www.eldorado.org.br/>
Analista de Software
Aviso Legal - Disclaimer <https://www.eldorado.org.br/disclaimer.html>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]