[PATCH] D64996: [libunwind][ARM] Fix loading FP registers on big-endian targets

Mikhail Maltsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 19 08:20:16 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL366587: [libunwind][ARM] Fix loading FP registers on big-endian targets (authored by miyuki, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D64996?vs=210836&id=210842#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D64996

Files:
  libunwind/trunk/src/Unwind-EHABI.cpp


Index: libunwind/trunk/src/Unwind-EHABI.cpp
===================================================================
--- libunwind/trunk/src/Unwind-EHABI.cpp
+++ libunwind/trunk/src/Unwind-EHABI.cpp
@@ -941,8 +941,13 @@
       // format 1", which is equivalent to FSTMD + a padding word.
       for (uint32_t i = first; i < end; ++i) {
         // SP is only 32-bit aligned so don't copy 64-bit at a time.
-        uint64_t value = *sp++;
-        value |= ((uint64_t)(*sp++)) << 32;
+        uint32_t w0 = *sp++;
+        uint32_t w1 = *sp++;
+#ifdef __LITTLE_ENDIAN__
+        uint64_t value = (w1 << 32) | w0;
+#else
+        uint64_t value = (w0 << 32) | w1;
+#endif
         if (_Unwind_VRS_Set(context, regclass, i, representation, &value) !=
             _UVRSR_OK)
           return _UVRSR_FAILED;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64996.210842.patch
Type: text/x-patch
Size: 801 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190719/d32aa0e6/attachment.bin>


More information about the llvm-commits mailing list