[PATCH] D75729: [RISCV] Select +0.0 immediate using fcvt.{d, s}.{x, w} fN, x0

Roger Ferrer Ibanez via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 9 10:14:08 PDT 2020


rogfer01 added a comment.

A quick check with the GCC 10 in Fedora Rawhide shows the following results for this small testcase

  float zero_float(void)
  {
    return 0;
  }
  
  double zero_double(void)
  {
    return 0;
  }



|               | `-march=rv32gc -mabi=ilp32d` | `-march=rv64gc -mabi=lp64d` |
| `zero_float`  | `fmv.s.x`                    | `fmv.s.x`                   |
| `zero_double` | `fcvt.d.w`                   | `fmv.d.x`                   |
|

Perhaps these are slightly better than just `fcvt` everywhere because they avoid the rounding mode required by  `fcvt.s.w` / `fcvt.s.l`  / `fcvt.d.l`?

I'm happy to use those `fmv.{s,d}.x` instead.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75729/new/

https://reviews.llvm.org/D75729





More information about the llvm-commits mailing list