From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 31799 invoked from network); 6 Jan 1999 06:54:43 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 6 Jan 1999 06:54:43 -0000 Received: from cygnus.com (runyon.cygnus.com [205.180.230.5]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id BAA01886 for ; Wed, 6 Jan 1999 01:35:45 -0500 Received: from dot.cygnus.com (dot.cygnus.com [205.180.230.224]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id WAA19807 for ; Tue, 5 Jan 1999 22:35:09 -0800 (PST) Received: (rth@localhost) by dot.cygnus.com (8.8.7/8.6.4) id WAA29092; Tue, 5 Jan 1999 22:32:59 -0800 Message-ID: <19990105223259.D29056@dot.cygnus.com> Date: Tue, 5 Jan 1999 22:32:59 -0800 From: Richard Henderson To: axp-list@redhat.com Subject: Re: asm Reply-To: Richard Henderson References: <2786b60e.u10t12e.e8910-axp@amazing.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.1 In-Reply-To: <2786b60e.u10t12e.e8910-axp@amazing.ch>; from Christoph Dworzak on Wed, Jan 06, 1999 at 05:30:00AM +0000 On Wed, Jan 06, 1999 at 05:30:00AM +0000, Christoph Dworzak wrote: /* M[0] = 0xaaaaaaaaaaaaaaaa; M[1] = 0xcccccccccccccccc; M[2] = 0xf0f0f0f0f0f0f0f0; M[3] = 0xff00ff00ff00ff00; M[4] = 0xffff0000ffff0000; M[5] = 0xffffffff00000000; */ .align 4 pipe cycle > lda $0,-1 e1 0 > zap $0,0x0f,$6 e0 1 > zap $0,0x33,$5 e0 2 > zap $0,0x55,$4 e0 3 > srl $4,4,$3 e0 4 > stq $6,552($30) e0 5 > xor $4,$3,$3 e1 5 > stq $5,544($30) e0 6 > srl $3,2,$2 e0 7 > stq $4,536($30) e0 8 > xor $3,$2,$2 e1 8 > stq $3,528($30) e0 9 > srl $2,1,$1 e0 10 > stq $2,520($30) e0 11 > xor $2,$1,$1 e1 11 > stq $1,512($30) e0 12 > How would you optimize it? It's just about as good as it can get. I came up with one sequence that executes in 11 cycles, but it's 4 insns longer. r~ lda $0, -1 e0 0 lda $2, 0xcccd($31) e1 0 zap $0, 0x0f, $15 e0 1 ldah $2, 0xcccd($2) e1 1 sll $2, 32, $3 2 addq $2, $3, $2 2 zap $0, 0x33, $14 3 subq $2, 1, $11 3 zap $0, 0x55, $13 4 addq $11, $11, $4 4 srl $13, 4, $1 5 xornot $4, $11, $4 5 stq $11, 8($30) 6 xor $1, $13, $12 6 stq $12, 16($30) 7 subq $4, 1, $10 7 stq $10, 0($30) 8 stq $13, 24($30) 9 stq $14, 32($30) 10 stq $15, 40($30) 11