[PATCH] D141560: [RISCV][CodeGen] Add codegen pattern for FLI instruction in experimental zfa extension

Jun Sha via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 15 19:35:10 PDT 2023


joshua-arch1 added a comment.



In D141560#4198233 <https://reviews.llvm.org/D141560#4198233>, @craig.topper wrote:

> In D141560#4198220 <https://reviews.llvm.org/D141560#4198220>, @joshua-arch1 wrote:
>
>> Anyone knows how to generate FLI from C-code? If I compile the following program, I cannot get FlI. ConstantFP will be converted to Constant in DAG.
>>
>>   void foo_double64 ()
>>   {
>>     volatile double a;
>>     a = 0.0625;
>>   }
>
> You just need to use it to do some floating point arithmetic
>
>   void foo_double64 (double x)
>   {
>     volatile double a;
>     a = x + 0.0625;
>   }
>
> or return a floating point value
>
>   double foo_double64 ()
>   {
>     return 0.0625;
>   }

Is that because we cannot directly store a ConstantFP in DAG?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141560



More information about the llvm-commits mailing list