]> Git Repo - qemu.git/commitdiff
softfloat: Specialize udiv_qrnnd for s390x
authorRichard Henderson <[email protected]>
Wed, 3 Oct 2018 16:34:25 +0000 (11:34 -0500)
committerRichard Henderson <[email protected]>
Fri, 5 Oct 2018 17:57:41 +0000 (12:57 -0500)
The ISA has a 128/64-bit division instruction.

Reviewed-by: David Hildenbrand <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
include/fpu/softfloat-macros.h

index 39eb08b4f18fce64a6c893e1bf454ce9e3d16006..eafc68932b85999696012bf8cdf13c1cd4f4b2f1 100644 (file)
@@ -641,6 +641,12 @@ static inline uint64_t udiv_qrnnd(uint64_t *r, uint64_t n1,
     uint64_t q;
     asm("divq %4" : "=a"(q), "=d"(*r) : "0"(n0), "1"(n1), "rm"(d));
     return q;
+#elif defined(__s390x__)
+    /* Need to use a TImode type to get an even register pair for DLGR.  */
+    unsigned __int128 n = (unsigned __int128)n1 << 64 | n0;
+    asm("dlgr %0, %1" : "+r"(n) : "r"(d));
+    *r = n >> 64;
+    return n;
 #else
     uint64_t d0, d1, q0, q1, r1, r0, m;
 
This page took 0.021975 seconds and 4 git commands to generate.