[PATCH] D81843: [ARM][FPEnv] Lowering of {get,set,reset}_fpenv
John Brawn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 31 07:12:14 PDT 2023
john.brawn 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);
----------------
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).
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