Skip to content

target/s390x: Fix emulation of C(G)HRL

Nina Schoetterl-Glausch qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 2 repliesIn review
  2. v22 patches 4 repliesSuperseded
  3. v12 patches 2 repliesSuperseded

Changes in v3 from the cover letter

* pick up R-b's (thanks Richard)
* get rid of tabs in inline asm (cosmetic only)

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2target/s390x: Fix emulation of C(G)HRLtarget/s390x/tcg/insn-data.h.inc target/s390x/tcg/translate.c+9 -21 reply
2/2tests/tcg/s390x: Add C(G)HRL testtests/tcg/s390x/Makefile.target tests/tcg/s390x/chrl.c+81 -01 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchRichard HendersonDavid Hildenbrand
1/2R-b R-b
2/2R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/2] target/s390x: Fix emulation of C(G)HRL

The second operand of COMPARE HALFWORD RELATIVE LONG is a signed halfword, it does not have the same size as the first operand. Fix this and add a tcg test for c(g)hrl.

v2 -> v3
* pick up R-b's (thanks Richard)
* get rid of tabs in inline asm (cosmetic only)

v1 -> v2
* rebase on newer version

Nina Schoetterl-Glausch (2):
target/s390x: Fix emulation of C(G)HRL
tests/tcg/s390x: Add C(G)HRL test

 target/s390x/tcg/insn-data.h.inc |  4 +-
 target/s390x/tcg/translate.c     |  7 +++
 tests/tcg/s390x/chrl.c           | 80 ++++++++++++++++++++++++++++++++
 tests/tcg/s390x/Makefile.target  |  1 +
 4 files changed, 90 insertions(+), 2 deletions(-)
 create mode 100644 tests/tcg/s390x/chrl.c

Range-diff against v2:
1: 228a1d9cfb ! 1: 899db74823 target/s390x: Fix emulation of C(G)HRL
@@ Commit message
halfword, it does not have the same size as the first operand.

Fixes a7e836d5eb ("target-s390: Convert COMPARE, COMPARE LOGICAL")

+ Reviewed-by: Richard Henderson <[email protected]>

## target/s390x/tcg/insn-data.h.inc ##
2: 3b1ca6b682 ! 2: 30868c4692 tests/tcg/s390x: Add C(G)HRL test

    @@ Commit message
         instruction.
         Test the sign extension performed on the second operand.
     
    +    Reviewed-by: Richard Henderson <[email protected]>
         Signed-off-by: Nina Schoetterl-Glausch <[email protected]>
     
      ## tests/tcg/s390x/chrl.c (new) ##
    @@ tests/tcg/s390x/chrl.c (new)
     +    uint32_t program_mask, cc;
     +
     +    asm volatile (
    -+               ".pushsection .rodata\n"
    -+        "0:	.short	1,0x8000\n"
    -+        "	.popsection\n"
    ++        ".pushsection .rodata\n"
    ++        "0:\n\t"
    ++        ".short 1, 0x8000\n\t"
    ++        ".popsection\n\t"
     +
    -+        "	chrl	%[r],0b\n"
    -+        "	ipm	%[program_mask]\n"
    ++        "chrl %[r], 0b\n\t"
    ++        "ipm %[program_mask]\n"
     +        : [program_mask] "=r" (program_mask)
     +        : [r] "r" (1)
     +    );
    @@ tests/tcg/s390x/chrl.c (new)
     +    assert(!cc);
     +
     +    asm volatile (
    -+               ".pushsection .rodata\n"
    -+        "0:	.short	-1,0x8000\n"
    -+        "	.popsection\n"
    ++        ".pushsection .rodata\n"
    ++        "0:\n\t"
    ++        ".short -1, 0x8000\n\t"
    ++        ".popsection\n\t"
     +
    -+        "	chrl	%[r],0b\n"
    -+        "	ipm	%[program_mask]\n"
    ++        "chrl %[r], 0b\n\t"
    ++        "ipm %[program_mask]\n"
     +        : [program_mask] "=r" (program_mask)
     +        : [r] "r" (-1)
     +    );
    @@ tests/tcg/s390x/chrl.c (new)
     +    uint32_t program_mask, cc;
     +
     +    asm volatile (
    -+               ".pushsection .rodata\n"
    -+        "0:	.short	1,0x8000,0,0\n"
    -+        "	.popsection\n"
    ++        ".pushsection .rodata\n"
    ++        "0:\n\t"
    ++        ".short 1, 0x8000, 0, 0\n\t"
    ++        ".popsection\n\t"
     +
    -+        "	cghrl	%[r],0b\n"
    -+        "	ipm	%[program_mask]\n"
    ++        "cghrl %[r], 0b\n\t"
    ++        "ipm %[program_mask]\n"
     +        : [program_mask] "=r" (program_mask)
     +        : [r] "r" (1L)
     +    );
    @@ tests/tcg/s390x/chrl.c (new)
     +    assert(!cc);
     +
     +    asm volatile (
    -+               ".pushsection .rodata\n"
    -+        "0:	.short	-1,0x8000,0,0\n"
    -+        "	.popsection\n"
    ++        ".pushsection .rodata\n"
    ++        "0:\n\t"
    ++        ".short -1, 0x8000, 0, 0\n\t"
    ++        ".popsection\n\t"
     +
    -+        "	cghrl	%[r],0b\n"
    -+        "	ipm	%[program_mask]\n"
    ++        "cghrl %[r], 0b\n\t"
    ++        "ipm %[program_mask]\n"
     +        : [program_mask] "=r" (program_mask)
     +        : [r] "r" (-1L)
     +    );

base-commit: 15002921e878e6cf485f655d580733b5319ea015

Signature · 1 line
2.39.1