From: Fredrik Noring <noring@nocrew.org>
To: "Maciej W. Rozycki" <macro@orcam.me.uk>
Cc: "Fam Zheng" <fam@euphon.net>,
"Aleksandar Rikalo" <aleksandar.rikalo@syrmia.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
qemu-devel@nongnu.org, "Thomas Huth" <thuth@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Aurelien Jarno" <aurelien@aurel32.net>,
"Laurent Vivier" <laurent@vivier.eu>
Subject: Re: [RFC PATCH 32/42] docker: Add gentoo-mipsr5900el-cross image
Date: Fri, 12 Mar 2021 19:24:08 +0100 [thread overview]
Message-ID: <YEuxyF9l1LfBLptS@sx9> (raw)
In-Reply-To: <alpine.DEB.2.21.2103121741460.33195@angie.orcam.me.uk>
On Friday, 12 March 2021, Maciej W. Rozycki wrote:
> On Fri, 12 Mar 2021, Philippe Mathieu-Daudé wrote:
>
> > >>> Is there any way we can do this with a distro that isn't Gentoo
> > >>> so that we can get a container build that is fast enough to be
> > >>> useful for CI ?
> >
> > Using the Debian cross image I get:
> >
> > /home/phil/source/qemu/tests/docker/docker.py --engine auto cc --cc
> > mips64el-linux-gnuabi64-gcc -i qemu/debian-mips64el-cross -s
> > /home/phil/source/qemu -- -Wall -Werror -O0 -g -fno-strict-aliasing
> > -mabi=n32 -march=r5900
> > /home/phil/source/qemu/tests/tcg/mips/test-r5900-dmult.c -o
> > test-r5900-dmult -static
> > cc1: error: unsupported combination: -march=r5900 -mhard-float
> > -mdouble-float
> >
> > No clue what is setting '-mhard-float -mdouble-float' yet.
>
> The R5900 has an FPU that only supports the single floating-point format.
> It's also not an IEEE 754 format. The Linux kernel ABI does support the
> double and also the single floating-point format, both compliant with IEEE
> 754.
>
> In the absence of a suitable FPU emulation code included with the kernel
> will handle the missing instructions (you can use the `nofpu' kernel
> parameter to force that in the presence of an FPU too). Beware however
> that a recent change to the Linux kernel made FPU emulation code optional
> to suit some deeply embedded applications known never to use FPU machine
> instructions.
>
> NB the presence of emulation is always required for MIPS ISA compliance
> if FPU machine instructions are ever to be used in a given application,
> because operations are allowed to trap regardless and rely on emulation.
>
> I don't know what you are trying to achieve,
I believe Philippe is trying to compile
https://lists.gnu.org/archive/html/qemu-devel/2021-03/msg04565.html
testing this:
The R5900 reports itself as MIPS III but does not implement DMULT.
Verify that DMULT is emulated properly in user mode by multiplying
two 64-bit numbers to produce a 128-bit number.
with this piece of code (notice the mips3 ISA directive for DMULT):
/*
* Test DMULT.
*/
#include <stdio.h>
#include <inttypes.h>
#include <assert.h>
struct hi_lo { int64_t hi; uint64_t lo; };
static struct hi_lo dmult(int64_t rs, int64_t rt)
{
int64_t hi;
uint64_t lo;
/*
* The R5900 reports itself as MIPS III but does not implement DMULT.
* Verify that DMULT is emulated properly in user mode.
*/
__asm__ __volatile__ (
" .set mips3\n"
" dmult %2, %3\n"
" mfhi %0\n"
" mflo %1\n"
: "=r" (hi), "=r" (lo)
: "r" (rs), "r" (rt));
return (struct hi_lo) { .hi = hi, .lo = lo };
}
int main()
{
/* Verify that multiplying two 64-bit numbers yields a 128-bit number. */
struct hi_lo r = dmult(2760727302517, 5665449960167);
assert(r.hi == 847887);
assert(r.lo == 7893651516417804947);
return 0;
}
> but your two options to choose from are:
>
> 1. Build for the soft-float ABI (`-msoft-float') where any FP calculations
> are compiled such as to be made by the CPU using integer arithmetic.
>
> 2. Build for a generic MIPS ISA, for the R5900/n32 that would be MIPS III
> (`-march=mips3'), and rely on the kernel FPU emulation. Note that some
> integer MIPS III operations are missing too from the R5900 and have to
> be emulated by the kernel for MIPS/Linux n32 psABI compliance (an
> implementation can be pinched from an old libgcc version that was still
> under GNU GPLv2 or another algorithm reused, e.g. my `__div64_32' piece
> easily adapted).
So qemu/tests/tcg/mips/Makefile.target is patched with
# r5900 is only 64 bit little-endian
ifneq ($(findstring 64el,$(TARGET_NAME)),)
MIPS_TESTS += test-r5900-dmult
test-r5900-dmult: CFLAGS += -mabi=n32 -march=r5900
endif
I didn't have issues with the -mhard-float -mdouble-float flags at the time,
and I didn't use mips64el-linux-gnuabi64-gcc for Debian.
Fredrik
next prev parent reply other threads:[~2021-03-12 19:26 UTC|newest]
Thread overview: 102+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-14 17:58 [RFC PATCH 00/42] target/mips: Reintroduce the R5900 CPU (with more testing) Philippe Mathieu-Daudé
2021-02-14 17:58 ` [RFC PATCH 01/42] linux-user/mips64: Restore setup_frame() for o32 ABI Philippe Mathieu-Daudé
2021-02-14 17:58 ` [RFC PATCH 02/42] linux-user/mips64: Support o32 ABI syscalls Philippe Mathieu-Daudé
2021-02-14 17:58 ` [RFC PATCH 03/42] target/mips/translate: Make cpu_HI/LO registers public Philippe Mathieu-Daudé
2021-02-15 16:12 ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 04/42] target/mips: Promote 128-bit multimedia registers as global ones Philippe Mathieu-Daudé
2021-02-15 16:14 ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 05/42] target/mips: Rename 128-bit upper halve GPR registers Philippe Mathieu-Daudé
2021-02-15 16:15 ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 06/42] target/mips: Introduce gen_load_gpr_hi() / gen_store_gpr_hi() helpers Philippe Mathieu-Daudé
2021-02-15 16:15 ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 07/42] target/mips/translate: Use GPR move functions in gen_HILO1_tx79() Philippe Mathieu-Daudé
2021-02-15 16:17 ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 08/42] target/mips/tx79: Move MFHI1 / MFLO1 opcodes to decodetree Philippe Mathieu-Daudé
2021-02-15 16:21 ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 09/42] target/mips/tx79: Move MTHI1 / MTLO1 " Philippe Mathieu-Daudé
2021-02-15 16:23 ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 10/42] target/mips/translate: Simplify PCPYH using deposit_i64() Philippe Mathieu-Daudé
2021-02-15 16:24 ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 11/42] target/mips/tx79: Move PCPYH opcode to decodetree Philippe Mathieu-Daudé
2021-02-15 16:26 ` Richard Henderson
2021-03-08 10:48 ` Philippe Mathieu-Daudé
2021-03-08 11:57 ` Philippe Mathieu-Daudé
2021-03-09 14:25 ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 12/42] target/mips/tx79: Move PCPYLD / PCPYUD opcodes " Philippe Mathieu-Daudé
2021-02-15 16:28 ` Richard Henderson
2021-02-15 16:58 ` Philippe Mathieu-Daudé
2021-02-14 17:58 ` [RFC PATCH 13/42] target/mips: Remove 'C790 Multimedia Instructions' dead code Philippe Mathieu-Daudé
2021-02-15 16:32 ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 14/42] target/mips/tx79: Salvage instructions description comment Philippe Mathieu-Daudé
2021-02-15 16:33 ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 15/42] target/mips/tx79: Introduce PAND/POR/PXOR/PNOR opcodes (parallel logic) Philippe Mathieu-Daudé
2021-02-15 16:35 ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 16/42] target/mips/tx79: Introduce PSUB* opcodes (Parallel Subtract) Philippe Mathieu-Daudé
2021-02-15 16:38 ` Richard Henderson
2021-03-08 18:46 ` Philippe Mathieu-Daudé
2021-02-14 17:58 ` [RFC PATCH 17/42] target/mips/tx79: Introduce PEXTUW (Parallel Extend Upper from Word) Philippe Mathieu-Daudé
2021-02-15 16:44 ` Richard Henderson
2021-03-08 18:40 ` Philippe Mathieu-Daudé
2021-02-14 17:58 ` [RFC PATCH 18/42] target/mips/tx79: Introduce PEXTU[BHW] opcodes (Parallel Extend Lower) Philippe Mathieu-Daudé
2021-02-15 18:28 ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 19/42] target/mips/tx79: Introduce PCEQ* opcodes (Parallel Compare for Equal) Philippe Mathieu-Daudé
2021-02-15 20:32 ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 20/42] target/mips/tx79: Introduce PCGT* (Parallel Compare for Greater Than) Philippe Mathieu-Daudé
2021-02-14 17:58 ` [RFC PATCH 21/42] target/mips/tx79: Introduce PPACW opcode (Parallel Pack to Word) Philippe Mathieu-Daudé
2021-02-15 20:38 ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 22/42] target/mips/tx79: Introduce PINTEH (Parallel Interleave Even Halfword) Philippe Mathieu-Daudé
2021-02-15 20:41 ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 23/42] target/mips/tx79: Introduce PEXE[HW] opcodes (Parallel Exchange Even) Philippe Mathieu-Daudé
2021-02-15 20:45 ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 24/42] target/mips/tx79: Introduce PROT3W opcode (Parallel Rotate 3 Words) Philippe Mathieu-Daudé
2021-02-15 20:49 ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 25/42] target/mips/tx79: Introduce LQ opcode (Load Quadword) Philippe Mathieu-Daudé
2021-02-15 20:51 ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 26/42] target/mips/tx79: Introduce SQ opcode (Store Quadword) Philippe Mathieu-Daudé
2021-02-15 20:51 ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 27/42] target/mips/translate: Make gen_rdhwr() public Philippe Mathieu-Daudé
2021-02-15 20:51 ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 28/42] target/mips/tx79: Move RDHWR usermode kludge to trans_SQ() Philippe Mathieu-Daudé
2021-02-15 21:01 ` Richard Henderson
2021-02-16 7:05 ` Fredrik Noring
2021-02-16 12:21 ` Maciej W. Rozycki
2021-02-16 13:04 ` Fredrik Noring
2021-02-14 17:58 ` [RFC PATCH 29/42] linux-user/mips64: Support the n32 ABI for the R5900 Philippe Mathieu-Daudé
2021-02-15 21:02 ` Richard Henderson
2021-02-14 17:59 ` [RFC PATCH 30/42] target/mips: Reintroduce the R5900 CPU Philippe Mathieu-Daudé
2021-02-15 21:04 ` Richard Henderson
2021-02-14 17:59 ` [RFC PATCH 31/42] default-configs: Support o32 ABI with R5900 64-bit MIPS CPU Philippe Mathieu-Daudé
2021-02-15 21:05 ` Richard Henderson
2021-02-14 17:59 ` [RFC PATCH 32/42] docker: Add gentoo-mipsr5900el-cross image Philippe Mathieu-Daudé
2021-02-15 11:59 ` Daniel P. Berrangé
2021-02-15 13:45 ` Fredrik Noring
2021-02-20 20:01 ` Philippe Mathieu-Daudé
2021-03-12 15:10 ` Philippe Mathieu-Daudé
2021-03-12 17:05 ` Maciej W. Rozycki
2021-03-12 17:46 ` Philippe Mathieu-Daudé
2021-03-12 20:04 ` Maciej W. Rozycki
2021-03-13 7:02 ` Fredrik Noring
2021-03-17 18:55 ` Philippe Mathieu-Daudé
2021-03-17 22:21 ` Maciej W. Rozycki
2021-03-12 18:24 ` Fredrik Noring [this message]
2021-03-12 20:05 ` Philippe Mathieu-Daudé
2021-02-14 17:59 ` [RFC PATCH 33/42] gitlab-ci: Pass optional EXTRA_FILES when building docker images Philippe Mathieu-Daudé
2021-02-14 17:59 ` [RFC PATCH 34/42] gitlab-ci: Build MIPS R5900 cross-toolchain (Gentoo based) Philippe Mathieu-Daudé
2021-02-15 11:42 ` Philippe Mathieu-Daudé
2021-02-15 11:58 ` Daniel P. Berrangé
2021-02-14 17:59 ` [RFC PATCH 35/42] tests/tcg: Add MIPS R5900 to arches filter Philippe Mathieu-Daudé
2021-02-14 17:59 ` [RFC PATCH 36/42] tests/tcg/mips: Test user mode DMULT for the R5900 Philippe Mathieu-Daudé
2021-02-14 17:59 ` [RFC PATCH 37/42] gitlab-ci: Add job to test the MIPS r5900o32el target Philippe Mathieu-Daudé
2021-02-15 5:31 ` Thomas Huth
2021-02-15 8:07 ` Philippe Mathieu-Daudé
2021-02-15 8:11 ` Philippe Mathieu-Daudé
2021-02-14 17:59 ` [RFC PATCH 38/42] tests/acceptance: Extract QemuBaseTest from Test Philippe Mathieu-Daudé
2021-02-14 17:59 ` [RFC PATCH 39/42] tests/acceptance: Make pick_default_qemu_bin() more generic Philippe Mathieu-Daudé
2021-02-14 17:59 ` [RFC PATCH 40/42] tests/acceptance: Introduce QemuUserTest base class Philippe Mathieu-Daudé
2021-02-14 17:59 ` [RFC PATCH 41/42] tests/acceptance: Test R5900 CPU with BusyBox from Sony PS2 Philippe Mathieu-Daudé
2021-02-15 14:28 ` Fredrik Noring
2021-02-15 14:46 ` Maciej W. Rozycki
2021-02-14 17:59 ` [RFC PATCH 42/42] gitlab-ci: Add job to run integration tests for the r5900o32el target Philippe Mathieu-Daudé
2021-02-14 18:08 ` [RFC PATCH 00/42] target/mips: Reintroduce the R5900 CPU (with more testing) Philippe Mathieu-Daudé
2021-02-15 9:24 ` Philippe Mathieu-Daudé
2021-02-21 14:04 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YEuxyF9l1LfBLptS@sx9 \
--to=noring@nocrew.org \
--cc=aleksandar.rikalo@syrmia.com \
--cc=alex.bennee@linaro.org \
--cc=aurelien@aurel32.net \
--cc=berrange@redhat.com \
--cc=f4bug@amsat.org \
--cc=fam@euphon.net \
--cc=laurent@vivier.eu \
--cc=macro@orcam.me.uk \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).