[PATCH] D81843: [ARM][FPEnv] Lowering of {get,set,reset}_fpenv

Serge Pavlov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 12 23:46:31 PST 2023


sepavloff added a comment.

The patch was reverted because it caused fail on a buildbot with expensive checks. It detected that `vmsr` does not allow immediate as a source. I am going to modify this commit:

  diff --git a/llvm/lib/Target/ARM/ARMInstrVFP.td b/llvm/lib/Target/ARM/ARMInstrVFP.td
  index 7898972ee278..9b1224c7e1e3 100644
  --- a/llvm/lib/Target/ARM/ARMInstrVFP.td
  +++ b/llvm/lib/Target/ARM/ARMInstrVFP.td
  @@ -2673,7 +2673,7 @@ 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))>;
   
   //===----------------------------------------------------------------------===//
   // Assembler aliases.
  diff --git a/llvm/test/CodeGen/ARM/fpenv.ll b/llvm/test/CodeGen/ARM/fpenv.ll
  index f5c6a9608bac..40db627ebb3c 100644
  --- a/llvm/test/CodeGen/ARM/fpenv.ll
  +++ b/llvm/test/CodeGen/ARM/fpenv.ll
  @@ -1,5 +1,5 @@
   ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
  -; RUN: llc -mtriple=arm-eabi -float-abi=soft -mattr=+vfp2 %s -o - | FileCheck %s
  +; RUN: llc -mtriple=arm-eabi -float-abi=soft -mattr=+vfp2 --verify-machineinstrs %s -o - | FileCheck %s
   
   define void @func_02(i32 %rm) {
   ; CHECK-LABEL: func_02:
  @@ -134,7 +134,8 @@ entry:
   define void @reset_fpenv_02() nounwind {
   ; CHECK-LABEL: reset_fpenv_02:
   ; CHECK:       @ %bb.0: @ %entry
  -; CHECK-NEXT:    vmsr fpscr, #0
  +; CHECK-NEXT:    mov r0, #0
  +; CHECK-NEXT:    vmsr fpscr, r0
   ; CHECK-NEXT:    mov pc, lr
   entry:
     call void @llvm.reset.fpenv()

If there are no objections, I will commit the modified patch.


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