From: Sridhar Adagada <asridhars@gmail.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: Optimisation
Date: Thu, 8 Jul 2004 14:51:59 +0530 [thread overview]
Message-ID: <f013fac6040708022160bbe790@mail.gmail.com> (raw)
In-Reply-To: <Pine.GSO.4.58.0407081053500.12221@waterleaf.sonytel.be>
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
<geert@linux-m68k.org> 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
>
next prev parent reply other threads:[~2004-07-08 9:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-08 6:38 Optimisation Sridhar Adagada
2004-07-08 8:59 ` Optimisation Geert Uytterhoeven
2004-07-08 9:21 ` Sridhar Adagada [this message]
2004-07-08 9:48 ` Optimisation Sridhar Adagada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f013fac6040708022160bbe790@mail.gmail.com \
--to=asridhars@gmail.com \
--cc=geert@linux-m68k.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox