5 Commits

Author SHA1 Message Date
Weining Lu
26021577d1 [LoongArch] Optimize (and (a & ~((2^^X - 1) << Y)) to (bstrins a, zero, X+Y-1, Y)
Inspired by D158384.

Differential Revision: https://reviews.llvm.org/D158832
2023-08-28 08:36:54 +08:00
wanglei
1bb7766489 [LoongArch] Optimize stack realignment using BSTRINS instruction
Prior to this change, stack realignment was achieved using the SRLI/SLLI
instructions in two steps. With this patch, stack realignment is
optimized using a single `BSTRINS` instruction.

Reviewed By: SixWeining, xen0n

Differential Revision: https://reviews.llvm.org/D158384
2023-08-23 09:21:42 +08:00
Ben Shi
96dcd8cb94 [LoongArch] Optimize bitwise and with immediates
Optimize bitfield extractions retaining bit positions
from 'lu12i + addi + and' to 'bstrpick + slli'.

Reviewed By: xen0n, SixWeining

Differential Revision: https://reviews.llvm.org/D147368
2023-04-03 12:10:07 +08:00
Nikita Popov
779df38242 [LoongArch] Convert tests to opaque pointers (NFC) 2023-01-16 10:20:46 +01:00
wanglei
daf067da04 [LoongArch] Stack realignment support
This patch adds support for stack realignment while adding support for
variable sized objects.

Differential Revision: https://reviews.llvm.org/D136074
2022-10-21 17:30:29 +08:00