From de2cee5556c0bc91cc0735877948ad44c13cd4e6 Mon Sep 17 00:00:00 2001 From: Colin LeMahieu Date: Fri, 26 Dec 2014 20:42:27 +0000 Subject: [PATCH] [Hexagon] Adding locked loads. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224870 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Hexagon/HexagonInstrInfo.td | 19 +++++++++++++++++++ test/MC/Disassembler/Hexagon/system_user.txt | 4 ++++ 2 files changed, 23 insertions(+) diff --git a/lib/Target/Hexagon/HexagonInstrInfo.td b/lib/Target/Hexagon/HexagonInstrInfo.td index 0ed527b82cc..e14a2f27f17 100644 --- a/lib/Target/Hexagon/HexagonInstrInfo.td +++ b/lib/Target/Hexagon/HexagonInstrInfo.td @@ -1852,6 +1852,25 @@ def L2_loadri_pci : T_load_pci <"memw", IntRegs, s4_2Imm, 0b1100>; 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 + : 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 - //===----------------------------------------------------------------------===// diff --git a/test/MC/Disassembler/Hexagon/system_user.txt b/test/MC/Disassembler/Hexagon/system_user.txt index 165910043dc..f13b2b67f8e 100644 --- a/test/MC/Disassembler/Hexagon/system_user.txt +++ b/test/MC/Disassembler/Hexagon/system_user.txt @@ -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 -- 2.34.1