Skip to contentSkip to conversation

target/s390x: Finish implementing RISBGN

PATCH Applied Richard Henderson 4 participants 6 messages Nov 7, 2017 – Nov 9, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/s390x: Finish implementing RISBGN

We added the entry to insn-data.def, but failed to update op_risbg to match. No need to special-case the imask inversion, since that is already ~0 for RISBG (and now RISBGN).

Fixes 375ee58bedcda359011fe7fa99e0647f66f9ffa0
---
 target/s390x/translate.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
target/s390x/translate.c +3 -6
index dee72a787d..85d0a6c3af 100644
@@ -3432,6 +3432,7 @@ static ExitStatus op_risbg(DisasContext *s, DisasOps *o)
     /* Adjust the arguments for the specific insn.  */
     switch (s->fields->op2) {
     case 0x55: /* risbg */
+    case 0x59: /* risbgn */
         i3 &= 63;
         i4 &= 63;
         pmask = ~0;
@@ -3447,7 +3448,7 @@ static ExitStatus op_risbg(DisasContext *s, DisasOps *o)
         pmask = 0x00000000ffffffffull;
         break;
     default:
-        abort();
+        g_assert_not_reached();
     }
 
     /* MASK is the set of bits to be inserted from R2.
@@ -3464,11 +3465,7 @@ static ExitStatus op_risbg(DisasContext *s, DisasOps *o)
        insns, we need to keep the other half of the register.  */
     imask = ~mask | ~pmask;
     if (do_zero) {
-        if (s->fields->op2 == 0x55) {
-            imask = 0;
-        } else {
-            imask = ~pmask;
-        }
+        imask = ~pmask;
     }
 
     len = i4 - i3 + 1;
Signature · 1 line
2.13.6
Reviewed-by on v1 1/1
#1 lore raw
Quoted 36 lines · Richard Henderson

We added the entry to insn-data.def, but failed to update op_risbg to match. No need to special-case the imask inversion, since that is already ~0 for RISBG (and now RISBGN).

Fixes 375ee58bedcda359011fe7fa99e0647f66f9ffa0
---
 target/s390x/translate.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
target/s390x/translate.c +2 -1
index dee72a787d..85d0a6c3af 100644
@@ -3432,6 +3432,7 @@ static ExitStatus op_risbg(DisasContext *s, DisasOps *o)
     /* Adjust the arguments for the specific insn.  */
     switch (s->fields->op2) {
     case 0x55: /* risbg */
+    case 0x59: /* risbgn */
         i3 &= 63;
         i4 &= 63;
         pmask = ~0;
@@ -3447,7 +3448,7 @@ static ExitStatus op_risbg(DisasContext *s, DisasOps *o)
         pmask = 0x00000000ffffffffull;
         break;
     default:
-        abort();
+        g_assert_not_reached();
     }
 
     /* MASK is the set of bits to be inserted from R2.
@@ -3464,11 +3465,7 @@ static ExitStatus op_risbg(DisasContext *s, DisasOps *o)
        insns, we need to keep the other half of the register.  */
     imask = ~mask | ~pmask;

target/s390x/translate.c static ExitStatus op_risbg(DisasContext *s, DisasOps *o) · line 3471

Quoted 10 lines
target/s390x/translate.c +1 -5
     if (do_zero) {
-        if (s->fields->op2 == 0x55) {
-            imask = 0;
-        } else {
-            imask = ~pmask;
-        }
+        imask = ~pmask;
     }
 
     len = i4 - i3 + 1;

Looks good.

Tested-by
#2 lore raw
Quoted 45 lines · Thomas Huth
Quoted 44 lines · Richard Henderson

We added the entry to insn-data.def, but failed to update op_risbg to match. No need to special-case the imask inversion, since that is already ~0 for RISBG (and now RISBGN).

Fixes 375ee58bedcda359011fe7fa99e0647f66f9ffa0
---
 target/s390x/translate.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
