[llvm] cfeacec - [LoongArch] Add the missing ld.d instruction definition

Weining Lu via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 2 00:00:18 PDT 2022


Author: Weining Lu
Date: 2022-06-02T14:57:23+08:00
New Revision: cfeacec833f25cfb3ea52eec4e0a9930e3194d3f

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

LOG: [LoongArch] Add the missing ld.d instruction definition

Added: 
    

Modified: 
    llvm/lib/Target/LoongArch/LoongArchInstrInfo.td
    llvm/test/MC/LoongArch/Basic/Integer/invalid64.s
    llvm/test/MC/LoongArch/Basic/Integer/memory.s

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/LoongArch/LoongArchInstrInfo.td b/llvm/lib/Target/LoongArch/LoongArchInstrInfo.td
index 78885dc1cfa92..3d47b0e24decc 100644
--- a/llvm/lib/Target/LoongArch/LoongArchInstrInfo.td
+++ b/llvm/lib/Target/LoongArch/LoongArchInstrInfo.td
@@ -392,6 +392,7 @@ def BSTRPICK_D : FmtBSTR_D<0b0000000011, (outs GPR:$rd),
 
 // Common Memory Access Instructions for 64-bits
 def LD_WU : LOAD_2RI12<0b0010101010, "ld.wu">;
+def LD_D  : LOAD_2RI12<0b0010100011, "ld.d">;
 def ST_D : STORE_2RI12<0b0010100111, "st.d">;
 def LDX_B  : LOAD_3R<0b00111000000000000, "ldx.b">;
 def LDX_H  : LOAD_3R<0b00111000000001000, "ldx.h">;

diff  --git a/llvm/test/MC/LoongArch/Basic/Integer/invalid64.s b/llvm/test/MC/LoongArch/Basic/Integer/invalid64.s
index e7e6fb09840b3..a8b175a886cc3 100644
--- a/llvm/test/MC/LoongArch/Basic/Integer/invalid64.s
+++ b/llvm/test/MC/LoongArch/Basic/Integer/invalid64.s
@@ -36,6 +36,8 @@ lu52i.d $a0, $a0, -2049
 # CHECK: :[[#@LINE-1]]:19: error: immediate must be an integer in the range [-2048, 2047]
 ld.wu $a0, $a0, 2048
 # CHECK: :[[#@LINE-1]]:17: error: immediate must be an integer in the range [-2048, 2047]
+ld.d $a0, $a0, 2048
+# CHECK: :[[#@LINE-1]]:16: error: immediate must be an integer in the range [-2048, 2047]
 st.d $a0, $a0, 2048
 # CHECK: :[[#@LINE-1]]:16: error: immediate must be an integer in the range [-2048, 2047]
 

diff  --git a/llvm/test/MC/LoongArch/Basic/Integer/memory.s b/llvm/test/MC/LoongArch/Basic/Integer/memory.s
index 729e3496c3b0b..1d363d44d7e4e 100644
--- a/llvm/test/MC/LoongArch/Basic/Integer/memory.s
+++ b/llvm/test/MC/LoongArch/Basic/Integer/memory.s
@@ -60,6 +60,10 @@ preld 10, $zero, 23
 # CHECK64-ASM: encoding: [0x6e,0x7e,0x80,0x2a]
 ld.wu $t2, $t7, 31
 
+# CHECK: ld.d $t6, $t8, 159
+# CHECK: encoding: [0x92,0x7e,0xc2,0x28]
+ld.d $t6, $t8, 159
+
 # CHECK64-ASM-AND-OBJ: st.d $s7, $s7, 60
 # CHECK64-ASM: encoding: [0xde,0xf3,0xc0,0x29]
 st.d $s7, $s7, 60


        


More information about the llvm-commits mailing list