aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorAndreas Krebbel <Andreas.Krebbel@de.ibm.com>2008-04-10 08:59:46 +0000
committerAndreas Krebbel <Andreas.Krebbel@de.ibm.com>2008-04-10 08:59:46 +0000
commit45a5551e7407cb5815016928bfce96262084b751 (patch)
tree04eee100238dd832e145469ac3f20ca5fb38127d /opcodes
parent2cefc35727da245c5b39b51551a488ba7f211689 (diff)
downloadgdb-45a5551e7407cb5815016928bfce96262084b751.zip
gdb-45a5551e7407cb5815016928bfce96262084b751.tar.gz
gdb-45a5551e7407cb5815016928bfce96262084b751.tar.bz2
2008-04-10 Andreas Krebbel <krebbel1@de.ibm.com>
* s390-mkopc.c (s390_cond_ext_format): Add back the mnemonic extensions for conditional jumps (o, p, m, nz, z, nm, np, no). (s390_crb_extensions): New extensions table. (insertExpandedMnemonic): Handle '$' tag. * s390-opc.txt: Remove conditional jump variants which can now be expanded automatically. Replace '*' tag with '$' in the compare and branch instructions. 2008-04-10 Andreas Krebbel <krebbel1@de.ibm.com> * gas/s390/zarch-z10.d: Map the compare and branch variants with odd condition code mask to version with an even mask.
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog10
-rw-r--r--opcodes/s390-mkopc.c57
-rw-r--r--opcodes/s390-opc.txt81
3 files changed, 84 insertions, 64 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 5eb98b8..f90038d 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,13 @@
+2008-04-10 Andreas Krebbel <krebbel1@de.ibm.com>
+
+ * s390-mkopc.c (s390_cond_ext_format): Add back the mnemonic
+ extensions for conditional jumps (o, p, m, nz, z, nm, np, no).
+ (s390_crb_extensions): New extensions table.
+ (insertExpandedMnemonic): Handle '$' tag.
+ * s390-opc.txt: Remove conditional jump variants which can now
+ be expanded automatically.
+ Replace '*' tag with '$' in the compare and branch instructions.
+
2008-04-07 H.J. Lu <hongjiu.lu@intel.com>
* i386-dis.c (PREFIX_VEX_38XX): Add a tab.
diff --git a/opcodes/s390-mkopc.c b/opcodes/s390-mkopc.c
index 24951db..7274bdc 100644
--- a/opcodes/s390-mkopc.c
+++ b/opcodes/s390-mkopc.c
@@ -1,5 +1,5 @@
/* s390-mkopc.c -- Generates opcode table out of s390-opc.txt
- Copyright 2000, 2001, 2003, 2007 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2003, 2007, 2008 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU opcodes library.
@@ -122,22 +122,48 @@ struct s390_cond_ext_format
char extension[4];
};
-/* The mnemonic extensions for conditional branches used to replace
+/* The mnemonic extensions for conditional jumps used to replace
the '*' tag. */
-#define NUM_COND_EXTENSIONS 12
+#define NUM_COND_EXTENSIONS 20
const struct s390_cond_ext_format s390_cond_extensions[NUM_COND_EXTENSIONS] =
-{ { '2', "h" }, /* jump on A high */
+{ { '1', "o" }, /* jump on overflow / if ones */
+ { '2', "h" }, /* jump on A high */
+ { '2', "p" }, /* jump on plus */
{ '3', "nle" }, /* jump on not low or equal */
{ '4', "l" }, /* jump on A low */
+ { '4', "m" }, /* jump on minus / if mixed */
{ '5', "nhe" }, /* jump on not high or equal */
{ '6', "lh" }, /* jump on low or high */
{ '7', "ne" }, /* jump on A not equal B */
+ { '7', "nz" }, /* jump on not zero / if not zeros */
{ '8', "e" }, /* jump on A equal B */
+ { '8', "z" }, /* jump on zero / if zeros */
{ '9', "nlh" }, /* jump on not low or high */
{ 'a', "he" }, /* jump on high or equal */
{ 'b', "nl" }, /* jump on A not low */
+ { 'b', "nm" }, /* jump on not minus / if not mixed */
{ 'c', "le" }, /* jump on low or equal */
{ 'd', "nh" }, /* jump on A not high */
+ { 'd', "np" }, /* jump on not plus */
+ { 'e', "no" }, /* jump on not overflow / if not ones */
+};
+
+/* The mnemonic extensions for conditional branches used to replace
+ the '$' tag. */
+#define NUM_CRB_EXTENSIONS 12
+const struct s390_cond_ext_format s390_crb_extensions[NUM_CRB_EXTENSIONS] =
+{ { '2', "h" }, /* jump on A high */
+ { '2', "nle" }, /* jump on not low or equal */
+ { '4', "l" }, /* jump on A low */
+ { '4', "nhe" }, /* jump on not high or equal */
+ { '6', "ne" }, /* jump on A not equal B */
+ { '6', "lh" }, /* jump on low or high */
+ { '8', "e" }, /* jump on A equal B */
+ { '8', "nlh" }, /* jump on not low or high */
+ { 'a', "nl" }, /* jump on A not low */
+ { 'a', "he" }, /* jump on high or equal */
+ { 'c', "nh" }, /* jump on A not high */
+ { 'c', "le" }, /* jump on low or equal */
};
/* As with insertOpcode instructions are added to the sorted opcode
@@ -156,8 +182,10 @@ insertExpandedMnemonic (char *opcode, char *mnemonic, char *format,
char number[5];
int mask_start, i = 0, tag_found = 0, reading_number = 0;
int number_p = 0, suffix_p = 0, prefix_p = 0;
+ const struct s390_cond_ext_format *ext_table;
+ int ext_table_length;
- if (!(tag = strchr (mnemonic, '*')))
+ if (!(tag = strpbrk (mnemonic, "*$")))
{
insertOpcode (opcode, mnemonic, format, min_cpu, mode_bits);
return;
@@ -217,13 +245,26 @@ insertExpandedMnemonic (char *opcode, char *mnemonic, char *format,
mask_start >>= 2;
- for (i = 0; i < NUM_COND_EXTENSIONS; i++)
+ switch (*tag)
+ {
+ case '*':
+ ext_table = s390_cond_extensions;
+ ext_table_length = NUM_COND_EXTENSIONS;
+ break;
+ case '$':
+ ext_table = s390_crb_extensions;
+ ext_table_length = NUM_CRB_EXTENSIONS;
+ break;
+ default: fprintf (stderr, "Unknown tag char: %c\n", *tag);
+ }
+
+ for (i = 0; i < ext_table_length; i++)
{
char new_mnemonic[15];
strcpy (new_mnemonic, prefix);
- opcode[mask_start] = s390_cond_extensions[i].nibble;
- strcat (new_mnemonic, s390_cond_extensions[i].extension);
+ opcode[mask_start] = ext_table[i].nibble;
+ strcat (new_mnemonic, ext_table[i].extension);
strcat (new_mnemonic, suffix);
insertOpcode (opcode, new_mnemonic, format, min_cpu, mode_bits);
}
diff --git a/opcodes/s390-opc.txt b/opcodes/s390-opc.txt
index 4b78f24..7f6aee2 100644
--- a/opcodes/s390-opc.txt
+++ b/opcodes/s390-opc.txt
@@ -262,35 +262,11 @@ a700 tmh RI_RU "test under mask high" g5 esa,zarch
a701 tml RI_RU "test under mask low" g5 esa,zarch
0700 nopr RR_0R "no operation" g5 esa,zarch
0700 b*8r RR_0R "conditional branch" g5 esa,zarch
-0710 bor RR_0R "branch on overflow / if ones" g5 esa,zarch
-0720 bpr RR_0R "branch on plus" g5 esa,zarch
-0740 bmr RR_0R "branch on minus / if mixed" g5 esa,zarch
-0770 bnzr RR_0R "branch on not zero / if not zeros" g5 esa,zarch
-0780 bzr RR_0R "branch on zero / if zeros" g5 esa,zarch
-07b0 bnmr RR_0R "branch on not minus / if not mixed" g5 esa,zarch
-07d0 bnpr RR_0R "branch on not plus" g5 esa,zarch
-07e0 bnor RR_0R "branch on not overflow / if not ones" g5 esa,zarch
07f0 br RR_0R "unconditional branch" g5 esa,zarch
4700 nop RX_0RRD "no operation" g5 esa,zarch
4700 b*8 RX_0RRD "conditional branch" g5 esa,zarch
-4710 bo RX_0RRD "branch on overflow / if ones" g5 esa,zarch
-4720 bp RX_0RRD "branch on plus" g5 esa,zarch
-4740 bm RX_0RRD "branch on minus / if mixed" g5 esa,zarch
-4770 bnz RX_0RRD "branch on not zero / if not zeros" g5 esa,zarch
-4780 bz RX_0RRD "branch on zero / if zeros" g5 esa,zarch
-47b0 bnm RX_0RRD "branch on not minus / if not mixed" g5 esa,zarch
-47d0 bnp RX_0RRD "branch on not plus" g5 esa,zarch
-47e0 bno RX_0RRD "branch on not overflow / if not ones" g5 esa,zarch
47f0 b RX_0RRD "unconditional branch" g5 esa,zarch
a704 j*8 RI_0P "conditional jump" g5 esa,zarch
-a714 jo RI_0P "jump on overflow / if ones" g5 esa,zarch
-a724 jp RI_0P "jump on plus" g5 esa,zarch
-a744 jm RI_0P "jump on minus / if mixed" g5 esa,zarch
-a774 jnz RI_0P "jump on not zero / if not zeros" g5 esa,zarch
-a784 jz RI_0P "jump on zero / if zeros" g5 esa,zarch
-a7b4 jnm RI_0P "jump on not minus / if not mixed" g5 esa,zarch
-a7d4 jnp RI_0P "jump on not plus" g5 esa,zarch
-a7e4 jno RI_0P "jump on not overflow / if not ones" g5 esa,zarch
a7f4 j RI_0P "unconditional jump" g5 esa,zarch
b34a axbr RRE_FF "add extended bfp" g5 esa,zarch
b31a adbr RRE_FF "add long bfp" g5 esa,zarch
@@ -487,14 +463,6 @@ a702 tmhh RI_RU "test under mask high high" z900 zarch
a703 tmhl RI_RU "test under mask high low" z900 zarch
c004 brcl RIL_UP "branch relative on condition long" z900 esa,zarch
c004 jg*8 RIL_0P "conditional jump long" z900 esa,zarch
-c014 jgo RIL_0P "jump long on overflow / if ones" z900 esa,zarch
-c024 jgp RIL_0P "jump long on plus" z900 esa,zarch
-c044 jgm RIL_0P "jump long on minus / if mixed" z900 esa,zarch
-c074 jgnz RIL_0P "jump long on not zero / if not zeros" z900 esa,zarch
-c084 jgz RIL_0P "jump long on zero / if zeros" z900 esa,zarch
-c0b4 jgnm RIL_0P "jump long on not minus / if not mixed" z900 esa,zarch
-c0d4 jgnp RIL_0P "jump long on not plus" z900 esa,zarch
-c0e4 jgno RIL_0P "jump long on not overflow / if not ones" z900 esa,zarch
c0f4 jg RIL_0P "unconditional jump long" z900 esa,zarch
c005 brasl RIL_RP "branch relative and save long" z900 esa,zarch
a707 brctg RI_RP "branch relative on count 64" z900 zarch
@@ -884,6 +852,7 @@ ed0000000059 tdgxt RXE_FRRD "test data group extended dfp" z9-ec zarch
010a pfpo E "perform floating point operation" z9-ec zarch
c801 ectg SSF_RRDRD "extract cpu time" z9-ec zarch
c802 csst SSF_RRDRD "compare and swap and store" z9-ec zarch
+# The new instructions of the System z10 Enterprise Class
eb000000006a asi SIY_IRD "add immediate (32<8)" z10 zarch
eb000000007a agsi SIY_IRD "add immediate (64<8)" z10 zarch
eb000000006e alsi SIY_IRD "add logical with signed immediate (32<8)" z10 zarch
@@ -891,29 +860,29 @@ eb000000007e algsi SIY_IRD "add logical with signed immediate (64<8)" z10 zarch
c60d crl RIL_RP "compare relative long (32)" z10 zarch
c608 cgrl RIL_RP "compare relative long (64)" z10 zarch
c60c cgfrl RIL_RP "compare relative long (64<32)" z10 zarch
-ec00000000f6 crb*32 RRS_RRRD0 "compare and branch (32)" z10 zarch
+ec00000000f6 crb$32 RRS_RRRD0 "compare and branch (32)" z10 zarch
ec00000000f6 crb RRS_RRRDU "compare and branch (32)" z10 zarch
-ec00000000e4 cgrb*32 RRS_RRRD0 "compare and branch (64)" z10 zarch
+ec00000000e4 cgrb$32 RRS_RRRD0 "compare and branch (64)" z10 zarch
ec00000000e4 cgrb RRS_RRRDU "compare and branch (64)" z10 zarch
-ec0000000076 crj*32 RIE_RRP "compare and branch relative (32)" z10 zarch
+ec0000000076 crj$32 RIE_RRP "compare and branch relative (32)" z10 zarch
ec0000000076 crj RIE_RRPU "compare and branch relative (32)" z10 zarch
-ec0000000064 cgrj*32 RIE_RRP0 "compare and branch relative (64)" z10 zarch
+ec0000000064 cgrj$32 RIE_RRP0 "compare and branch relative (64)" z10 zarch
ec0000000064 cgrj RIE_RRPU "compare and branch relative (64)" z10 zarch
-ec00000000fe cib*12 RIS_R0RDI "compare immediate and branch (32<8)" z10 zarch
+ec00000000fe cib$12 RIS_R0RDI "compare immediate and branch (32<8)" z10 zarch
ec00000000fe cib RIS_RURDI "compare immediate and branch (32<8)" z10 zarch
-ec00000000fc cgib*12 RIS_R0RDI "compare immediate and branch (64<8)" z10 zarch
+ec00000000fc cgib$12 RIS_R0RDI "compare immediate and branch (64<8)" z10 zarch
ec00000000fc cgib RIS_RURDI "compare immediate and branch (64<8)" z10 zarch
-ec000000007e cij*12 RIE_R0PI "compare immediate and branch relative (32<8)" z10 zarch
+ec000000007e cij$12 RIE_R0PI "compare immediate and branch relative (32<8)" z10 zarch
ec000000007e cij RIE_RUPI "compare immediate and branch relative (32<8)" z10 zarch
-ec000000007c cgij*12 RIE_R0PI "compare immediate and branch relative (64<8)" z10 zarch
+ec000000007c cgij$12 RIE_R0PI "compare immediate and branch relative (64<8)" z10 zarch
ec000000007c cgij RIE_RUPI "compare immediate and branch relative (64<8)" z10 zarch
-b97200000000 crt*16 RRF_00RR "compare and trap" z10 zarch
+b97200000000 crt$16 RRF_00RR "compare and trap" z10 zarch
b972 crt RRF_U0RR "compare and trap" z10 zarch
-b96000000000 cgrt*16 RRF_00RR "compare and trap 64" z10 zarch
+b96000000000 cgrt$16 RRF_00RR "compare and trap 64" z10 zarch
b960 cgrt RRF_U0RR "compare and trap 64" z10 zarch
-ec0000000072 cit*32 RIE_R0I0 "compare immediate and trap (32<16)" z10 zarch
+ec0000000072 cit$32 RIE_R0I0 "compare immediate and trap (32<16)" z10 zarch
ec0000000072 cit RIE_R0IU "compare immediate and trap (32<16)" z10 zarch
-ec0000000070 cgit*32 RIE_R0I0 "compare immediate and trap (64<16)" z10 zarch
+ec0000000070 cgit$32 RIE_R0I0 "compare immediate and trap (64<16)" z10 zarch
ec0000000070 cgit RIE_R0IU "compare immediate and trap (64<16)" z10 zarch
e30000000034 cgh RXY_RRRD "compare halfword (64<16)" z10 zarch
e554 chhsi SIL_RDI "compare halfword immediate (16<16)" z10 zarch
@@ -929,29 +898,29 @@ c60a clgrl RIL_RP "compare logical relative long (64)" z10 zarch
c60e clgfrl RIL_RP "compare logical relative long (64<32)" z10 zarch
c607 clhrl RIL_RP "compare logical relative long (32<16)" z10 zarch
c606 clghrl RIL_RP "compare logical relative long (64<16)" z10 zarch
-ec00000000f7 clrb*32 RRS_RRRD0 "compare logical and branch (32)" z10 zarch
+ec00000000f7 clrb$32 RRS_RRRD0 "compare logical and branch (32)" z10 zarch
ec00000000f7 clrb RRS_RRRDU "compare logical and branch (32)" z10 zarch
-ec00000000e5 clgrb*32 RRS_RRRD0 "compare logical and branch (64)" z10 zarch
+ec00000000e5 clgrb$32 RRS_RRRD0 "compare logical and branch (64)" z10 zarch
ec00000000e5 clgrb RRS_RRRDU "compare logical and branch (64)" z10 zarch
-ec0000000077 clrj*32 RIE_RRP "compare logical and branch relative (32)" z10 zarch
+ec0000000077 clrj$32 RIE_RRP "compare logical and branch relative (32)" z10 zarch
ec0000000077 clrj RIE_RRPU "compare logical and branch relative (32)" z10 zarch
-ec0000000065 clgrj*32 RIE_RRP "compare logical and branch relative (64)" z10 zarch
+ec0000000065 clgrj$32 RIE_RRP "compare logical and branch relative (64)" z10 zarch
ec0000000065 clgrj RIE_RRPU "compare logical and branch relative (64)" z10 zarch
-ec00000000ff clib*12 RIS_R0RDU "compare logical immediate and branch (32<8)" z10 zarch
+ec00000000ff clib$12 RIS_R0RDU "compare logical immediate and branch (32<8)" z10 zarch
ec00000000ff clib RIS_RURDU "compare logical immediate and branch (32<8)" z10 zarch
-ec00000000fd clgib*12 RIS_R0RDU "compare logical immediate and branch (64<8)" z10 zarch
+ec00000000fd clgib$12 RIS_R0RDU "compare logical immediate and branch (64<8)" z10 zarch
ec00000000fd clgib RIS_RURDU "compare logical immediate and branch (64<8)" z10 zarch
-ec000000007f clij*12 RIE_R0PU "compare logical immediate and branch relative (32<8)" z10 zarch
+ec000000007f clij$12 RIE_R0PU "compare logical immediate and branch relative (32<8)" z10 zarch
ec000000007f clij RIE_RUPU "compare logical immediate and branch relative (32<8)" z10 zarch
-ec000000007d clgij*12 RIE_R0PU "compare logical immediate and branch relative (64<8)" z10 zarch
+ec000000007d clgij$12 RIE_R0PU "compare logical immediate and branch relative (64<8)" z10 zarch
ec000000007d clgij RIE_RUPU "compare logical immediate and branch relative (64<8)" z10 zarch
-b97300000000 clrt*16 RRF_00RR "compare logical and trap (32)" z10 zarch
+b97300000000 clrt$16 RRF_00RR "compare logical and trap (32)" z10 zarch
b973 clrt RRF_U0RR "compare logical and trap (32)" z10 zarch
-b96100000000 clgrt*16 RRF_00RR "compare logical and trap (64)" z10 zarch
+b96100000000 clgrt$16 RRF_00RR "compare logical and trap (64)" z10 zarch
b961 clgrt RRF_U0RR "compare logical and trap (64)" z10 zarch
-ec0000000073 clfit*32 RIE_R0U0 "compare logical and trap (32<16)" z10 zarch
+ec0000000073 clfit$32 RIE_R0U0 "compare logical and trap (32<16)" z10 zarch
ec0000000073 clfit RIE_R0UU "compare logical and trap (32<16)" z10 zarch
-ec0000000071 clgit*32 RIE_R0U0 "compare logical and trap (64<16)" z10 zarch
+ec0000000071 clgit$32 RIE_R0U0 "compare logical and trap (64<16)" z10 zarch
ec0000000071 clgit RIE_R0UU "compare logical and trap (64<16)" z10 zarch
eb000000004c ecag RSY_RRRD "extract cache attribute" z10 zarch
c40d lrl RIL_RP "load relative long (32)" z10 zarch