[libcxx-commits] [PATCH] D91349: [libc++] hash<long double>: adjust for ILP32

Harald van Dijk via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Nov 12 06:39:02 PST 2020


hvdijk created this revision.
hvdijk added a project: libc++.
Herald added subscribers: libcxx-commits, pengfei.
Herald added a reviewer: libc++.
hvdijk requested review of this revision.

x86-64 ILP32 mode (x32) uses 32-bit size_t, so share the code with ix86 to zero out padding bits, not with x86-64 LP64 mode.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91349

Files:
  libcxx/include/utility


Index: libcxx/include/utility
===================================================================
--- libcxx/include/utility
+++ libcxx/include/utility
@@ -1506,7 +1506,7 @@
         // -0.0 and 0.0 should return same hash
         if (__v == 0.0L)
             return 0;
-#if defined(__i386__)
+#if defined(__i386__) || (defined(__x86_64__) && defined(__ILP32__))
         // Zero out padding bits
         union
         {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91349.304819.patch
Type: text/x-patch
Size: 425 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20201112/befd6eb1/attachment.bin>


More information about the libcxx-commits mailing list