]> git.ipfire.org Git - thirdparty/gcc.git/commit
xtensa: Make use of ROUND.S instruction
authorTakayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp>
Fri, 31 Oct 2025 06:22:35 +0000 (15:22 +0900)
committerMax Filippov <jcmvbkbc@gmail.com>
Sat, 1 Nov 2025 04:38:53 +0000 (21:38 -0700)
commit0e71df96e2e34d1d6163bdeab06edecb34fb1c16
tree5a2a80411cf1061b007afde1d536f4e20410b87c
parentd0c2849e8a30a24505ce90bb8dde402c45def674
xtensa: Make use of ROUND.S instruction

Due to inconsistencies in the behavior of rounding half, making this
machine instruction available was retracted in a previous commit (5f3b5b0616fe883e86e95d9476371cf87059ca7f),
but it may be useful to have it available if strict implementation of
floating-point arithmetic is not required.

gcc/ChangeLog:

* config/xtensa/xtensa.md
(c_enum "unspec", int_iterator ANY_ROUND): Add UNSPEC_ROUND.
(int_attr m_round): Add a pair of UNSPEC_ROUND and "round".
(int_attr c_round): New integer iterator attribute, that expands
to "flag_unsafe_math_optimizations" in the case of UNSPEC_ROUND,
and to "1" otherwise.
(l<m_round>sfsi2, *l<m_round>sfsi2_2x, *l<m_round>sfsi2_scaled):
Append " && <c_round>" to the conditions.
gcc/config/xtensa/xtensa.md