1 |
/* Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. |
/* Copyright 1998, 1999, 2000, 2001, 2002, 2003 |
2 |
|
Free Software Foundation, Inc. |
3 |
Contributed by David Mosberger-Tang <davidm@hpl.hp.com> |
Contributed by David Mosberger-Tang <davidm@hpl.hp.com> |
4 |
|
|
5 |
This file is part of BFD, the Binary File Descriptor library. |
This file is part of BFD, the Binary File Descriptor library. |
162 |
ext_imms_scaled (const struct ia64_operand *self, ia64_insn code, |
ext_imms_scaled (const struct ia64_operand *self, ia64_insn code, |
163 |
ia64_insn *valuep, int scale) |
ia64_insn *valuep, int scale) |
164 |
{ |
{ |
165 |
int i, bits = 0, total = 0, shift; |
int i, bits = 0, total = 0; |
166 |
BFD_HOST_64_BIT val = 0; |
BFD_HOST_64_BIT val = 0, sign; |
167 |
|
|
168 |
for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i) |
for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i) |
169 |
{ |
{ |
173 |
total += bits; |
total += bits; |
174 |
} |
} |
175 |
/* sign extend: */ |
/* sign extend: */ |
176 |
shift = 8*sizeof (val) - total; |
sign = (BFD_HOST_64_BIT) 1 << (total - 1); |
177 |
val = (val << shift) >> shift; |
val = (val ^ sign) - sign; |
178 |
|
|
179 |
*valuep = (val << scale); |
*valuep = (val << scale); |
180 |
return 0; |
return 0; |
189 |
static const char* |
static const char* |
190 |
ins_immsu4 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) |
ins_immsu4 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) |
191 |
{ |
{ |
192 |
if (value == (BFD_HOST_U_64_BIT) 0x100000000) |
value = ((value & 0xffffffff) ^ 0x80000000) - 0x80000000; |
|
value = 0; |
|
|
else |
|
|
value = (((BFD_HOST_64_BIT)value << 32) >> 32); |
|
193 |
|
|
194 |
return ins_imms_scaled (self, value, code, 0); |
return ins_imms_scaled (self, value, code, 0); |
195 |
} |
} |
211 |
ins_immsm1u4 (const struct ia64_operand *self, ia64_insn value, |
ins_immsm1u4 (const struct ia64_operand *self, ia64_insn value, |
212 |
ia64_insn *code) |
ia64_insn *code) |
213 |
{ |
{ |
214 |
if (value == (BFD_HOST_U_64_BIT) 0x100000000) |
value = ((value & 0xffffffff) ^ 0x80000000) - 0x80000000; |
|
value = 0; |
|
|
else |
|
|
value = (((BFD_HOST_64_BIT)value << 32) >> 32); |
|
215 |
|
|
216 |
--value; |
--value; |
217 |
return ins_imms_scaled (self, value, code, 0); |
return ins_imms_scaled (self, value, code, 0); |
413 |
{ |
{ |
414 |
/* constants: */ |
/* constants: */ |
415 |
{ CST, ins_const, ext_const, "NIL", {{ 0, 0}}, 0, "<none>" }, |
{ CST, ins_const, ext_const, "NIL", {{ 0, 0}}, 0, "<none>" }, |
416 |
|
{ CST, ins_const, ext_const, "ar.csd", {{ 0, 0}}, 0, "ar.csd" }, |
417 |
{ CST, ins_const, ext_const, "ar.ccv", {{ 0, 0}}, 0, "ar.ccv" }, |
{ CST, ins_const, ext_const, "ar.ccv", {{ 0, 0}}, 0, "ar.ccv" }, |
418 |
{ CST, ins_const, ext_const, "ar.pfs", {{ 0, 0}}, 0, "ar.pfs" }, |
{ CST, ins_const, ext_const, "ar.pfs", {{ 0, 0}}, 0, "ar.pfs" }, |
419 |
{ CST, ins_const, ext_const, "1", {{ 0, 0}}, 0, "1" }, |
{ CST, ins_const, ext_const, "1", {{ 0, 0}}, 0, "1" }, |
582 |
"a branch target" }, |
"a branch target" }, |
583 |
{ REL, ins_rsvd, ext_rsvd, 0, {{0, 0}}, 0, /* TGT64 */ |
{ REL, ins_rsvd, ext_rsvd, 0, {{0, 0}}, 0, /* TGT64 */ |
584 |
"a branch target" }, |
"a branch target" }, |
585 |
|
|
586 |
|
{ ABS, ins_const, ext_const, 0, {{0, 0}}, 0, /* LDXMOV */ |
587 |
|
"ldxmov target" }, |
588 |
}; |
}; |