[PATCH] D125980: [AArch64] Fix the generation of BE Nops

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 20 01:31:13 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1379b150991f: [AArch64] Fix the generation of BE Nops (authored by dmgreen).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125980

Files:
  llvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp
  llvm/test/MC/AArch64/align.s


Index: llvm/test/MC/AArch64/align.s
===================================================================
--- /dev/null
+++ llvm/test/MC/AArch64/align.s
@@ -0,0 +1,14 @@
+// RUN: llvm-mc -filetype=obj -triple aarch64-none-eabi %s | llvm-objdump -d - | FileCheck %s
+// RUN: llvm-mc -filetype=obj -triple aarch64_be-none-eabi %s | llvm-objdump -d - | FileCheck %s
+
+// CHECK:   0: 00 00 80 d2   mov     x0, #0
+// CHECK:   4: 00 00 80 d2   mov     x0, #0
+// CHECK:   8: 1f 20 03 d5   nop
+// CHECK:   c: 1f 20 03 d5   nop
+// CHECK:  10: 00 00 80 d2   mov     x0, #0
+
+       .text
+       mov x0, #0
+       mov x0, #0
+       .p2align 4
+       mov x0, #0
Index: llvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp
===================================================================
--- llvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp
+++ llvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp
@@ -471,7 +471,7 @@
   // We are properly aligned, so write NOPs as requested.
   Count /= 4;
   for (uint64_t i = 0; i != Count; ++i)
-    support::endian::write<uint32_t>(OS, 0xd503201f, Endian);
+    OS.write("\x1f\x20\x03\xd5", 4);
   return true;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125980.430902.patch
Type: text/x-patch
Size: 1175 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220520/d0f90414/attachment.bin>


More information about the llvm-commits mailing list