[llvm] r224870 - [Hexagon] Adding locked loads.
Colin LeMahieu
colinl at codeaurora.org
Fri Dec 26 12:42:27 PST 2014
Author: colinl
Date: Fri Dec 26 14:42:27 2014
New Revision: 224870
URL: http://llvm.org/viewvc/llvm-project?rev=224870&view=rev
Log:
[Hexagon] Adding locked loads.
Modified:
llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.td
llvm/trunk/test/MC/Disassembler/Hexagon/system_user.txt
Modified: llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.td?rev=224870&r1=224869&r2=224870&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.td (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.td Fri Dec 26 14:42:27 2014
@@ -1852,6 +1852,25 @@ def L2_loadri_pci : T_load_pci <"memw"
let accessSize = DoubleWordAccess, hasNewValue = 0, isCodeGenOnly = 0 in
def L2_loadrd_pci : T_load_pci <"memd", DoubleRegs, s4_3Imm, 0b1110>;
+// L[24]_load[wd]_locked: Load word/double with lock.
+let isSoloAX = 1 in
+class T_load_locked <string mnemonic, RegisterClass RC>
+ : LD0Inst <(outs RC:$dst),
+ (ins IntRegs:$src),
+ "$dst = "#mnemonic#"($src)"> {
+ bits<5> dst;
+ bits<5> src;
+ let IClass = 0b1001;
+ let Inst{27-21} = 0b0010000;
+ let Inst{20-16} = src;
+ let Inst{13-12} = !if (!eq(mnemonic, "memd_locked"), 0b01, 0b00);
+ let Inst{4-0} = dst;
+}
+let hasNewValue = 1, accessSize = WordAccess, opNewValue = 0, isCodeGenOnly = 0 in
+ def L2_loadw_locked : T_load_locked <"memw_locked", IntRegs>;
+let accessSize = DoubleWordAccess, isCodeGenOnly = 0 in
+ def L4_loadd_locked : T_load_locked <"memd_locked", DoubleRegs>;
+
//===----------------------------------------------------------------------===//
// LD -
//===----------------------------------------------------------------------===//
Modified: llvm/trunk/test/MC/Disassembler/Hexagon/system_user.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Disassembler/Hexagon/system_user.txt?rev=224870&r1=224869&r2=224870&view=diff
==============================================================================
--- llvm/trunk/test/MC/Disassembler/Hexagon/system_user.txt (original)
+++ llvm/trunk/test/MC/Disassembler/Hexagon/system_user.txt Fri Dec 26 14:42:27 2014
@@ -1,5 +1,9 @@
# RUN: llvm-mc --triple hexagon -disassemble < %s | FileCheck %s
+0x11 0xc0 0x15 0x92
+# CHECK: r17 = memw_locked(r21)
+0x10 0xd0 0x15 0x92
+# CHECK: r17:16 = memd_locked(r21)
0x00 0xc0 0x00 0xa8
# CHECK: barrier
0x00 0xc0 0x51 0x62
More information about the llvm-commits
mailing list