[RFC PATCH 0/8] Alternative softfloat 128-bit integer support

matheus.ferst@eldorado.org.br posted 8 patches 3 years, 10 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220330175932.6995-1-matheus.ferst@eldorado.org.br
Maintainers: Aurelien Jarno <aurelien@aurel32.net>, Peter Maydell <peter.maydell@linaro.org>, "Alex Bennée" <alex.bennee@linaro.org>, "Cédric Le Goater" <clg@kaod.org>, Daniel Henrique Barboza <danielhb413@gmail.com>, David Gibson <david@gibson.dropbear.id.au>, Greg Kurz <groug@kaod.org>
fpu/softfloat.c                     | 183 ++++++++++++++++++++++++++++
include/fpu/softfloat.h             |   7 ++
include/qemu/int128.h               |  25 +++-
target/ppc/fpu_helper.c             |  33 +++++
target/ppc/helper.h                 |   4 +
target/ppc/insn32.decode            |   7 ++
target/ppc/translate/vsx-impl.c.inc |  22 ++++
tests/unit/test-int128.c            |  32 +++++
8 files changed, 311 insertions(+), 2 deletions(-)
[RFC PATCH 0/8] Alternative softfloat 128-bit integer support
Posted by matheus.ferst@eldorado.org.br 3 years, 10 months ago
From: Matheus Ferst <matheus.ferst@eldorado.org.br>

This RFC is an alternative to [1] using Int128 types to implement the
128-bit integer conversion routines in softfloat required by the
xscv[su]qqp and xscvqp[su]qz instructions of PowerISA v3.1.

Some improvements to int128.h are made in patches 1 and 2. Patches 3-6
implement the conversion routines, and patches 7 and 8 implement the new
instructions.

RFC: Int128 vs. pair of 64-bit values.
 - Returning unsigned values through Int128 is not ideal, but creating
   an "UInt128" just for this case seems excessive.
 - OTOH, there are fewer cases to handle, especially in float->int.

[1] https://lists.gnu.org/archive/html/qemu-ppc/2022-03/msg00520.html

Matheus Ferst (8):
  qemu/int128: avoid undefined behavior in int128_lshift
  qemu/int128: add int128_urshift
  softfloat: add uint128_to_float128
  softfloat: add int128_to_float128
  softfloat: add float128_to_uint128
  softfloat: add float128_to_int128
  target/ppc: implement xscv[su]qqp
  target/ppc: implement xscvqp[su]qz

 fpu/softfloat.c                     | 183 ++++++++++++++++++++++++++++
 include/fpu/softfloat.h             |   7 ++
 include/qemu/int128.h               |  25 +++-
 target/ppc/fpu_helper.c             |  33 +++++
 target/ppc/helper.h                 |   4 +
 target/ppc/insn32.decode            |   7 ++
 target/ppc/translate/vsx-impl.c.inc |  22 ++++
 tests/unit/test-int128.c            |  32 +++++
 8 files changed, 311 insertions(+), 2 deletions(-)

-- 
2.25.1
Re: [RFC PATCH 0/8] Alternative softfloat 128-bit integer support
Posted by Daniel Henrique Barboza 3 years, 9 months ago
All patches but patch 01 queued in gitlab.com/danielhb/qemu/tree/ppc-next.


Thanks,


Daniel

On 3/30/22 14:59, matheus.ferst@eldorado.org.br wrote:
> From: Matheus Ferst <matheus.ferst@eldorado.org.br>
> 
> This RFC is an alternative to [1] using Int128 types to implement the
> 128-bit integer conversion routines in softfloat required by the
> xscv[su]qqp and xscvqp[su]qz instructions of PowerISA v3.1.
> 
> Some improvements to int128.h are made in patches 1 and 2. Patches 3-6
> implement the conversion routines, and patches 7 and 8 implement the new
> instructions.
> 
> RFC: Int128 vs. pair of 64-bit values.
>   - Returning unsigned values through Int128 is not ideal, but creating
>     an "UInt128" just for this case seems excessive.
>   - OTOH, there are fewer cases to handle, especially in float->int.
> 
> [1] https://lists.gnu.org/archive/html/qemu-ppc/2022-03/msg00520.html
> 
> Matheus Ferst (8):
>    qemu/int128: avoid undefined behavior in int128_lshift
>    qemu/int128: add int128_urshift
>    softfloat: add uint128_to_float128
>    softfloat: add int128_to_float128
>    softfloat: add float128_to_uint128
>    softfloat: add float128_to_int128
>    target/ppc: implement xscv[su]qqp
>    target/ppc: implement xscvqp[su]qz
> 
>   fpu/softfloat.c                     | 183 ++++++++++++++++++++++++++++
>   include/fpu/softfloat.h             |   7 ++
>   include/qemu/int128.h               |  25 +++-
>   target/ppc/fpu_helper.c             |  33 +++++
>   target/ppc/helper.h                 |   4 +
>   target/ppc/insn32.decode            |   7 ++
>   target/ppc/translate/vsx-impl.c.inc |  22 ++++
>   tests/unit/test-int128.c            |  32 +++++
>   8 files changed, 311 insertions(+), 2 deletions(-)
>