[PATCH] D71742: Added intrinsics for access to FP environment

Serge Pavlov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 15 10:23:32 PDT 2020


sepavloff marked 2 inline comments as done.
sepavloff added inline comments.


================
Comment at: llvm/include/llvm/IR/Intrinsics.td:649-651
+  def int_get_fpenv     : Intrinsic<[], [llvm_ptr_ty]>;
+  def int_set_fpenv     : Intrinsic<[], [llvm_ptr_ty]>;
+  def int_reset_fpenv   : Intrinsic<[], []>;
----------------
arsenm wrote:
> sepavloff wrote:
> > arsenm wrote:
> > > Using a pointer for this is problematic, and one with a hardcoded 0 address space doubly so
> > Changed type to `llvm_anyptr_ty`, which must support arbitrary address spaces.
> Accepting any address space is only a half-fix. Why not make this return llvm_anyint_ty, and define it as zext or truncated to the expected target size in the backend? This wouldn't require lowering to introduce stack usage for example for something that's usually read directly out of a register
> Why not make this return llvm_anyint_ty, and define it as zext or truncated to the expected target size in the backend?

In this case X86 represents FP environment as `i256`. It is not clear how to legalize this scalar type. Passing FPEnv through memory allows to avoid issues in legalization. For targets that get/set environment by simple register moves the intermediate stack slot is eliminated (see D81843). Well, almost eliminated, only write to stack slot remains, but it is DCE deficiency.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71742





More information about the llvm-commits mailing list