[committed] arm: avoid use of GNU builtin function in s_arm_unwind_save_mixed

Richard Earnshaw rearnsha@arm.com
Thu May 26 10:08:24 GMT 2022


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 | 57 ++++++++++++++-------------------------------
 1 file changed, 17 insertions(+), 40 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-arm-avoid-use-of-GNU-builtin-function-in-s_arm_unwin.patch
Type: text/x-patch
Size: 2109 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20220526/a03c9ba8/attachment-0001.bin>


More information about the Binutils mailing list