From: Andreas Arnez Date: Wed, 27 Mar 2024 18:35:43 +0000 (+0100) Subject: s390x: Update tracking of implemented insns for z16 X-Git-Tag: VALGRIND_3_23_0~85 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=901df047ce73b1bf93da77a02f78460025102e1d;p=thirdparty%2Fvalgrind.git s390x: Update tracking of implemented insns for z16 List the instructions first introduced with z16 in s390-opcodes.csv. Also mention the unimplemented ones in guest_s390_toIR.c and add new extended mnemonics to the script s390-check-opcodes.pl. For ease of use, add support for invoking the script without command line arguments. --- diff --git a/VEX/priv/guest_s390_toIR.c b/VEX/priv/guest_s390_toIR.c index ceb4084ace..1f105e9517 100644 --- a/VEX/priv/guest_s390_toIR.c +++ b/VEX/priv/guest_s390_toIR.c @@ -20067,6 +20067,8 @@ s390_decode_4byte_and_irgen(const UChar *bytes) case 0x8000: /* SSM */ goto unimplemented; case 0x8200: /* LPSW */ goto unimplemented; case 0x9300: /* TS */ goto unimplemented; + case 0xb200: /* LBEAR */ goto unimplemented; + case 0xb201: /* STBEAR */ goto unimplemented; case 0xb202: /* STIDP */ goto unimplemented; case 0xb204: /* SCK */ goto unimplemented; case 0xb205: s390_format_S_RD(s390_irgen_STCK, S_b2(ovl), S_d2(ovl)); @@ -20158,6 +20160,7 @@ s390_decode_4byte_and_irgen(const UChar *bytes) case 0xb286: /* QSI */ goto unimplemented; case 0xb287: /* LSCTL */ goto unimplemented; case 0xb28e: /* QCTRI */ goto unimplemented; + case 0xb28f: /* QPACI */ goto unimplemented; case 0xb299: s390_format_S_RD(s390_irgen_SRNM, S_b2(ovl), S_d2(ovl)); goto ok; case 0xb29c: s390_format_S_RD(s390_irgen_STFPC, S_b2(ovl), S_d2(ovl)); @@ -20604,6 +20607,7 @@ s390_decode_4byte_and_irgen(const UChar *bytes) case 0xb938: /* SORTL */ goto unimplemented; case 0xb939: /* DFLTCC */ goto unimplemented; case 0xb93a: /* KDSA */ goto unimplemented; + case 0xb93b: /* NNPA */ goto unimplemented; case 0xb93c: s390_format_RRE_RR(s390_irgen_PPNO, RRE_r1(ovl), RRE_r2(ovl)); goto ok; case 0xb93e: /* KIMD */ goto unimplemented; @@ -20695,6 +20699,7 @@ s390_decode_4byte_and_irgen(const UChar *bytes) case 0xb989: s390_format_RRE_RR(s390_irgen_SLBGR, RRE_r1(ovl), RRE_r2(ovl)); goto ok; case 0xb98a: /* CSPG */ goto unimplemented; + case 0xb98b: /* RDP */ goto unimplemented; case 0xb98d: /* EPSW */ goto unimplemented; case 0xb98e: /* IDTE */ goto unimplemented; case 0xb98f: /* CRDTE */ goto unimplemented; @@ -21521,7 +21526,9 @@ s390_decode_6byte_and_irgen(const UChar *bytes) VRS_rxb(ovl)); goto ok; case 0xe60000000049ULL: /* VLIP */ goto unimplemented; case 0xe60000000050ULL: /* VCVB */ goto unimplemented; + case 0xe60000000051ULL: /* VCLZDP */ goto unimplemented; case 0xe60000000052ULL: /* VCVBG */ goto unimplemented; + case 0xe60000000054ULL: /* VUPKZH */ goto unimplemented; case 0xe60000000055ULL: s390_format_VRRa_VVMM(s390_irgen_VCNF, VRRa_v1(ovl), VRRa_v2(ovl), VRRa_m3(ovl), VRRa_m4(ovl), @@ -21542,8 +21549,11 @@ s390_decode_6byte_and_irgen(const UChar *bytes) case 0xe60000000059ULL: /* VSRP */ goto unimplemented; case 0xe6000000005aULL: /* VCVDG */ goto unimplemented; case 0xe6000000005bULL: /* VPSOP */ goto unimplemented; + case 0xe6000000005cULL: /* VUPKZL */ goto unimplemented; case 0xe6000000005fULL: /* VTP */ goto unimplemented; + case 0xe60000000070ULL: /* VPKZR */ goto unimplemented; case 0xe60000000071ULL: /* VAP */ goto unimplemented; + case 0xe60000000072ULL: /* VSRPR */ goto unimplemented; case 0xe60000000073ULL: /* VSP */ goto unimplemented; case 0xe60000000075ULL: s390_format_VRRa_VVVMM(s390_irgen_VCRNF, VRRa_v1(ovl), VRRa_v2(ovl), @@ -21553,8 +21563,11 @@ s390_decode_6byte_and_irgen(const UChar *bytes) case 0xe60000000077ULL: /* VCP */ goto unimplemented; case 0xe60000000078ULL: /* VMP */ goto unimplemented; case 0xe60000000079ULL: /* VMSP */ goto unimplemented; + case 0xe60000000074ULL: /* VSCHP */ goto unimplemented; case 0xe6000000007aULL: /* VDP */ goto unimplemented; case 0xe6000000007bULL: /* VRP */ goto unimplemented; + case 0xe6000000007cULL: /* VSCSHP */ goto unimplemented; + case 0xe6000000007dULL: /* VCSPH */ goto unimplemented; case 0xe6000000007eULL: /* VSDP */ goto unimplemented; case 0xe70000000000ULL: s390_format_VRX_VRRDM(s390_irgen_VLEB, VRX_v1(ovl), VRX_x2(ovl), VRX_b2(ovl), @@ -22202,6 +22215,7 @@ s390_decode_6byte_and_irgen(const UChar *bytes) case 0xeb000000006eULL: s390_format_SIY_IRD(s390_irgen_ALSI, SIY_i2(ovl), SIY_b1(ovl), SIY_dl1(ovl), SIY_dh1(ovl)); goto ok; + case 0xeb0000000071ULL: /* LPSWEY */ goto unimplemented; case 0xeb000000007aULL: s390_format_SIY_IRD(s390_irgen_AGSI, SIY_i2(ovl), SIY_b1(ovl), SIY_dl1(ovl), SIY_dh1(ovl)); goto ok; diff --git a/auxprogs/s390-check-opcodes.pl b/auxprogs/s390-check-opcodes.pl index 3abb0c8fbb..5262a74d8f 100755 --- a/auxprogs/s390-check-opcodes.pl +++ b/auxprogs/s390-check-opcodes.pl @@ -14,14 +14,24 @@ use warnings; #------------------------------------------------------------------ my $num_arg = $#ARGV + 1; -if ($num_arg != 3) { +my $csv_file; +my $opc_file; +my $toir_file; + +if ($num_arg == 0) { + my $cwd = `pwd`; + my ($basedir) = $cwd =~ m|(.*)/valgrind/|; + $csv_file = "$basedir/valgrind/docs/internals/s390-opcodes.csv"; + $opc_file = "$basedir/binutils-gdb/opcodes/s390-opc.txt"; + $toir_file = "$basedir/valgrind/VEX/priv/guest_s390_toIR.c"; +} elsif ($num_arg == 3) { + $csv_file = $ARGV[0]; + $opc_file = $ARGV[1]; + $toir_file = $ARGV[2]; +} else { die "usage: s390-check-opcodes s390-opcodes.csv s390-opc.txt guest_s390_toIR.c\n"; } -my $csv_file = $ARGV[0]; -my $opc_file = $ARGV[1]; -my $toir_file = $ARGV[2]; - my %opc_desc = (); my %csv_desc = (); my %csv_implemented = (); @@ -36,13 +46,19 @@ my %known_arch = map {($_ => 1)} my @extended_mnemonics = ( "bi", # extended mnemonic for bic 'brul?', + 'jc', # brc 'jasl?', - 'jctg?', + 'jct[gh]?', 'jg?nop', 'jxleg?', 'jxhg?', 'l[de]rv', + 'lfi', # iilf + 'llg[fh]i', # llilf, llill + 'notg?r', # nork, nogrk 'risbgn?z', + 'risb[hl]gz', + 'r[onx]sbgt', 'st[de]rv', "va[bhfgq]", "vacc[bhfgq]", @@ -121,6 +137,7 @@ my @extended_mnemonics = ( "vsbcbiq", "vsbiq", "vscbi[bhfgq]", + "vsch[sdx]p", # vschp (short/long/extended) "vseg[bfh]", 'vstbr[hfgq]', 'vster[hfg]', @@ -347,9 +364,9 @@ foreach my $opc (keys %csv_desc) { #---------------------------------------------------- foreach my $opc (keys %opc_desc) { if (defined $csv_desc{$opc}) { - if ($opc_desc{$opc} ne $csv_desc{$opc}) { + if (lc($opc_desc{$opc}) ne lc($csv_desc{$opc})) { print "*** opcode $opc differs:\n"; - print " binutils: $opc_desc{$opc}\n"; + print " binutils: $opc_desc{$opc}\n"; print " opcodes.csv: $csv_desc{$opc}\n"; } } diff --git a/docs/internals/s390-opcodes.csv b/docs/internals/s390-opcodes.csv index cd0b4b375e..b41d9bd2b5 100644 --- a/docs/internals/s390-opcodes.csv +++ b/docs/internals/s390-opcodes.csv @@ -1746,3 +1746,22 @@ wclfeb,"vector fp convert to logical 32 bit",implemented,arch13 dfltcc,"deflate conversion call","not implemented",arch13 sortl,"sort lists","not implemented",arch13 kdsa,"compute digital signature authentication","not implemented",arch13 +vschp,"decimal scale and convert to hfp","not implemented",arch14 +vscshp,"decimal scale and convert and split to hfp","not implemented",arch14 +vcsph,"vector convert hfp to scaled decimal","not implemented",arch14 +vclzdp,"vector count leading zero digits","not implemented",arch14 +vpkzr,"vector pack zoned register","not implemented",arch14 +vsrpr,"vector shift and round decimal register","not implemented",arch14 +vupkzh,"vector unpack zoned high","not implemented",arch14 +vupkzl,"vector unpack zoned low","not implemented",arch14 +nnpa,"neural network processing assist","not implemented",arch14 +vclfnh,"vector fp convert and lengthen from nnp high","implemented",arch14 +vclfnl,"vector fp convert and lengthen from nnp low","implemented",arch14 +vcrnf,"vector fp convert and round to nnp","implemented",arch14 +vcfn,"vector fp convert from nnp","implemented",arch14 +vcnf,"vector fp convert to nnp","implemented",arch14 +rdp,"reset dat protection",N/A,"privileged instruction" +lpswey,"load PSW extended",N/A,"privileged instruction" +lbear,"load bear",N/A,"privileged instruction" +stbear,"store bear",N/A,"privileged instruction" +qpaci,"query processor activity counter information",N/A,"privileged instruction"