aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-microblaze.c
diff options
context:
space:
mode:
Diffstat (limited to 'gas/config/tc-microblaze.c')
-rw-r--r--gas/config/tc-microblaze.c55
1 files changed, 19 insertions, 36 deletions
diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
index 035a867..055d9ee 100644
--- a/gas/config/tc-microblaze.c
+++ b/gas/config/tc-microblaze.c
@@ -244,8 +244,7 @@ microblaze_s_lcomm (int xxx ATTRIBUTE_UNUSED)
if (S_GET_SEGMENT (symbolP) == current_seg)
symbol_get_frag (symbolP)->fr_symbol = 0;
symbol_set_frag (symbolP, frag_now);
- pfrag = frag_var (rs_org, 1, 1, (relax_substateT) 0, symbolP, size,
- (char *) 0);
+ pfrag = frag_var (rs_org, 1, 1, 0, symbolP, size, NULL);
*pfrag = 0;
S_SET_SIZE (symbolP, size);
S_SET_SEGMENT (symbolP, current_seg);
@@ -485,7 +484,7 @@ parse_reg (char * s, unsigned * reg)
}
else
as_bad (_("register expected, but saw '%.6s'"), s);
- if ((int) tmpreg >= MIN_PVR_REGNUM && tmpreg <= MAX_PVR_REGNUM)
+ if (tmpreg - MIN_PVR_REGNUM <= MAX_PVR_REGNUM - MIN_PVR_REGNUM)
*reg = REG_PVR + tmpreg;
else
{
@@ -514,7 +513,7 @@ parse_reg (char * s, unsigned * reg)
else
as_bad (_("register expected, but saw '%.6s'"), s);
- if ((int) tmpreg >= MIN_REGNUM && tmpreg <= MAX_REGNUM)
+ if (tmpreg - MIN_REGNUM <= MAX_REGNUM - MIN_REGNUM)
*reg = tmpreg;
else
{
@@ -551,7 +550,7 @@ parse_reg (char * s, unsigned * reg)
else
as_bad (_("register expected, but saw '%.6s'"), s);
- if ((int)tmpreg >= MIN_REGNUM && tmpreg <= MAX_REGNUM)
+ if (tmpreg - MIN_REGNUM <= MAX_REGNUM - MIN_REGNUM)
*reg = tmpreg;
else
{
@@ -914,7 +913,7 @@ md_assemble (char * str)
return;
}
- opcode = (struct op_code_struct *) str_hash_find (opcode_hash_control, name);
+ opcode = str_hash_find (opcode_hash_control, name);
if (opcode == NULL)
{
as_bad (_("unknown opcode \"%s\""), name);
@@ -1044,13 +1043,9 @@ md_assemble (char * str)
count = 32 - reg1;
if (streq (name, "lmi"))
- opcode
- = (struct op_code_struct *) str_hash_find (opcode_hash_control,
- "lwi");
+ opcode = str_hash_find (opcode_hash_control, "lwi");
else
- opcode
- = (struct op_code_struct *) str_hash_find (opcode_hash_control,
- "swi");
+ opcode = str_hash_find (opcode_hash_control, "swi");
if (opcode == NULL)
{
as_bad (_("unknown opcode \"%s\""), "lwi");
@@ -1082,9 +1077,7 @@ md_assemble (char * str)
if ((temp != 0) && (temp != 0xFFFF8000))
{
/* Needs an immediate inst. */
- opcode1
- = (struct op_code_struct *) str_hash_find (opcode_hash_control,
- "imm");
+ opcode1 = str_hash_find (opcode_hash_control, "imm");
if (opcode1 == NULL)
{
as_bad (_("unknown opcode \"%s\""), "imm");
@@ -1618,9 +1611,7 @@ md_assemble (char * str)
if ((temp != 0) && (temp != 0xFFFF8000))
{
/* Needs an immediate inst. */
- opcode1
- = (struct op_code_struct *) str_hash_find (opcode_hash_control,
- "imm");
+ opcode1 = str_hash_find (opcode_hash_control, "imm");
if (opcode1 == NULL)
{
as_bad (_("unknown opcode \"%s\""), "imm");
@@ -1686,9 +1677,7 @@ md_assemble (char * str)
if ((temp != 0) && (temp != 0xFFFF8000))
{
/* Needs an immediate inst. */
- opcode1
- = (struct op_code_struct *) str_hash_find (opcode_hash_control,
- "imm");
+ opcode1 = str_hash_find (opcode_hash_control, "imm");
if (opcode1 == NULL)
{
as_bad (_("unknown opcode \"%s\""), "imm");
@@ -1761,9 +1750,7 @@ md_assemble (char * str)
if ((temp != 0) && (temp != 0xFFFF8000))
{
/* Needs an immediate inst. */
- opcode1
- = (struct op_code_struct *) str_hash_find (opcode_hash_control,
- "imm");
+ opcode1 = str_hash_find (opcode_hash_control, "imm");
if (opcode1 == NULL)
{
as_bad (_("unknown opcode \"%s\""), "imm");
@@ -1885,17 +1872,15 @@ md_atof (int type, char * litP, int * sizeP)
{
for (i = prec - 1; i >= 0; i--)
{
- md_number_to_chars (litP, (valueT) words[i],
- sizeof (LITTLENUM_TYPE));
- litP += sizeof (LITTLENUM_TYPE);
+ md_number_to_chars (litP, words[i], sizeof (LITTLENUM_TYPE));
+ litP += sizeof (LITTLENUM_TYPE);
}
}
else
for (i = 0; i < prec; i++)
{
- md_number_to_chars (litP, (valueT) words[i],
- sizeof (LITTLENUM_TYPE));
- litP += sizeof (LITTLENUM_TYPE);
+ md_number_to_chars (litP, words[i], sizeof (LITTLENUM_TYPE));
+ litP += sizeof (LITTLENUM_TYPE);
}
return NULL;
@@ -2054,7 +2039,7 @@ md_apply_fix (fixS * fixP,
const char * file = fixP->fx_file ? fixP->fx_file : _("unknown");
const char * symname;
/* Note: use offsetT because it is signed, valueT is unsigned. */
- offsetT val = (offsetT) * valp;
+ offsetT val = *valp;
int i;
struct op_code_struct * opcode1;
unsigned long inst1;
@@ -2185,8 +2170,7 @@ md_apply_fix (fixS * fixP,
buf[i + INST_WORD_SIZE] = buf[i];
/* Generate the imm instruction. */
- opcode1
- = (struct op_code_struct *) str_hash_find (opcode_hash_control, "imm");
+ opcode1 = str_hash_find (opcode_hash_control, "imm");
if (opcode1 == NULL)
{
as_bad (_("unknown opcode \"%s\""), "imm");
@@ -2234,8 +2218,7 @@ md_apply_fix (fixS * fixP,
buf[i + INST_WORD_SIZE] = buf[i];
/* Generate the imm instruction. */
- opcode1
- = (struct op_code_struct *) str_hash_find (opcode_hash_control, "imm");
+ opcode1 = str_hash_find (opcode_hash_control, "imm");
if (opcode1 == NULL)
{
as_bad (_("unknown opcode \"%s\""), "imm");
@@ -2459,7 +2442,7 @@ md_pcrel_from_section (fixS * fixp, segT sec ATTRIBUTE_UNUSED)
we leave the add number alone for the linker to fix it later.
Only account for the PC pre-bump (No PC-pre-bump on the Microblaze). */
- if (fixp->fx_addsy != (symbolS *) NULL
+ if (fixp->fx_addsy != NULL
&& (!S_IS_DEFINED (fixp->fx_addsy)
|| (S_GET_SEGMENT (fixp->fx_addsy) != sec)))
return 0;