aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorJeff Law <jlaw@ventanamicro.com>2023-12-10 10:29:23 -0700
committerJeff Law <jlaw@ventanamicro.com>2023-12-10 10:29:23 -0700
commit73f6e1fe8835085ccc6de5c5f4428d47e853913b (patch)
treeb16753597fe272f8933cfcdc7e06a83a3ff0cd8a /gcc/c
parent1f55c5cc698519094f751257db62ff274c015fdc (diff)
downloadgcc-73f6e1fe8835085ccc6de5c5f4428d47e853913b.zip
gcc-73f6e1fe8835085ccc6de5c5f4428d47e853913b.tar.gz
gcc-73f6e1fe8835085ccc6de5c5f4428d47e853913b.tar.bz2
[committed] Provide patterns for signed bitfield extractions on H8
Inspired by Roger's work on the ARC port, this patch provides a define_and_split pattern to optimize sign extended bitfields starting at position 0 using an approach that doesn't require shifting. It then builds on that to provide another define_and_split pattern to support arbitrary signed bitfield extractions -- it uses a right logical shift to move the bitfield into position 0, then the specialized pattern above to sign extend the MSB of the field through the rest of the register. This is often, but certainly not always, better than a two shift approach. The code uses the sizes of the sequences to select between the two shift approach and single shift with extension from an arbitrary location approach. There's certainly further improvements that could be made here, but I think we're getting the bulk of the improvements already. Regression tested on the H8 port without errors. Installing on the trunk. gcc/ * config/h8300/h8300-protos.h (use_extvsi): Prototype. * config/h8300/combiner.md: Two new define_insn_and_split patterns to implement signed bitfield extractions. * config/h8300/h8300.cc (use_extvsi): New function.
Diffstat (limited to 'gcc/c')
0 files changed, 0 insertions, 0 deletions