Liste des Groupes | Revenir à c arch |
On Fri, 7 Mar 2025 11:08:56 +0000, BGB wrote:Ibid for Q+. The logic for an extract and insert as one operation might add to the timing. Extract, sign/zero extend and copy back. Fields may be different sizes.
On 3/6/2025 10:09 PM, Lawrence D'Oliveiro wrote:---------------->2 instructions in My 66000. One extract, one insert.
So, writing things like:
y[55:48]=x[19:12];
Q+ has EXT/EXTU which is basically a SRL or SRA with mask applied afterwards. PowerPC has a rotate-left-and-mask instruction. In my opinion it makes more sense for extracts to be shifting right.>1 instruction--extract (SLL or SLA)
And:
j=x[19:12];
Also a single instruction, or 2 or 3 in the fallback case (encoded as a
shift and mask).
----------------------Some work in the peephole optimizer might be able to reduce this.>
For a simple test:
lj[ 7: 0]=li[31:24];
lj[15: 8]=li[23:16];
lj[23:16]=li[15: 8];
lj[31:24]=li[ 7: 0];
Does seem to compile down to 4 instructions.
1 innstruction:: BITR rd,rs1,<8>
Though, looking at the compiler code, it would be subject to the "side5 instructions:: LD, LD, EXT, INS, ST; with deferred ADD to Rcs and Rct.
effects in lvalue may be applied twice" bug:
(*ct++)[19:12]=(*cs++)[15:8];
Les messages affichés proviennent d'usenet.