qemu-discuss
[Top][All Lists]
Advanced

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

Re: MIPS MSA instructions result in SIGILL


From: Philippe Mathieu-Daudé
Subject: Re: MIPS MSA instructions result in SIGILL
Date: Thu, 17 Jun 2021 19:35:31 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1

Hi Evan,

On 6/11/21 5:48 PM, Evan Nemerson wrote:
> I'm trying to find a way to run MSA code using QEMU.  I've been able to
> get *some* MSA instructions to execute on Loongson-3A4000, but
> eventually I get a SIGILL.
> 
> I have access to the source code, and I don't really care what CPU I'm
> targeting as long as it supports MSA, but I've had the most luck with
> GCC targeting mips64el.  The goal is actually to add an implementation
> of MSA to SIMDe (<https://github.com/simd-everywhere/simde>), but I
> need to be able to verify that I'm getting the same results as a
> different implementation, and since I don't have any MIPS hardware that
> means QEMU :)
> 
> As an example of some failing code, I've compiled one of our tests
> (https://github.com/simd-everywhere/simde/blob/master/test/arm/neon/add.c
> ) and uploaded an executable to
> https://www.dropbox.com/s/skhfxi7ki0zozra/add-native-c?dl=0
> 
> It's compiled with:
> 
> mips64el-linux-gnuabi64-gcc-10 -DSIMDE_TEST_BARE -g -mmsa -static \
>   -o add-native-c path/to/add.c -lm
> 
> If you want to try changing compilation options, here is the
> amalgamated (not preprocessed, so it should work with clang too) source
> code: https://www.dropbox.com/s/0jf8cs6cmzhjn13/add.c?dl=0
> 
> 
> Attempting to run it with qemu (5.2.0, from Debian):
> 
>    qemu-mips64el-static -cpu Loongson-3A4000 ./add-native-c1..22
>    ok 1 add/vaddd_s64
>    ok 2 add/vaddd_u64
>    ok 3 add/vadd_f32
>    ok 4 add/vadd_f64
>    ok 5 add/vadd_s8
>    ok 6 add/vadd_s16
>    ok 7 add/vadd_s32
>    ok 8 add/vadd_s64
>    ok 9 add/vadd_u8
>    ok 10 add/vadd_u16
>    ok 11 add/vadd_u32
>    ok 12 add/vadd_u64
>    qemu: uncaught target signal 4 (Illegal instruction) - core dumped
>    Illegal instruction (core dumped)
> 
> If I add -d in_asm, I see it crashes on ld.b, which is indeed an MSA
> instruction.
> 
> I've tried with every -cpu supported by qemu, and nothing has worked. 
> Any help would be greatly appreciated; FWIW, I'm definitely open to
> compiling a patched QEMU if it would help.

Thanks for opening the GitLab issue #422

I missed your mail because I was only filtering "mips" on
qemu-devel@nongnu.org, not qemu-discuss@.

I'll follow up on the GitLab issue:
https://gitlab.com/qemu-project/qemu/-/issues/422

Regards,

Phil.



reply via email to

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