From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 08 Jul 2004 10:50:20 +0100 (BST) Received: from witte.sonytel.be ([IPv6:::ffff:80.88.33.193]:7858 "EHLO witte.sonytel.be") by linux-mips.org with ESMTP id ; Thu, 8 Jul 2004 10:50:16 +0100 Received: from waterleaf.sonytel.be (localhost [127.0.0.1]) by witte.sonytel.be (8.12.10/8.12.10) with ESMTP id i689oFXK000414 for ; Thu, 8 Jul 2004 11:50:15 +0200 (MEST) X-Received: from dolphin.sonytel.be (localhost [127.0.0.1]) by witte.sonytel.be (8.12.10/8.12.10) with ESMTP id i689meXJ000280 for ; Thu, 8 Jul 2004 11:48:40 +0200 (MEST) X-Received: from ns1.nerdnet.nl ([217.170.15.1] helo=nerdnet.nl ident=root) by dolphin.sonytel.be with esmtp (Exim 4.34) id 1BiVWC-00030R-CP for Geert.Uytterhoeven@sonycom.com; Thu, 08 Jul 2004 11:48:40 +0200 X-Received: from mproxy.gmail.com (rproxy.gmail.com [64.233.170.196]) by nerdnet.nl (8.12.11/8.12.11/Debian-5) with SMTP id i689mdYd003671 for ; Thu, 8 Jul 2004 11:48:39 +0200 X-Received: by mproxy.gmail.com with SMTP id d5so185080rng for ; Thu, 08 Jul 2004 02:48:35 -0700 (PDT) X-Received: by 10.38.3.58 with SMTP id 58mr215311rnc; Thu, 08 Jul 2004 02:48:35 -0700 (PDT) Message-ID: Date: Thu, 8 Jul 2004 15:18:35 +0530 From: Sridhar Adagada To: Geert Uytterhoeven Subject: Re: Optimisation In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: X-Virus-Scanned: clamd / ClamAV version 0.73, clamav-milter version 0.73a on nerdnet.nl X-Virus-Status: Clean X-Spambayes-Classification: ham; 0.00 ReSent-Date: Thu, 8 Jul 2004 11:50:10 +0200 (MEST) ReSent-From: Geert Uytterhoeven ReSent-To: Linux/MIPS Development ReSent-Subject: Re: Optimisation ReSent-Message-ID: Return-Path: X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0) X-Orcpt: rfc822;linux-mips@linux-mips.org Original-Recipient: rfc822;linux-mips@linux-mips.org X-archive-position: 5426 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: geert@sonycom.com Precedence: bulk X-list: linux-mips Thank you! I got it now If the length is less then 7, the loop is handled differently for the fast access of the abs and coef. Thanks you very much Sri On Thu, 8 Jul 2004 14:51:59 +0530, Sridhar Adagada wrote: > Thank you. For some reason i have been reading ANDI ans ADDI. But i > am still confused at lines 13, 14 and 15 > 13 imax $8, $6, 0 > 14 srl $10, $8, 3 > 15 beq $10, $0, .L62 > > Thanks for correcting me > > Sri > > > > > On Thu, 8 Jul 2004 10:59:58 +0200 (MEST), Geert Uytterhoeven > wrote: > > On Thu, 8 Jul 2004, Sridhar Adagada wrote: > > > As you can see $6 is the length, my confusion is at the lines 12-14, > > > 19, 20 why is the length added with 65535 and the comparison with 0 > > > > It's not `added with 65535', but `ANDed with 65535'. MIPS32 has 32-bit integer > > operations only. If you want to do 16-bit math, all data has to be masked. > > > > Anyway, for performance, it's better to do 32-bit math only. > > > > > short cal_xxx(short *abs, short *coef, short len, short base) > > > { > > > short i; > > > short sum = 0; > > > > > > for (i = 0; i < length; i++) > > > { > > > sum += ( (unsigned int)abs[i] * (unsigned int)coef[i] ); > > > > Why cast to unsigned int while sum is a short? Unless you really want to rely > > on sum being a short, you better make it int and do the truncation to short > > after the loop. > > > > Gr{oetje,eeting}s, > > > > Geert > > > > -- > > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > > > In personal conversations with technical people, I call myself a hacker. But > > when I'm talking to journalists I just say "programmer" or something like that. > > -- Linus Torvalds > > >