target/s390x/translate.c +3 -6
index dee72a787d..85d0a6c3af 100644
@@ -3432,6 +3432,7 @@ static ExitStatus op_risbg(DisasContext *s, DisasOps *o)
     /* Adjust the arguments for the specific insn.  */
     switch (s->fields->op2) {
     case 0x55: /* risbg */
+    case 0x59: /* risbgn */
         i3 &= 63;
         i4 &= 63;
         pmask = ~0;
@@ -3447,7 +3448,7 @@ static ExitStatus op_risbg(DisasContext *s, DisasOps *o)
         pmask = 0x00000000ffffffffull;
         break;
     default:
-        abort();
+        g_assert_not_reached();
     }
 
     /* MASK is the set of bits to be inserted from R2.
@@ -3464,11 +3465,7 @@ static ExitStatus op_risbg(DisasContext *s, DisasOps *o)
        insns, we need to keep the other half of the register.  */
     imask = ~mask | ~pmask;
     if (do_zero) {
-        if (s->fields->op2 == 0x55) {
-            imask = 0;
-        } else {
-            imask = ~pmask;
-        }
+        imask = ~pmask;
     }
 
Quoted 6 lines

target/s390x/translate.c static ExitStatus op_risbg(DisasContext *s, DisasOps *o) · line 3471

Quoted 2 lines
target/s390x/translate.c +0 -0
     len = i4 - i3 + 1;

Looks good.

...at least it fixes the simple test case from the bug report.

-- PMM

#3 lore raw
In reply to Richard Henderson
Quoted 35 lines · On Tue, 7 Nov 2017 15:55:46 +0100 Richard Henderson…

We added the entry to insn-data.def, but failed to update op_risbg to match. No need to special-case the imask inversion, since that is already ~0 for RISBG (and now RISBGN).

Fixes 375ee58bedcda359011fe7fa99e0647f66f9ffa0
---
 target/s390x/translate.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
target/s390x/translate.c +2 -1
index dee72a787d..85d0a6c3af 100644
@@ -3432,6 +3432,7 @@ static ExitStatus op_risbg(DisasContext *s, DisasOps *o)
     /* Adjust the arguments for the specific insn.  */
     switch (s->fields->op2) {
     case 0x55: /* risbg */
+    case 0x59: /* risbgn */
         i3 &= 63;
         i4 &= 63;
         pmask = ~0;
@@ -3447,7 +3448,7 @@ static ExitStatus op_risbg(DisasContext *s, DisasOps *o)
         pmask = 0x00000000ffffffffull;
         break;
     default:
-        abort();
+        g_assert_not_reached();
     }
 
     /* MASK is the set of bits to be inserted from R2.
@@ -3464,11 +3465,7 @@ static ExitStatus op_risbg(DisasContext *s, DisasOps *o)
        insns, we need to keep the other half of the register.  */
     imask = ~mask | ~pmask;

target/s390x/translate.c static ExitStatus op_risbg(DisasContext *s, DisasOps *o) · line 3471

Quoted 10 lines
target/s390x/translate.c +1 -5
     if (do_zero) {
-        if (s->fields->op2 == 0x55) {
-            imask = 0;
-        } else {
-            imask = ~pmask;
-        }
+        imask = ~pmask;
     }
 
     len = i4 - i3 + 1;

I can queue this to s390-fixes (unless there are other takers).

#4 lore raw
Quoted 1 line · Cornelia Huck

I can queue this to s390-fixes (unless there are other takers).

Please do. Thanks,

r~

#5 lore raw
In reply to Richard Henderson
Quoted 10 lines · On Tue, 7 Nov 2017 15:55:46 +0100 Richard Henderson…

We added the entry to insn-data.def, but failed to update op_risbg to match. No need to special-case the imask inversion, since that is already ~0 for RISBG (and now RISBGN).

Fixes 375ee58bedcda359011fe7fa99e0647f66f9ffa0
---
 target/s390x/translate.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

Thanks, applied to s390-fixes.