From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 19542 invoked from network); 21 Jan 2021 00:09:10 -0000 Received: from 1ess.inri.net (216.126.196.35) by inbox.vuxu.org with ESMTPUTF8; 21 Jan 2021 00:09:10 -0000 Received: from mimir.eigenstate.org ([206.124.132.107]) by 1ess; Wed Jan 20 18:40:01 -0500 2021 Received: from abbatoir.fios-router.home (pool-74-101-2-6.nycmny.fios.verizon.net [74.101.2.6]) by mimir.eigenstate.org (OpenSMTPD) with ESMTPSA id dc83e563 (TLSv1.2:ECDHE-RSA-AES256-SHA:256:NO) for <9front@9front.org>; Wed, 20 Jan 2021 15:39:48 -0800 (PST) Message-ID: <15A55C95692154CE1181D48C7964AC44@eigenstate.org> To: 9front@9front.org Date: Wed, 20 Jan 2021 15:39:46 -0800 From: ori@eigenstate.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: stateless blockchain lifecycle database Subject: Re: [9front] Weird >>= operator behaviour in 5c/5l Reply-To: 9front@9front.org Precedence: bulk > This will affect any assembler source that uses > > ROR $0, R1, R2 > > to get at the special RRX arm instruction alias > for a rotate right by one bit with extension. > > That instruction would become > > SRA $0, R1, R2 > > for a arithmetic shift right by 32 bits. It's > probably not used anywhere but I wanted to make > sure you knew about it. > > For reference, here's my understanding of the > possible shift values on arm: > > a i stype imm5 > SLL LSL 00 0..31 > SRL LSR 01 1..32 mod 32 > SRA ASR 10 1..32 mod 32 > ROR ROR 11 1..31 > ROR RRX 11 0 > > Hope that helps. > > Cheers, > Anthony > Yeah -- I was thinking that a 0-byte ROR would be a no-op, and it wouldn't matter -- but I think I made a mistake. It seems like I should just make check explicitly for the opcodes, and substitute in oprrr(). diff -r 01125acb5565 sys/src/cmd/5l/asm.c --- a/sys/src/cmd/5l/asm.c Tue Jan 19 19:56:38 2021 -0800 +++ b/sys/src/cmd/5l/asm.c Wed Jan 20 15:38:43 2021 -0800 @@ -785,7 +785,10 @@ case 8: /* sll $c,[R],R -> mov (R<<$c),R */ aclass(&p->from); - o1 = oprrr(p->as, p->scond); + if((p->as == ASRL || p->as == ASRA) && instoffset == 0) + o1 = oprrr(ASLL, p->scond); + else + o1 = oprrr(p->as, p->scond); r = p->reg; if(r == NREG) r = p->to.reg;