diff options
Diffstat (limited to 'opcodes/sparc-dis.c')
-rw-r--r-- | opcodes/sparc-dis.c | 40 |
1 files changed, 6 insertions, 34 deletions
diff --git a/opcodes/sparc-dis.c b/opcodes/sparc-dis.c index 1138136..f935783 100644 --- a/opcodes/sparc-dis.c +++ b/opcodes/sparc-dis.c @@ -387,40 +387,12 @@ compare_opcodes (const void * a, const void * b) return length_diff; } - /* Put 1+i before i+1. */ - { - char *p0 = (char *) strchr (op0->args, '+'); - char *p1 = (char *) strchr (op1->args, '+'); - - if (p0 && p1) - { - /* There is a plus in both operands. Note that a plus - sign cannot be the first character in args, - so the following [-1]'s are valid. */ - if (p0[-1] == 'i' && p1[1] == 'i') - /* op0 is i+1 and op1 is 1+i, so op1 goes first. */ - return 1; - if (p0[1] == 'i' && p1[-1] == 'i') - /* op0 is 1+i and op1 is i+1, so op0 goes first. */ - return -1; - } - } - - /* Put 1,i before i,1. */ - { - int i0 = strncmp (op0->args, "i,1", 3) == 0; - int i1 = strncmp (op1->args, "i,1", 3) == 0; - - if (i0 ^ i1) - return i0 - i1; - } - - /* They are, as far as we can tell, identical. - Since qsort may have rearranged the table partially, there is - no way to tell which one was first in the opcode table as - written, so just say there are equal. */ - /* ??? This is no longer true now that we sort a vector of pointers, - not the table itself. */ + /* They are, as far as we can tell, identical. Keep the order in + the sparc_opcodes table. */ + if (op0 < op1) + return -1; + if (op0 > op1) + return 1; return 0; } |