Regtested for target=xtensa-linux-uclibc, no new regressions.
Committed to master.
On Mon, Jun 16, 2025 at 11:56 PM Takayuki 'January June' Suwa
<jjsuwa_sys3...@yahoo.co.jp> wrote:
>
> This patch implements bitfield insertion MD pattern using the DEPBITS
> machine instruction, the counterpart of the EXTUI instruction, if
> available.
>
>      /* example */
>      struct foo {
>        unsigned int b:10;
>        unsigned int r:11;
>        unsigned int g:11;
>      };
>      void test(struct foo *p) {
>        p->g >>= 1;
>      }
>
>      ;; result (endianness: little)
>      test:
>         entry   sp, 32
>         l32i.n  a8, a2, 0
>         extui   a9, a8, 1, 10
>         depbits a8, a9, 0, 11
>         s32i.n  a8, a2, 0
>         retw.n
>
> include/ChangeLog:
>
>         * xtensa-config.h (XCHAL_HAVE_CLAMPS, XCHAL_HAVE_DEPBITS):
>         New macro, and some cosmetics.

This file is to support the old configuration method that uses overlays
and shouldn't be changed.

> gcc/ChangeLog:
>
>         * config/xtensa/xtensa.h (TARGET_DEPBITS): New macro.
>         * config/xtensa/xtensa.md (insvsi): New insn pattern.
> ---
>   gcc/config/xtensa/xtensa.h  |  1 +
>   gcc/config/xtensa/xtensa.md | 21 ++++++++++++++++++++-
>   include/xtensa-config.h     | 14 ++++++++------
>   3 files changed, 29 insertions(+), 7 deletions(-)

Regtested for target=xtensa-linux-uclibc, no new regressions.
I don't have a working config with DEPBITS option, just checked
that it doesn't break anything for other configs.
Committed to master without the include/xtensa-config.h part.

-- 
Thanks.
-- Max

Reply via email to