21 messages in com.googlegroups.llvm-dev[LLVMdev] Implementing llvm.atomic.cm...
FromSent OnAttachments
Gary BensonJun 27, 2008 8:27 am.patch
Anton KorobeynikovJun 27, 2008 9:11 am 
Chris LattnerJun 27, 2008 12:14 pm 
Gary BensonJun 30, 2008 6:10 am 
Evan ChengJun 30, 2008 2:14 pm 
Gary BensonJul 2, 2008 8:28 am.patch
Evan ChengJul 4, 2008 12:14 am 
Gary BensonJul 8, 2008 8:24 am 
Evan ChengJul 8, 2008 10:48 am 
Gary BensonJul 8, 2008 11:51 am 
Gary BensonJul 8, 2008 1:55 pm 
Dan GohmanJul 8, 2008 4:26 pm 
Gary BensonJul 9, 2008 9:16 am.patch
Evan ChengJul 10, 2008 12:20 am 
Gary BensonJul 10, 2008 7:36 am 
Evan ChengJul 10, 2008 11:21 am 
Gary BensonJul 10, 2008 11:45 am.patch
Evan ChengJul 11, 2008 10:53 am 
Gary BensonJul 11, 2008 1:07 pm.patch
Evan ChengJul 11, 2008 7:23 pm 
Gary BensonJul 17, 2008 4:27 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[LLVMdev] Implementing llvm.atomic.cmp.swap.i32 on PowerPCActions
From:Gary Benson (gben@redhat.com)
Date:Jun 27, 2008 8:27:28 am
List:com.googlegroups.llvm-dev
Attachments:

Hi all,

I'm trying to figure out how to add the instructions required for llvm.atomic.cmp.swap.i32 on PowerPC. I figured out LWARX (patch attached) but the other two (CMP_UNRESw and STWCX) require multiple instructions:

let Defs = [CR0] in { def STWCX : Pseudo<(outs), (ins GPRC:$rS, memrr:$dst, i32imm:$label), "stwcx. $rS, $dst\n\tbne-
La${label}_entry\nLa${label}_exit:", [(PPCstcx GPRC:$rS, xoaddr:$dst, imm:$label)]>;

def CMP_UNRESw : Pseudo<(outs), (ins GPRC:$rA, GPRC:$rB, i32imm:$label), "cmpw $rA, $rB\n\tbne- La${label}_exit", [(PPCcmp_unres GPRC:$rA, GPRC:$rB, imm:$label)]>; }

...and I can't figure out the syntax for that. Any suggestions?

Cheers, Gary

-- http://gbenson.net/

Index: lib/Target/PowerPC/PPCInstrInfo.td =================================================================== --- lib/Target/PowerPC/PPCInstrInfo.td (revision 52823) +++ lib/Target/PowerPC/PPCInstrInfo.td (working copy) @@ -531,8 +531,8 @@ PPC970_DGroup_Single;

// Atomic operations. -def LWARX : Pseudo<(outs GPRC:$rD), (ins memrr:$ptr, i32imm:$label), - "\nLa${label}_entry:\n\tlwarx $rD, $ptr", +def LWARX : XForm_1<31, 20, (outs GPRC:$rD), (ins memrr:$ptr, i32imm:$label), + "\nLa${label}_entry:\n\tlwarx $rD, $ptr", LdStLWARX, [(set GPRC:$rD, (PPClarx xoaddr:$ptr, imm:$label))]>;

let Defs = [CR0] in {