[llvm-branch-commits] [llvm-branch] r195619 - Merging r195591:

Bill Wendling isanbard at gmail.com
Sun Nov 24 22:23:37 PST 2013


Author: void
Date: Mon Nov 25 00:23:37 2013
New Revision: 195619

URL: http://llvm.org/viewvc/llvm-project?rev=195619&view=rev
Log:
Merging r195591:
------------------------------------------------------------------------
r195591 | haoliu | 2013-11-24 17:53:26 -0800 (Sun, 24 Nov 2013) | 5 lines

Fixed a bug about disassembling AArch64 post-index load/store single element instructions.
ie. echo "0x00 0x04 0x80 0x0d" | ../bin/llvm-mc -triple=aarch64 -mattr=+neon -disassemble
    echo "0x00 0x00 0x80 0x0d" | ../bin/llvm-mc -triple=aarch64 -mattr=+neon -disassemble
will be disassembled into the same instruction st1 {v0b}[0], [x0], x0.

------------------------------------------------------------------------

Modified:
    llvm/branches/release_34/   (props changed)
    llvm/branches/release_34/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp
    llvm/branches/release_34/test/MC/Disassembler/AArch64/neon-instructions.txt

Propchange: llvm/branches/release_34/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Nov 25 00:23:37 2013
@@ -1,3 +1,3 @@
 /llvm/branches/Apple/Pertwee:110850,110961
 /llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,195092-195094,195100,195102-195103,195118,195129,195138,195152,195156-195157,195161-195162,195193,195272,195317-195318,195327,195330,195333,195339,195355,195397-195399,195421,195423,195432,195439,195476-195477,195479,195491-195493,195514,195528,195547,195567,195599
+/llvm/trunk:155241,195092-195094,195100,195102-195103,195118,195129,195138,195152,195156-195157,195161-195162,195193,195272,195317-195318,195327,195330,195333,195339,195355,195397-195399,195421,195423,195432,195439,195476-195477,195479,195491-195493,195514,195528,195547,195567,195591,195599

Modified: llvm/branches/release_34/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_34/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp?rev=195619&r1=195618&r2=195619&view=diff
==============================================================================
--- llvm/branches/release_34/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp (original)
+++ llvm/branches/release_34/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp Mon Nov 25 00:23:37 2013
@@ -1117,7 +1117,9 @@ static DecodeStatus DecodeVLDSTLanePostI
   bool Is64bitVec = false;
   bool IsLoadDup = false;
   bool IsLoad = false;
-  unsigned TransferBytes = 0; // The total number of bytes transferred.
+  // The total number of bytes transferred.
+  // TransferBytes = NumVecs * OneLaneBytes
+  unsigned TransferBytes = 0;
   unsigned NumVecs = 0;
   unsigned Opc = Inst.getOpcode();
   switch (Opc) {
@@ -1511,17 +1513,20 @@ static DecodeStatus DecodeVLDSTLanePostI
   unsigned Q = fieldFromInstruction(Insn, 30, 1);
   unsigned S = fieldFromInstruction(Insn, 10, 3);
   unsigned lane = 0;
-  switch (NumVecs) {
-  case 1:
-    lane = (Q << 3) & S;
+  // Calculate the number of lanes by number of vectors and transfered bytes.
+  // NumLanes = 16 bytes / bytes of each lane
+  unsigned NumLanes = 16 / (TransferBytes / NumVecs);
+  switch (NumLanes) {
+  case 16: // A vector has 16 lanes, each lane is 1 bytes.
+    lane = (Q << 3) | S;
     break;
-  case 2:
-    lane = (Q << 2) & (S >> 1);
-    break;
-  case 3:
-    lane = (Q << 1) & (S >> 2);
+  case 8:
+    lane = (Q << 2) | (S >> 1);
     break;
   case 4:
+    lane = (Q << 1) | (S >> 2);
+    break;
+  case 2:
     lane = Q;
     break;
   }

Modified: llvm/branches/release_34/test/MC/Disassembler/AArch64/neon-instructions.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_34/test/MC/Disassembler/AArch64/neon-instructions.txt?rev=195619&r1=195618&r2=195619&view=diff
==============================================================================
--- llvm/branches/release_34/test/MC/Disassembler/AArch64/neon-instructions.txt (original)
+++ llvm/branches/release_34/test/MC/Disassembler/AArch64/neon-instructions.txt Mon Nov 25 00:23:37 2013
@@ -2126,14 +2126,14 @@
 # Post-index of vector load/store single N-element structure to/from
 #  one lane of N consecutive registers (N = 1,2,3,4)
 #----------------------------------------------------------------------
-# CHECK: ld1 {v0.b}[0], [x0], #1
-# CHECK: ld2 {v15.h, v16.h}[0], [x15], #4
-# CHECK: ld3 {v31.s, v0.s, v1.s}[0], [sp], x3
+# CHECK: ld1 {v0.b}[9], [x0], #1
+# CHECK: ld2 {v15.h, v16.h}[7], [x15], #4
+# CHECK: ld3 {v31.s, v0.s, v1.s}[3], [sp], x3
 # CHECK: ld4 {v0.d, v1.d, v2.d, v3.d}[1], [x0], #24
-# CHECK: st1 {v0.d}[0], [x0], #8
-# CHECK: st2 {v31.s, v0.s}[0], [sp], #8
-# CHECK: st3 {v15.h, v16.h, v17.h}[0], [x15], #6
-# CHECK: st4 {v0.b, v1.b, v2.b, v3.b}[1], [x0], x5
+# CHECK: st1 {v0.d}[1], [x0], #8
+# CHECK: st2 {v31.s, v0.s}[3], [sp], #8
+# CHECK: st3 {v15.h, v16.h, v17.h}[7], [x15], #6
+# CHECK: st4 {v0.b, v1.b, v2.b, v3.b}[9], [x0], x5
 0x00,0x04,0xdf,0x4d
 0xef,0x59,0xff,0x4d
 0xff,0xb3,0xc3,0x4d





More information about the llvm-branch-commits mailing list