https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126671

            Bug ID: 126671
           Summary: bitreverse could be hooked up for zbkb
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---
            Target: riscv

```
int f(int a)
{
    return __builtin_bitreverse32(a);
}
```

For -march=rv64gcb_zicond_zbkb should produce:

```
f:
        rev8    a0, a0
        brev8   a0, a0
        srai    a0, a0, 32
        ret
````

Like LLVM

Reply via email to