* z8kgen.c (func): Stabilize qsort of identically named entries.

* z8k-opc.h: Regenerate.
This commit is contained in:
Alan Modra 2009-09-07 12:11:20 +00:00
parent 23f938f12a
commit eae14d64d1
3 changed files with 24 additions and 14 deletions

View file

@ -1,3 +1,8 @@
2009-09-07 Alan Modra <amodra@bigpond.net.au>
* z8kgen.c (func): Stabilize qsort of identically named entries.
* z8k-opc.h: Regenerate.
2009-09-07 Tristan Gingold <gingold@adacore.com>
* po/opcodes.pot: Regenerate.

View file

@ -1820,14 +1820,6 @@ const opcode_entry_type z8k_table[] = {
"ldb",OPC_ldb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_X+(ARG_RS),},
{CLASS_BIT+6,CLASS_BIT+0,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,74},
/* 0010 0000 0000 dddd imm8 imm8 *** ldb rbd,imm8 */
{
#ifdef NICENAMES
"ldb rbd,imm8",8,7,0x00,
#endif
"ldb",OPC_ldb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IMM+(ARG_IMM8),},
{CLASS_BIT+2,CLASS_BIT+0,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM8),CLASS_IMM+(ARG_IMM8),0,0,0,},2,4,74},
/* 1100 dddd imm8 *** ldb rbd,imm8 */
{
#ifdef NICENAMES
@ -1836,6 +1828,14 @@ const opcode_entry_type z8k_table[] = {
"ldb",OPC_ldb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IMM+(ARG_IMM8),},
{CLASS_BIT+0xc,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM8),0,0,0,0,0,0,},2,2,74},
/* 0010 0000 0000 dddd imm8 imm8 *** ldb rbd,imm8 */
{
#ifdef NICENAMES
"ldb rbd,imm8",8,7,0x00,
#endif
"ldb",OPC_ldb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IMM+(ARG_IMM8),},
{CLASS_BIT+2,CLASS_BIT+0,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM8),CLASS_IMM+(ARG_IMM8),0,0,0,},2,4,74},
/* 1010 0000 ssss dddd *** ldb rbd,rbs */
{
#ifdef NICENAMES
@ -3791,7 +3791,7 @@ const opcode_entry_type z8k_table[] = {
/* 1000 1000 ssss dddd *** xorb rbd,rbs */
{
#ifdef NICENAMES
"xorb rbd,rbs",8,4,0x01,
"xorb rbd,rbs",8,4,0x1c,
#endif
"xorb",OPC_xorb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_REG_BYTE+(ARG_RS),},
{CLASS_BIT+8,CLASS_BIT+8,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,203},
@ -3799,7 +3799,7 @@ const opcode_entry_type z8k_table[] = {
/* 1000 1000 ssss dddd *** xorb rbd,rbs */
{
#ifdef NICENAMES
"xorb rbd,rbs",8,4,0x1c,
"xorb rbd,rbs",8,4,0x01,
#endif
"xorb",OPC_xorb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_REG_BYTE+(ARG_RS),},
{CLASS_BIT+8,CLASS_BIT+8,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,203},

View file

@ -567,9 +567,14 @@ count (void)
}
static int
func (struct op *a, struct op *b)
func (const void *p1, const void *p2)
{
return strcmp ((a)->name, (b)->name);
const struct op *a = p1;
const struct op *b = p2;
int ret = strcmp (a->name, b->name);
if (ret != 0)
return ret;
return p1 > p2;
}
@ -909,7 +914,7 @@ internal (void)
memcpy (new_op, p, c * sizeof (struct op));
/* Sort all names in table alphabetically. */
qsort (new_op, c, sizeof (struct op), (int (*)(const void *, const void *))func);
qsort (new_op, c, sizeof (struct op), func);
p = new_op;
while (p->flags && p->flags[0] != '*')
@ -965,7 +970,7 @@ gas (void)
memcpy (new_op, p, c * sizeof (struct op));
/* Sort all names in table alphabetically. */
qsort (new_op, c, sizeof (struct op), (int (*)(const void *, const void *)) func);
qsort (new_op, c, sizeof (struct op), func);
printf ("/* DO NOT EDIT! -*- buffer-read-only: t -*-\n");
printf (" This file is automatically generated by z8kgen. */\n\n");