Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8297715

RISC-V: C2: Use single-bit instructions from the Zbs extension

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 20
    • 20
    • hotspot
    • None
    • b27
    • riscv
    • linux

        The single-bit instructions from the Zbs extension provide a mechanism to set, clear, invert, or extract a single bit in a register. The bit is specified by its index.

        Especially, the single-bit extract (immediate) instruction 'bexti rd, rs1, shamt' performs this operation:

        ```
          let index = shamt & (XLEN - 1);
          X(rd) = (X(rs1) >> index) & 1;
        ```

        This instruction could be used to match for following sub-graph in C2 where integer immediate 'mask' is power of 2:
        '''
           Set dst (Conv2B (AndI src mask))
        '''

              fyang Fei Yang
              fyang Fei Yang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: