aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-tilegx.c
diff options
context:
space:
mode:
Diffstat (limited to 'gas/config/tc-tilegx.c')
-rw-r--r--gas/config/tc-tilegx.c54
1 files changed, 23 insertions, 31 deletions
diff --git a/gas/config/tc-tilegx.c b/gas/config/tc-tilegx.c
index 26612ac..84daf05 100644
--- a/gas/config/tc-tilegx.c
+++ b/gas/config/tc-tilegx.c
@@ -275,7 +275,7 @@ md_begin (void)
/* Initialize special operator hash table. */
special_operator_hash = str_htab_create ();
#define INSERT_SPECIAL_OP(name) \
- str_hash_insert (special_operator_hash, #name, (void *) O_##name, 0)
+ str_hash_insert_int (special_operator_hash, #name, O_##name, 0)
INSERT_SPECIAL_OP (hw0);
INSERT_SPECIAL_OP (hw1);
@@ -285,7 +285,7 @@ md_begin (void)
INSERT_SPECIAL_OP (hw1_last);
INSERT_SPECIAL_OP (hw2_last);
/* hw3_last is a convenience alias for the equivalent hw3. */
- str_hash_insert (special_operator_hash, "hw3_last", (void *) O_hw3, 0);
+ str_hash_insert_int (special_operator_hash, "hw3_last", O_hw3, 0);
INSERT_SPECIAL_OP (hw0_got);
INSERT_SPECIAL_OP (hw0_last_got);
INSERT_SPECIAL_OP (hw1_last_got);
@@ -329,14 +329,14 @@ md_begin (void)
{
char buf[64];
- str_hash_insert (main_reg_hash, tilegx_register_names[i],
- (void *) (long) (i | CANONICAL_REG_NAME_FLAG), 0);
+ str_hash_insert_int (main_reg_hash, tilegx_register_names[i],
+ i | CANONICAL_REG_NAME_FLAG, 0);
/* See if we should insert a noncanonical alias, like r63. */
sprintf (buf, "r%d", i);
if (strcmp (buf, tilegx_register_names[i]) != 0)
- str_hash_insert (main_reg_hash, xstrdup (buf),
- (void *) (long) (i | NONCANONICAL_REG_NAME_FLAG), 0);
+ str_hash_insert_int (main_reg_hash, xstrdup (buf),
+ i | NONCANONICAL_REG_NAME_FLAG, 0);
}
}
@@ -441,25 +441,25 @@ apply_special_operator (operatorT op, offsetT num, const char *file,
check_shift = 0;
/* Fall through. */
case O_hw0:
- ret = (signed short)num;
+ ret = (int16_t) num;
break;
case O_hw1_last:
check_shift = 16;
/* Fall through. */
case O_hw1:
- ret = (signed short)(num >> 16);
+ ret = (int16_t) (num >> 16);
break;
case O_hw2_last:
check_shift = 32;
/* Fall through. */
case O_hw2:
- ret = (signed short)(num >> 32);
+ ret = (int16_t) (num >> 32);
break;
case O_hw3:
- ret = (signed short)(num >> 48);
+ ret = (int16_t) (num >> 48);
break;
default:
@@ -959,10 +959,8 @@ tilegx_flush_bundle (void)
/* Figure out what pipe the fnop must be in via arithmetic.
* p0 + p1 + p2 must sum to the sum of TILEGX_PIPELINE_Y[012]. */
current_bundle[0].pipe =
- (tilegx_pipeline)((TILEGX_PIPELINE_Y0
- + TILEGX_PIPELINE_Y1
- + TILEGX_PIPELINE_Y2) -
- (current_bundle[1].pipe + current_bundle[2].pipe));
+ (TILEGX_PIPELINE_Y0 + TILEGX_PIPELINE_Y1 + TILEGX_PIPELINE_Y2
+ - current_bundle[1].pipe - current_bundle[2].pipe);
}
check_illegal_reg_writes ();
@@ -1027,10 +1025,10 @@ tilegx_parse_name (char *name, expressionS *e, char *nextcharP)
else
{
/* Look up the operator in our table. */
- void* val = str_hash_find (special_operator_hash, name);
- if (val == 0)
+ int opint = str_hash_find_int (special_operator_hash, name);
+ if (opint < 0)
return 0;
- op = (operatorT)(long)val;
+ op = opint;
}
/* Restore old '(' and skip it. */
@@ -1083,23 +1081,17 @@ tilegx_parse_name (char *name, expressionS *e, char *nextcharP)
static void
parse_reg_expression (expressionS* expression)
{
- char *regname;
- char terminating_char;
- void *pval;
- int regno_and_flags;
- int regno;
-
/* Zero everything to make sure we don't miss any flags. */
memset (expression, 0, sizeof *expression);
- terminating_char = get_symbol_name (&regname);
+ char *regname;
+ char terminating_char = get_symbol_name (&regname);
- pval = str_hash_find (main_reg_hash, regname);
- if (pval == NULL)
+ int regno_and_flags = str_hash_find_int (main_reg_hash, regname);
+ if (regno_and_flags < 0)
as_bad (_("Expected register, got '%s'."), regname);
- regno_and_flags = (int)(size_t)pval;
- regno = EXTRACT_REGNO(regno_and_flags);
+ int regno = EXTRACT_REGNO(regno_and_flags);
if ((regno_and_flags & NONCANONICAL_REG_NAME_FLAG)
&& require_canonical_reg_names)
@@ -1357,7 +1349,7 @@ md_atof (int type, char *litP, int *sizeP)
the bigendian 386. */
for (wordP = words + prec - 1; prec--;)
{
- md_number_to_chars (litP, (valueT) (*wordP--), sizeof (LITTLENUM_TYPE));
+ md_number_to_chars (litP, *wordP--, sizeof (LITTLENUM_TYPE));
litP += sizeof (LITTLENUM_TYPE);
}
return 0;
@@ -1473,7 +1465,7 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED)
|| fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
return;
- if (fixP->fx_subsy != (symbolS *) NULL)
+ if (fixP->fx_subsy != NULL)
{
/* We can't actually support subtracting a symbol. */
as_bad_subtract (fixP);
@@ -1684,7 +1676,7 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED)
ORing in values is OK since we know the existing bits for
this operand are zero. */
for (; bits != 0; bits >>= 8)
- *p++ |= (char)bits;
+ *p++ |= bits;
}
else
{