On 7/31/25 2:35 AM, Kito Cheng wrote:
Previously, arch-canonicalize used hardcoded data to handle IMPLIED_EXT.
But this data often got out of sync with the actual C++ implementation.
Earlier, we introduced riscv-ext.def to keep track of all extension info
and generate docs. Now, arch-canonicalize also uses this same data to handle
extension implication rules directly.

One limitation is that conditional implication rules still need to be written
manually. Luckily, there aren't many of them for now, so it's still manageable.
I really wanted to avoid writing a C++ + Python binding or trying to parse C++
logic in Python...

This version also adds a `--selftest` option to run some unit tests.

gcc/ChangeLog:

        * config/riscv/arch-canonicalize: Read extension data from
        riscv-ext*.def and adding unittest.
Given it hits an area you know far better than I *and* it's python which I can barely read on a good day, my inclination is go for it whenever you think it's ready.

jeff

Reply via email to