From cfeacec833f25cfb3ea52eec4e0a9930e3194d3f Mon Sep 17 00:00:00 2001 From: Weining Lu Date: Thu, 2 Jun 2022 14:57:23 +0800 Subject: [PATCH] [LoongArch] Add the missing ld.d instruction definition --- llvm/lib/Target/LoongArch/LoongArchInstrInfo.td | 1 + llvm/test/MC/LoongArch/Basic/Integer/invalid64.s | 2 ++ llvm/test/MC/LoongArch/Basic/Integer/memory.s | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/llvm/lib/Target/LoongArch/LoongArchInstrInfo.td b/llvm/lib/Target/LoongArch/LoongArchInstrInfo.td index 78885dc..3d47b0e 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 e7e6fb0..a8b175a 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 729e349..1d363d4 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 -- 2.7.4