kvx.patch 1.1 KB

1234567891011121314151617181920212223242526272829
  1. From 234938d8b7df2f069c6cbbaff47eb2ba338ec532 Mon Sep 17 00:00:00 2001
  2. From: Paul Iannetta <piannetta@kalrayinc.com>
  3. Date: Mon, 4 Sep 2023 15:31:53 +0200
  4. Subject: [PATCH] kvx: gas: fix the detection of negative powers of 2
  5. gas/ChangeLog:
  6. 2023-09-04 Paul Iannetta <piannetta@kalrayinc.com>
  7. * config/kvx-parse.c (get_token_class): Use the signed value.
  8. ---
  9. gas/config/kvx-parse.c | 2 +-
  10. 1 file changed, 1 insertion(+), 1 deletion(-)
  11. diff --git a/gas/config/kvx-parse.c b/gas/config/kvx-parse.c
  12. index bb51c861625..0bd6b75ef30 100644
  13. --- a/gas/config/kvx-parse.c
  14. +++ b/gas/config/kvx-parse.c
  15. @@ -525,7 +525,7 @@ get_token_class (struct token_s *token, struct token_classes *classes, int insn_
  16. : strtoull (tok + (tok[0] == '-') + (tok[0] == '+'), NULL, 0));
  17. int64_t val = uval;
  18. int64_t pval = val < 0 ? -uval : uval;
  19. - int neg_power2_p = val < 0 && !(uval & (uval - 1));
  20. + int neg_power2_p = val < 0 && !(pval & (pval - 1));
  21. unsigned len = pval ? 8 * sizeof (pval) - __builtin_clzll (pval) : 0;
  22. while (class[cur].class_id != -1
  23. && ((unsigned) (class[cur].sz < 0