aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorPaul Iannetta <piannetta@kalrayinc.com>2023-08-23 16:39:22 +0200
committerAlan Modra <amodra@gmail.com>2023-08-24 12:36:25 +0930
commitaf6242628aa3c5fca778e0ecb22060d5f9f0d59a (patch)
tree1227d5c5fdcd7f3235f7cdf2dab9e37d70436234 /gas
parent66644c5dc3d61b5cabefba7f0ddb467c2ca750ed (diff)
downloadgdb-af6242628aa3c5fca778e0ecb22060d5f9f0d59a.zip
gdb-af6242628aa3c5fca778e0ecb22060d5f9f0d59a.tar.gz
gdb-af6242628aa3c5fca778e0ecb22060d5f9f0d59a.tar.bz2
kvx: use {u,}int32_t and {u,}int64_t
gas/ * config/kvx-parse.c (promote_token): Use {u,}int32_t and {u,}int64_t. (get_token_class): Likewise. * config/tc-kvx.c (insert_operand): Likewise. * config/tc-kvx.h (struct token_s): Likewise. (struct token_list): Likewise. opcodes/ * kvx-dis.c (struct decoded_insn): Use {u,}int32_t and {u,}int64_t. (decode_insn): Likewise. (print_insn_kvx): Likewise. (decode_prologue_epilogue_bundle): Likewise. * kvx-dis.h (struct kvx_prologue_epilogue_insn): Likewise.
Diffstat (limited to 'gas')
-rw-r--r--gas/config/kvx-parse.c20
-rw-r--r--gas/config/tc-kvx.c8
-rw-r--r--gas/config/tc-kvx.h10
3 files changed, 19 insertions, 19 deletions
diff --git a/gas/config/kvx-parse.c b/gas/config/kvx-parse.c
index af207be..bb51c86 100644
--- a/gas/config/kvx-parse.c
+++ b/gas/config/kvx-parse.c
@@ -396,10 +396,10 @@ print_token (struct token_s token, char *buf, int bufsz)
buf[i] = 0;
}
-static long long
+static int64_t
promote_token (struct token_s tok)
{
- long long cur_class = tok.class_id & -tok.class_id;
+ int64_t cur_class = tok.class_id & -tok.class_id;
switch (tok.category)
{
case CAT_REGISTER:
@@ -414,8 +414,8 @@ promote_token (struct token_s tok)
input_line_pointer = tok.insn + tok.begin;
expression (&exp);
input_line_pointer = ilp_save;
- long long new_class_id = tok.class_id;
- long long old_class_id = tok.class_id;
+ int64_t new_class_id = tok.class_id;
+ int64_t old_class_id = tok.class_id;
while (((new_class_id = env.promote_immediate (old_class_id))
!= old_class_id)
&& ((exp.X_op == O_symbol
@@ -451,7 +451,7 @@ is_insn (const struct token_s *token, struct token_class *classes)
return res;
}
-static long long
+static int64_t
get_token_class (struct token_s *token, struct token_classes *classes, int insn_p, int modifier_p)
{
int cur = 0;
@@ -519,12 +519,12 @@ get_token_class (struct token_s *token, struct token_classes *classes, int insn_
if (class == classes->imm_classes)
{
- unsigned long long uval
+ uint64_t uval
= (token_val_p
? token->val
: strtoull (tok + (tok[0] == '-') + (tok[0] == '+'), NULL, 0));
- long long val = uval;
- long long pval = val < 0 ? -uval : uval;
+ int64_t val = uval;
+ int64_t pval = val < 0 ? -uval : uval;
int neg_power2_p = val < 0 && !(uval & (uval - 1));
unsigned len = pval ? 8 * sizeof (pval) - __builtin_clzll (pval) : 0;
while (class[cur].class_id != -1
@@ -821,7 +821,7 @@ retry:;
parse_with_restarts (tok, cur_rule[i].jump_target, rules, errs);
/* While parsing fails but there is hope since the current token can be
promoted. */
- while (!fst_part && tok.class_id != (long long) promote_token (tok))
+ while (!fst_part && tok.class_id != (int64_t) promote_token (tok))
{
free_token_list (fst_part);
tok.class_id = promote_token (tok);
@@ -871,7 +871,7 @@ retry:;
printf_debug (1, "snd_part: Trying to match: %s\n", TOKEN_NAME (CLASS_ID (tok)));
struct token_list *snd_part = parse_with_restarts (tok, cur_rule[i].stack_it, rules, errs);
- while (!snd_part && tok.class_id != (long long) promote_token (tok))
+ while (!snd_part && tok.class_id != (int64_t) promote_token (tok))
{
tok.class_id = promote_token (tok);
printf_debug (1, ">> Restart with %s?\n", TOKEN_NAME (CLASS_ID (tok)));
diff --git a/gas/config/tc-kvx.c b/gas/config/tc-kvx.c
index be8bc7d..c9cb8ad 100644
--- a/gas/config/tc-kvx.c
+++ b/gas/config/tc-kvx.c
@@ -458,7 +458,7 @@ static int
insert_operand (struct kvxinsn *insn, struct kvx_operand *opdef,
struct token_list *tok)
{
- unsigned long long op = 0;
+ uint64_t op = 0;
struct kvx_bitfield *bfields = opdef->bfield;
int bf_nb = opdef->bitfields;
int immx_ready = 0;
@@ -570,7 +570,7 @@ insert_operand (struct kvxinsn *insn, struct kvx_operand *opdef,
{
/* This is a immediate: either a regular immediate, or an
immediate that was saved in a variable through `.equ'. */
- unsigned long long sval = (long long) tok->val;
+ uint64_t sval = (int64_t) tok->val;
op = opdef->flags & kvxSIGNED ? sval : tok->val;
op >>= opdef->shift;
}
@@ -661,8 +661,8 @@ insert_operand (struct kvxinsn *insn, struct kvx_operand *opdef,
for (int bf_idx = 0; bf_idx < bf_nb; bf_idx++)
{
- unsigned long long value =
- ((unsigned long long) op >> bfields[bf_idx].from_offset);
+ uint64_t value =
+ ((uint64_t) op >> bfields[bf_idx].from_offset);
int j = 0;
int to_offset = bfields[bf_idx].to_offset;
value &= (1LL << bfields[bf_idx].size) - 1;
diff --git a/gas/config/tc-kvx.h b/gas/config/tc-kvx.h
index efb5725..4d29f01 100644
--- a/gas/config/tc-kvx.h
+++ b/gas/config/tc-kvx.h
@@ -46,15 +46,15 @@ struct token_s {
char *insn;
int begin, end;
int category;
- long long class_id;
- unsigned long long val;
+ int64_t class_id;
+ uint64_t val;
};
struct token_list
{
char *tok;
- unsigned long long val;
- long long class_id;
+ uint64_t val;
+ int64_t class_id;
int category;
int loc;
struct token_list *next;
@@ -64,7 +64,7 @@ struct token_list
struct token_class {
const char ** class_values;
- long long class_id;
+ int64_t class_id;
int sz;
};