From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:44598) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gk2K2-0001qY-SU for qemu-devel@nongnu.org; Thu, 17 Jan 2019 02:42:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gk2K1-0001Cr-UP for qemu-devel@nongnu.org; Thu, 17 Jan 2019 02:42:42 -0500 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:35112) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gk2K1-00010Z-Ot for qemu-devel@nongnu.org; Thu, 17 Jan 2019 02:42:41 -0500 Received: by mail-wm1-x341.google.com with SMTP id t200so4661985wmt.0 for ; Wed, 16 Jan 2019 23:42:25 -0800 (PST) References: <30917d5b-f8cb-e799-6c3e-3202195122b4@redhat.com> <871s5fp54s.fsf@linaro.org> <87zhs3nk1m.fsf@linaro.org> <87y37monyr.fsf@linaro.org> <87won6nfl1.fsf@linaro.org> <6cb80b50-0352-430e-0c46-85ed69f95c88@redhat.com> <87va2poqoz.fsf@linaro.org> <20190115200527.GB7844@flamenco> <479044cb-345a-0faa-795a-f67da0077198@redhat.com> <87a7k0zg0s.fsf@linaro.org> <26dad243-d1cf-6705-c8eb-ff329590d272@redhat.com> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <26dad243-d1cf-6705-c8eb-ff329590d272@redhat.com> Date: Thu, 17 Jan 2019 07:42:22 +0000 Message-ID: <877ef3zq5d.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] include/fpu/softfloat: Fix compilation with Clang on s390x List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth Cc: "Emilio G. Cota" , Peter Maydell , Cornelia Huck , QEMU Developers , qemu-s390x , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Aurelien Jarno , Richard Henderson Thomas Huth writes: > On 2019-01-16 18:08, Alex Benn=C3=A9e wrote: >> >> Thomas Huth writes: >> >>> On 2019-01-15 21:05, Emilio G. Cota wrote: >>>> On Tue, Jan 15, 2019 at 16:01:32 +0000, Alex Benn=C3=A9e wrote: >>>>> Ahh I should have mentioned we already have the technology for this ;= -) >>>>> >>>>> If you build the fpu/next tree on a s390x you can then run: >>>>> >>>>> ./tests/fp/fp-bench f64_div >>>>> >>>>> with and without the CONFIG_128 path. To get an idea of the real world >>>>> impact you can compile a foreign binary and run it on a s390x system >>>>> with: >>>>> >>>>> $QEMU ./tests/fp/fp-bench f64_div -t host >>>>> >>>>> And that will give you the peak performance assuming your program is >>>>> doing nothing but f64_div operations. If the two QEMU's are basically= in >>>>> the same ballpark then it doesn't make enough difference. That said: >>>> >>>> I think you mean here `tests/fp/fp-bench -o div -p double', otherwise >>>> you'll get the default op (-o add). >>> >>> I tried that now, too, and -o div -p double does not really seem to >>> exercise this function at all. >> >> How do you mean? It should do because by default it should be calling >> the softfloat implementations. > > I've added a puts("hello") into the udiv_qrnd() function. When I then > run "fp-bench -o div -p double", it only prints out "hello" a single > time, so the function is only called once during the whole test. That's very odd. With the following on my aarch64 box: modified include/fpu/softfloat-macros.h @@ -637,6 +637,8 @@ static inline uint64_t estimateDiv128To64(uint64_t a0, = uint64_t a1, uint64_t b) static inline uint64_t udiv_qrnnd(uint64_t *r, uint64_t n1, uint64_t n0, uint64_t d) { + static int iter =3D 0; + fprintf(stderr, "%s: %d\n", __func__, iter++); #if defined(__x86_64__) uint64_t q; asm("divq %4" : "=3Da"(q), "=3Dd"(*r) : "0"(n0), "1"(n1), "rm"(d)); I get: udiv_qrnnd: 0 udiv_qrnnd: 1 .. .. udiv_qrnnd: 99998 udiv_qrnnd: 99999 So I'm not sure what is different on s390 -- Alex Benn=C3=A9e