2007-01-03 H.J. Lu <hongjiu.lu@intel.com>
* config/tc-i386.c (swap_operands): Remove branches.
This commit is contained in:
parent
67cf15b768
commit
b7c61d9abb
1 changed files with 20 additions and 29 deletions
|
@ -2280,39 +2280,13 @@ swap_operands (void)
|
||||||
union i386_op temp_op;
|
union i386_op temp_op;
|
||||||
unsigned int temp_type;
|
unsigned int temp_type;
|
||||||
enum bfd_reloc_code_real temp_reloc;
|
enum bfd_reloc_code_real temp_reloc;
|
||||||
int xchg1 = 0;
|
int xchg1, xchg2;
|
||||||
int xchg2 = 0;
|
|
||||||
|
|
||||||
if (i.operands == 4)
|
switch (i.operands)
|
||||||
/* There will be two exchanges in a 4 operand instruction.
|
|
||||||
First exchange is the done inside this block.(1st and 4rth operand)
|
|
||||||
The next exchange is done outside this block.(2nd and 3rd operand) */
|
|
||||||
{
|
{
|
||||||
xchg1 = 0;
|
case 4:
|
||||||
xchg2 = 3;
|
|
||||||
temp_type = i.types[xchg2];
|
|
||||||
i.types[xchg2] = i.types[xchg1];
|
|
||||||
i.types[xchg1] = temp_type;
|
|
||||||
temp_op = i.op[xchg2];
|
|
||||||
i.op[xchg2] = i.op[xchg1];
|
|
||||||
i.op[xchg1] = temp_op;
|
|
||||||
temp_reloc = i.reloc[xchg2];
|
|
||||||
i.reloc[xchg2] = i.reloc[xchg1];
|
|
||||||
i.reloc[xchg1] = temp_reloc;
|
|
||||||
xchg1 = 1;
|
xchg1 = 1;
|
||||||
xchg2 = 2;
|
xchg2 = i.operands - 2;
|
||||||
}
|
|
||||||
|
|
||||||
if (i.operands == 2)
|
|
||||||
{
|
|
||||||
xchg1 = 0;
|
|
||||||
xchg2 = 1;
|
|
||||||
}
|
|
||||||
else if (i.operands == 3)
|
|
||||||
{
|
|
||||||
xchg1 = 0;
|
|
||||||
xchg2 = 2;
|
|
||||||
}
|
|
||||||
temp_type = i.types[xchg2];
|
temp_type = i.types[xchg2];
|
||||||
i.types[xchg2] = i.types[xchg1];
|
i.types[xchg2] = i.types[xchg1];
|
||||||
i.types[xchg1] = temp_type;
|
i.types[xchg1] = temp_type;
|
||||||
|
@ -2322,6 +2296,23 @@ swap_operands (void)
|
||||||
temp_reloc = i.reloc[xchg2];
|
temp_reloc = i.reloc[xchg2];
|
||||||
i.reloc[xchg2] = i.reloc[xchg1];
|
i.reloc[xchg2] = i.reloc[xchg1];
|
||||||
i.reloc[xchg1] = temp_reloc;
|
i.reloc[xchg1] = temp_reloc;
|
||||||
|
case 3:
|
||||||
|
case 2:
|
||||||
|
xchg1 = 0;
|
||||||
|
xchg2 = i.operands - 1;
|
||||||
|
temp_type = i.types[xchg2];
|
||||||
|
i.types[xchg2] = i.types[xchg1];
|
||||||
|
i.types[xchg1] = temp_type;
|
||||||
|
temp_op = i.op[xchg2];
|
||||||
|
i.op[xchg2] = i.op[xchg1];
|
||||||
|
i.op[xchg1] = temp_op;
|
||||||
|
temp_reloc = i.reloc[xchg2];
|
||||||
|
i.reloc[xchg2] = i.reloc[xchg1];
|
||||||
|
i.reloc[xchg1] = temp_reloc;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
abort ();
|
||||||
|
}
|
||||||
|
|
||||||
if (i.mem_operands == 2)
|
if (i.mem_operands == 2)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue