Skip to content

Commit

Permalink
target/s390x: Implement load-and-zero-rightmost-byte insns
Browse files Browse the repository at this point in the history
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
  • Loading branch information
rth7680 committed Jun 23, 2017
1 parent 45aa9aa commit c2a5c1d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions target/s390x/insn-data.def
Expand Up @@ -427,6 +427,11 @@
/* LOAD AND TRAP */
C(0xe39f, LAT, RXY_a, LAT, 0, m2_32u, r1, 0, lat, 0)
C(0xe385, LGAT, RXY_a, LAT, 0, a2, r1, 0, lgat, 0)
/* LOAD AND ZERO RIGHTMOST BYTE */
C(0xe3eb, LZRF, RXY_a, LZRB, 0, m2_32u, new, r1_32, lzrb, 0)
C(0xe32a, LZRG, RXY_a, LZRB, 0, m2_64, r1, 0, lzrb, 0)
/* LOAD LOGICAL AND ZERO RIGHTMOST BYTE */
C(0xe33a, LLZRGF, RXY_a, LZRB, 0, m2_32u, r1, 0, lzrb, 0)
/* LOAD BYTE */
C(0xb926, LBR, RRE, EI, 0, r2_8s, 0, r1_32, mov2, 0)
C(0xb906, LGBR, RRE, EI, 0, r2_8s, 0, r1, mov2, 0)
Expand Down
7 changes: 7 additions & 0 deletions target/s390x/translate.c
Expand Up @@ -2906,6 +2906,12 @@ static ExitStatus op_lurag(DisasContext *s, DisasOps *o)
}
#endif

static ExitStatus op_lzrb(DisasContext *s, DisasOps *o)
{
tcg_gen_andi_i64(o->out, o->in2, -256);
return NO_EXIT;
}

static ExitStatus op_mov2(DisasContext *s, DisasOps *o)
{
o->out = o->in2;
Expand Down Expand Up @@ -5437,6 +5443,7 @@ enum DisasInsnEnum {
#define FAC_LPP S390_FEAT_SET_PROGRAM_PARAMETERS /* load-program-parameter */
#define FAC_DAT_ENH S390_FEAT_DAT_ENH
#define FAC_E2 S390_FEAT_EXTENDED_TRANSLATION_2
#define FAC_LZRB S390_FEAT_STFLE_53 /* load-and-zero-rightmost-byte */

static const DisasInsn insn_info[] = {
#include "insn-data.def"
Expand Down

0 comments on commit c2a5c1d

Please sign in to comment.