RISC-V: simple optimization of ConvHF2F

XMLWordPrintable

    • b04
    • riscv

        ConvHF2F could be optimized by following patch.
        As riscv does not have the restriction to use `iRegINoSp` in src register, it can use iRegIorL2I instead.
        Check other usages of src register in riscv.ad file.

        diff --git a/src/hotspot/cpu/riscv/riscv.ad b/src/hotspot/cpu/riscv/riscv.ad
        index 96984ba9a42..730dd68dd88 100644
        --- a/src/hotspot/cpu/riscv/riscv.ad
        +++ b/src/hotspot/cpu/riscv/riscv.ad
        @@ -8542,7 +8542,7 @@ instruct convD2F_reg(fRegF dst, fRegD src) %{
         
         // single <-> half precision
         
        -instruct convHF2F_reg_reg(fRegF dst, iRegINoSp src, iRegINoSp tmp) %{
        +instruct convHF2F_reg_reg(fRegF dst, iRegIorL2I src, iRegINoSp tmp) %{
           match(Set dst (ConvHF2F src));
           effect(TEMP tmp);
           format %{ "fmv.h.x $dst, $src\t# move source from $src to $dst\n\t"

              Assignee:
              Hamlin Li
              Reporter:
              Hamlin Li
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: