arm: avoid use of GNU builtin function in s_arm_unwind_save_mixed
authorRichard Earnshaw <rearnsha@arm.com>
Thu, 26 May 2022 10:05:59 +0000 (11:05 +0100)
committerRichard Earnshaw <rearnsha@arm.com>
Thu, 26 May 2022 10:05:59 +0000 (11:05 +0100)
commit20d814202abb0af6f1f37880e3a473362465eaae
tree4641e5f5efb459fc84065d1c3829c59e0e5b09aa
parent284b6bb5c639735735246c4c60c0e06427e5c449
 arm: avoid use of GNU builtin function in s_arm_unwind_save_mixed

Whilst reviewing Luis' proposed change to s_arm_unwind_save_mixed
yesterday I noticed that we were making use of __builting_clzl
directly within the main function, which is not guaranteed to be
portable.  Whilst studying the code further, I also realized that it
could be rewritten without using it and also reworked to remove a lot
of unnecessary iterations steps.  So this patch does that (and also
removes the source of the warning that Luis was trying to fix).
Finally, with the rewrite we can also simplify the caller of this
routine as the new version can handle all the cases directly.

* config/tc-arm.c (s_arm_unwind_save_mixed): Rewrite without
using __builtin_clzl.
(s_arm_unwind_save): Simplify logic for simple/mixed register saves.
gas/config/tc-arm.c