From 62c1baf8b58a40d37f56a5431214e6514e42970f Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Mon, 1 Jul 2013 17:21:23 +0000 Subject: [PATCH] [PowerPC] Add "wait" instruction This adds the "wait" instruction and its extended mnemonics. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185350 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/PowerPC/PPCInstrInfo.td | 7 +++++++ test/MC/PowerPC/ppc64-encoding-bookII.s | 12 ++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/Target/PowerPC/PPCInstrInfo.td b/lib/Target/PowerPC/PPCInstrInfo.td index fc925e11e81..5c2c59f21be 100644 --- a/lib/Target/PowerPC/PPCInstrInfo.td +++ b/lib/Target/PowerPC/PPCInstrInfo.td @@ -2260,6 +2260,9 @@ def ICBI : XForm_1a<31, 982, (outs), (ins memrr:$src), def EIEIO : XForm_24_eieio<31, 854, (outs), (ins), "eieio", LdStLoad, []>; +def WAIT : XForm_24_sync<31, 62, (outs), (ins i32imm:$L), + "wait $L", LdStLoad, []>; + //===----------------------------------------------------------------------===// // PowerPC Assembler Instruction Aliases // @@ -2286,6 +2289,10 @@ def : InstAlias<"sync", (SYNC 0)>; def : InstAlias<"lwsync", (SYNC 1)>; def : InstAlias<"ptesync", (SYNC 2)>; +def : InstAlias<"wait", (WAIT 0)>; +def : InstAlias<"waitrsv", (WAIT 1)>; +def : InstAlias<"waitimpl", (WAIT 2)>; + def : InstAlias<"xnop", (XORI R0, R0, 0)>; def : InstAlias<"mr $rA, $rB", (OR8 g8rc:$rA, g8rc:$rB, g8rc:$rB)>; diff --git a/test/MC/PowerPC/ppc64-encoding-bookII.s b/test/MC/PowerPC/ppc64-encoding-bookII.s index d066003cfb2..b6c2e621d42 100644 --- a/test/MC/PowerPC/ppc64-encoding-bookII.s +++ b/test/MC/PowerPC/ppc64-encoding-bookII.s @@ -39,7 +39,8 @@ sync 2 # CHECK: eieio # encoding: [0x7c,0x00,0x06,0xac] eieio -# FIXME: wait 2 +# CHECK: wait 2 # encoding: [0x7c,0x40,0x00,0x7c] + wait 2 # Extended mnemonics @@ -61,7 +62,10 @@ # CHECK: sync 2 # encoding: [0x7c,0x40,0x04,0xac] ptesync -# FIXME: wait -# FIXME: waitrsv -# FIXME: waitimpl +# CHECK: wait 0 # encoding: [0x7c,0x00,0x00,0x7c] + wait +# CHECK: wait 1 # encoding: [0x7c,0x20,0x00,0x7c] + waitrsv +# CHECK: wait 2 # encoding: [0x7c,0x40,0x00,0x7c] + waitimpl -- 2.34.1