GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc/cris

CRIS: Add patterns for bit-field tests feeding conditional stores

New CRIS patterns improve handling of bit-field tests for conditional stores.

This commit adds new patterns to the CRIS backend for handling bit-field tests that feed conditional store instructions. Spotted during work on another bug fix (PR126276), these patterns improve the compiler’s ability to generate efficient code for specific bit manipulation scenarios on the CRIS architecture. The single-bit case is noted as being left for later.

In Details

The CRIS backend's config/cris/cris.md file defines machine instructions. This patch introduces new define_insn_and_split patterns, specifically *cstore<mode>4_btstqb0_<CC>, which handle the generation of code for testing a bit field and subsequently using that result to conditionally store data. This is relevant for optimizing code that manipulates individual bits within larger fields before making decisions about storage. The omission was discovered while working on PR126276.

For Context
CRIS
A family of 16-bit microprocessors developed by Axis Communications. GCC has a backend for this architecture.
bit field
A contiguous sequence of bits within a larger data type, often used for fine-grained control of data representation or status flags.
conditional store
A memory write operation that is only performed if a certain condition is met, typically based on the result of a preceding comparison or test.
pattern
In compiler backends, a pattern describes a target machine instruction or a sequence of instructions, often using placeholders for operands. These are used by the compiler to match intermediate representations and generate code.
Filed Under: crisoptimizationarchitecture