[PATCH] D81843: [ARM][FPEnv] Lowering of {get,set,reset}_fpenv
Serge Pavlov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 15 06:57:56 PST 2023
sepavloff added a comment.
In D81843#4656796 <https://reviews.llvm.org/D81843#4656796>, @john.brawn wrote:
> That would cause an invalid instruction to be emitted when compiling for thumb. I think you need one pattern using MOVi marked with Requires<[IsARM]>, and another using tMOVi8 marked with Requires<[IsThumb]>.
Thank you for advice! Now the problem place looks like:
--- a/llvm/lib/Target/ARM/ARMInstrVFP.td
+++ b/llvm/lib/Target/ARM/ARMInstrVFP.td
@@ -2673,7 +2673,8 @@ def : Pat<(f32 (vfp_f32f16imm:$imm)),
// Floating-point environment management.
def : Pat<(get_fpenv), (VMRS)>;
def : Pat<(set_fpenv GPRnopc:$Rt), (VMSR GPRnopc:$Rt)>;
-def : Pat<(reset_fpenv), (VMSR 0)>;
+def : Pat<(reset_fpenv), (VMSR (MOVi 0))>, Requires<[IsARM]>;
+def : Pat<(reset_fpenv), (VMSR (tMOVi8 0))>, Requires<[IsThumb]>;
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