[llvm] d3cb277 - [AArch64] Rearrange Opcodes in getMemOpInfo. NFC

David Green via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 8 15:05:55 PDT 2024


Author: David Green
Date: 2024-07-08T23:05:50+01:00
New Revision: d3cb277ea35d2cf25cdcc41b894959332477861c

URL: https://github.com/llvm/llvm-project/commit/d3cb277ea35d2cf25cdcc41b894959332477861c
DIFF: https://github.com/llvm/llvm-project/commit/d3cb277ea35d2cf25cdcc41b894959332477861c.diff

LOG: [AArch64] Rearrange Opcodes in getMemOpInfo. NFC

This just changes the order of the opcodes and fields in getMemOpInfo, none of
the values are altered.

Added: 
    

Modified: 
    llvm/lib/Target/AArch64/AArch64InstrInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
index 93278a2ba0d09..eb8730a8c8dca 100644
--- a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
@@ -3553,29 +3553,97 @@ bool AArch64InstrInfo::getMemOpInfo(unsigned Opcode, TypeSize &Scale,
     Width = TypeSize::getFixed(0);
     MinOffset = MaxOffset = 0;
     return false;
+  // LDR / STR
+  case AArch64::LDRQui:
+  case AArch64::STRQui:
+    Scale = TypeSize::getFixed(16);
+    Width = TypeSize::getFixed(16);
+    MinOffset = 0;
+    MaxOffset = 4095;
+    break;
+  case AArch64::LDRXui:
+  case AArch64::LDRDui:
+  case AArch64::STRXui:
+  case AArch64::STRDui:
+  case AArch64::PRFMui:
+    Scale = TypeSize::getFixed(8);
+    Width = TypeSize::getFixed(8);
+    MinOffset = 0;
+    MaxOffset = 4095;
+    break;
+  case AArch64::LDRWui:
+  case AArch64::LDRSui:
+  case AArch64::LDRSWui:
+  case AArch64::STRWui:
+  case AArch64::STRSui:
+    Scale = TypeSize::getFixed(4);
+    Width = TypeSize::getFixed(4);
+    MinOffset = 0;
+    MaxOffset = 4095;
+    break;
+  case AArch64::LDRHui:
+  case AArch64::LDRHHui:
+  case AArch64::LDRSHWui:
+  case AArch64::LDRSHXui:
+  case AArch64::STRHui:
+  case AArch64::STRHHui:
+    Scale = TypeSize::getFixed(2);
+    Width = TypeSize::getFixed(2);
+    MinOffset = 0;
+    MaxOffset = 4095;
+    break;
+  case AArch64::LDRBui:
+  case AArch64::LDRBBui:
+  case AArch64::LDRSBWui:
+  case AArch64::LDRSBXui:
+  case AArch64::STRBui:
+  case AArch64::STRBBui:
+    Scale = TypeSize::getFixed(1);
+    Width = TypeSize::getFixed(1);
+    MinOffset = 0;
+    MaxOffset = 4095;
+    break;
+  // post/pre inc
+  case AArch64::STRQpre:
+  case AArch64::LDRQpost:
+    Scale = TypeSize::getFixed(1);
+    Width = TypeSize::getFixed(16);
+    MinOffset = -256;
+    MaxOffset = 255;
+    break;
+  case AArch64::STRXpre:
+  case AArch64::STRDpre:
+  case AArch64::LDRXpost:
+  case AArch64::LDRDpost:
+    Scale = TypeSize::getFixed(1);
+    Width = TypeSize::getFixed(8);
+    MinOffset = -256;
+    MaxOffset = 255;
+    break;
   case AArch64::STRWpost:
   case AArch64::LDRWpost:
-    Width = TypeSize::getFixed(32);
     Scale = TypeSize::getFixed(4);
+    Width = TypeSize::getFixed(32);
     MinOffset = -256;
     MaxOffset = 255;
     break;
+  // Unscaled
   case AArch64::LDURQi:
   case AArch64::STURQi:
-    Width = TypeSize::getFixed(16);
     Scale = TypeSize::getFixed(1);
+    Width = TypeSize::getFixed(16);
     MinOffset = -256;
     MaxOffset = 255;
     break;
-  case AArch64::PRFUMi:
   case AArch64::LDURXi:
   case AArch64::LDURDi:
   case AArch64::LDAPURXi:
   case AArch64::STURXi:
   case AArch64::STURDi:
   case AArch64::STLURXi:
-    Width = TypeSize::getFixed(8);
+  case AArch64::PRFUMi:
     Scale = TypeSize::getFixed(1);
+    Width = TypeSize::getFixed(8);
     MinOffset = -256;
     MaxOffset = 255;
     break;
@@ -3587,8 +3655,8 @@ bool AArch64InstrInfo::getMemOpInfo(unsigned Opcode, TypeSize &Scale,
   case AArch64::STURWi:
   case AArch64::STURSi:
   case AArch64::STLURWi:
-    Width = TypeSize::getFixed(4);
     Scale = TypeSize::getFixed(1);
+    Width = TypeSize::getFixed(4);
     MinOffset = -256;
     MaxOffset = 255;
     break;
@@ -3602,8 +3670,8 @@ bool AArch64InstrInfo::getMemOpInfo(unsigned Opcode, TypeSize &Scale,
   case AArch64::STURHi:
   case AArch64::STURHHi:
   case AArch64::STLURHi:
-    Width = TypeSize::getFixed(2);
     Scale = TypeSize::getFixed(1);
+    Width = TypeSize::getFixed(2);
     MinOffset = -256;
     MaxOffset = 255;
     break;
@@ -3617,11 +3685,12 @@ bool AArch64InstrInfo::getMemOpInfo(unsigned Opcode, TypeSize &Scale,
   case AArch64::STURBi:
   case AArch64::STURBBi:
   case AArch64::STLURBi:
-    Width = TypeSize::getFixed(1);
     Scale = TypeSize::getFixed(1);
+    Width = TypeSize::getFixed(1);
     MinOffset = -256;
     MaxOffset = 255;
     break;
+  // LDP / STP
   case AArch64::LDPQi:
   case AArch64::LDNPQi:
   case AArch64::STPQi:
@@ -3631,13 +3700,6 @@ bool AArch64InstrInfo::getMemOpInfo(unsigned Opcode, TypeSize &Scale,
     MinOffset = -64;
     MaxOffset = 63;
     break;
-  case AArch64::LDRQui:
-  case AArch64::STRQui:
-    Scale = TypeSize::getFixed(16);
-    Width = TypeSize::getFixed(16);
-    MinOffset = 0;
-    MaxOffset = 4095;
-    break;
   case AArch64::LDPXi:
   case AArch64::LDPDi:
   case AArch64::LDNPXi:
@@ -3651,23 +3713,6 @@ bool AArch64InstrInfo::getMemOpInfo(unsigned Opcode, TypeSize &Scale,
     MinOffset = -64;
     MaxOffset = 63;
     break;
-  case AArch64::PRFMui:
-  case AArch64::LDRXui:
-  case AArch64::LDRDui:
-  case AArch64::STRXui:
-  case AArch64::STRDui:
-    Scale = TypeSize::getFixed(8);
-    Width = TypeSize::getFixed(8);
-    MinOffset = 0;
-    MaxOffset = 4095;
-    break;
-  case AArch64::StoreSwiftAsyncContext:
-    // Store is an STRXui, but there might be an ADDXri in the expansion too.
-    Scale = TypeSize::getFixed(1);
-    Width = TypeSize::getFixed(8);
-    MinOffset = 0;
-    MaxOffset = 4095;
-    break;
   case AArch64::LDPWi:
   case AArch64::LDPSi:
   case AArch64::LDNPWi:
@@ -3681,37 +3726,13 @@ bool AArch64InstrInfo::getMemOpInfo(unsigned Opcode, TypeSize &Scale,
     MinOffset = -64;
     MaxOffset = 63;
     break;
-  case AArch64::LDRWui:
-  case AArch64::LDRSui:
-  case AArch64::LDRSWui:
-  case AArch64::STRWui:
-  case AArch64::STRSui:
-    Scale = TypeSize::getFixed(4);
-    Width = TypeSize::getFixed(4);
-    MinOffset = 0;
-    MaxOffset = 4095;
-    break;
-  case AArch64::LDRHui:
-  case AArch64::LDRHHui:
-  case AArch64::LDRSHWui:
-  case AArch64::LDRSHXui:
-  case AArch64::STRHui:
-  case AArch64::STRHHui:
-    Scale = TypeSize::getFixed(2);
-    Width = TypeSize::getFixed(2);
-    MinOffset = 0;
-    MaxOffset = 4095;
-    break;
-  case AArch64::LDRBui:
-  case AArch64::LDRBBui:
-  case AArch64::LDRSBWui:
-  case AArch64::LDRSBXui:
-  case AArch64::STRBui:
-  case AArch64::STRBBui:
-    Scale = TypeSize::getFixed(1);
-    Width = TypeSize::getFixed(1);
-    MinOffset = 0;
-    MaxOffset = 4095;
+  // pre/post inc
+  case AArch64::STPQpre:
+  case AArch64::LDPQpost:
+    Scale = TypeSize::getFixed(16);
+    Width = TypeSize::getFixed(16);
+    MinOffset = -1024;
+    MaxOffset = 1008;
     break;
   case AArch64::STPXpre:
   case AArch64::LDPXpost:
@@ -3722,28 +3743,12 @@ bool AArch64InstrInfo::getMemOpInfo(unsigned Opcode, TypeSize &Scale,
     MinOffset = -512;
     MaxOffset = 504;
     break;
-  case AArch64::STPQpre:
-  case AArch64::LDPQpost:
-    Scale = TypeSize::getFixed(16);
-    Width = TypeSize::getFixed(16);
-    MinOffset = -1024;
-    MaxOffset = 1008;
-    break;
-  case AArch64::STRXpre:
-  case AArch64::STRDpre:
-  case AArch64::LDRXpost:
-  case AArch64::LDRDpost:
+  case AArch64::StoreSwiftAsyncContext:
+    // Store is an STRXui, but there might be an ADDXri in the expansion too.
     Scale = TypeSize::getFixed(1);
     Width = TypeSize::getFixed(8);
-    MinOffset = -256;
-    MaxOffset = 255;
-    break;
-  case AArch64::STRQpre:
-  case AArch64::LDRQpost:
-    Scale = TypeSize::getFixed(1);
-    Width = TypeSize::getFixed(16);
-    MinOffset = -256;
-    MaxOffset = 255;
+    MinOffset = 0;
+    MaxOffset = 4095;
     break;
   case AArch64::ADDG:
     Scale = TypeSize::getFixed(16);
@@ -3767,6 +3772,7 @@ bool AArch64InstrInfo::getMemOpInfo(unsigned Opcode, TypeSize &Scale,
     MinOffset = -256;
     MaxOffset = 255;
     break;
+  // SVE
   case AArch64::STR_ZZZZXI:
   case AArch64::LDR_ZZZZXI:
     Scale = TypeSize::getScalable(16);


        


More information about the llvm-commits mailing list