[LoongArch] Add the missing ld.d instruction definition
authorWeining Lu <luweining@loongson.cn>
Thu, 2 Jun 2022 06:57:23 +0000 (14:57 +0800)
committerWeining Lu <luweining@loongson.cn>
Thu, 2 Jun 2022 06:57:23 +0000 (14:57 +0800)
llvm/lib/Target/LoongArch/LoongArchInstrInfo.td
llvm/test/MC/LoongArch/Basic/Integer/invalid64.s
llvm/test/MC/LoongArch/Basic/Integer/memory.s

index 78885dc..3d47b0e 100644 (file)
@@ -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">;
index e7e6fb0..a8b175a 100644 (file)
@@ -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]
 
index 729e349..1d363d4 100644 (file)
@@ -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