[PATCH] D54121: [FPEnv] Add constrained FCMP intrinsic

Andy Kaylor via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 5 16:17:05 PST 2018


andrew.w.kaylor added a comment.

This is definitely a tricky case. I don't really like any of the available solutions. I'll try to think more about it, and maybe someone else will have a brilliant suggestion.



================
Comment at: include/llvm/IR/Intrinsics.td:595
                                                        llvm_metadata_ty ]>;
+  def int_experimental_constrained_fcmp : Intrinsic<[ llvm_anyint_ty ],
+                                                    [ llvm_i8_ty,
----------------
This can't be 'any' int type. It needs to be either i1 or a vector of i1, right?


================
Comment at: include/llvm/IR/Intrinsics.td:596
+  def int_experimental_constrained_fcmp : Intrinsic<[ llvm_anyint_ty ],
+                                                    [ llvm_i8_ty,
+                                                      llvm_anyfloat_ty,
----------------
I don't like this. If you define this as an i8 the constant will get hard-coded in the IR. So instead of 'oeq' you'll see '1' or '2' or something. The reason I used metadata arguments for rounding mode and exception behavior was to allow readable strings.


Repository:
  rL LLVM

https://reviews.llvm.org/D54121





More information about the llvm-commits mailing list