[PATCH] D81843: [ARM][FPEnv] Lowering of {get,set,reset}_fpenv
Serge Pavlov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 3 09:38:31 PDT 2023
sepavloff added inline comments.
================
Comment at: llvm/lib/Target/ARM/ARMISelLowering.cpp:6444-6472
+SDValue ARMTargetLowering::LowerGET_FPENV(SDValue Op, SelectionDAG &DAG) const {
+ SDLoc DL(Op);
+ SDValue Chain = Op->getOperand(0);
+ SDValue Ops[] = {Chain,
+ DAG.getConstant(Intrinsic::arm_get_fpscr, DL, MVT::i32)};
+ SDValue FPSCR =
+ DAG.getNode(ISD::INTRINSIC_W_CHAIN, DL, {MVT::i32, MVT::Other}, Ops);
----------------
john.brawn wrote:
> This could be done more simply by setting these nodes to Legal having tablegen patterns instead, e.g.
>
> ```
> def : Pat<(get_fpenv), (VMRS)>;
> def : Pat<(set_fpenv GPRnopc:$Rt), (VMSR GPRnopc:$Rt)>;
> def : Pat<(reset_fpenv), (VMSR 0)>;
> ```
> (though it requires get_fpenv etc. nodes being added to TargetSelectionDAG.td).
Indeed, this is much better.
Thank you!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D81843/new/
https://reviews.llvm.org/D81843
More information about the llvm-commits
mailing list