Line 1... |
Line 1... |
/* Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007
|
/* Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2009
|
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
|
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
|
|
|
This file is part of BFD, the Binary File Descriptor library.
|
This file is part of BFD, the Binary File Descriptor library.
|
|
|
Line 79... |
Line 79... |
}
|
}
|
|
|
static const char*
|
static const char*
|
ins_immu (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
|
ins_immu (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
|
{
|
{
|
ia64_insn new = 0;
|
ia64_insn new_insn = 0;
|
int i;
|
int i;
|
|
|
for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
|
for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
|
{
|
{
|
new |= ((value & ((((ia64_insn) 1) << self->field[i].bits) - 1))
|
new_insn |= ((value & ((((ia64_insn) 1) << self->field[i].bits) - 1))
|
<< self->field[i].shift);
|
<< self->field[i].shift);
|
value >>= self->field[i].bits;
|
value >>= self->field[i].bits;
|
}
|
}
|
if (value)
|
if (value)
|
return "integer operand out of range";
|
return "integer operand out of range";
|
|
|
*code |= new;
|
*code |= new_insn;
|
return 0;
|
return 0;
|
}
|
}
|
|
|
static const char*
|
static const char*
|
ext_immu (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
|
ext_immu (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
|
Line 161... |
Line 161... |
static const char*
|
static const char*
|
ins_imms_scaled (const struct ia64_operand *self, ia64_insn value,
|
ins_imms_scaled (const struct ia64_operand *self, ia64_insn value,
|
ia64_insn *code, int scale)
|
ia64_insn *code, int scale)
|
{
|
{
|
BFD_HOST_64_BIT svalue = value, sign_bit = 0;
|
BFD_HOST_64_BIT svalue = value, sign_bit = 0;
|
ia64_insn new = 0;
|
ia64_insn new_insn = 0;
|
int i;
|
int i;
|
|
|
svalue >>= scale;
|
svalue >>= scale;
|
|
|
for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
|
for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
|
{
|
{
|
new |= ((svalue & ((((ia64_insn) 1) << self->field[i].bits) - 1))
|
new_insn |= ((svalue & ((((ia64_insn) 1) << self->field[i].bits) - 1))
|
<< self->field[i].shift);
|
<< self->field[i].shift);
|
sign_bit = (svalue >> (self->field[i].bits - 1)) & 1;
|
sign_bit = (svalue >> (self->field[i].bits - 1)) & 1;
|
svalue >>= self->field[i].bits;
|
svalue >>= self->field[i].bits;
|
}
|
}
|
if ((!sign_bit && svalue != 0) || (sign_bit && svalue != -1))
|
if ((!sign_bit && svalue != 0) || (sign_bit && svalue != -1))
|
return "integer operand out of range";
|
return "integer operand out of range";
|
|
|
*code |= new;
|
*code |= new_insn;
|
return 0;
|
return 0;
|
}
|
}
|
|
|
static const char*
|
static const char*
|
ext_imms_scaled (const struct ia64_operand *self, ia64_insn code,
|
ext_imms_scaled (const struct ia64_operand *self, ia64_insn code,
|