[PATCH] D82359: [Power10] Implement Vector Replace Builtins in LLVM/Clang

Biplob Mishra via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 6 12:54:13 PDT 2020


biplmish added inline comments.


================
Comment at: clang/lib/Headers/altivec.h:17037
+  })(x))                                                                       \
+      .ui
+#define DP2LL(x)                                                               \
----------------
lei wrote:
> This looks just like a cast to `unsigned int`, can you explain why it needs to be cast to a union to extract the unsigned int instead of just directly casting it to an `unsigned int`?
The intrinsic implements the input2 argument as i64. When the input to the function is of type float/double it generates fptoui which can modify the user input value.
Cast to union is done to preserve the float value and the same reaches the hw instruction.


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

https://reviews.llvm.org/D82359





More information about the llvm-commits mailing list