Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Franck <vagabon.xyz@gmail.com>
To: Nigel Stephens <nigel@mips.com>
Cc: "Kevin D. Kissell" <kevink@mips.com>, linux-mips@linux-mips.org
Subject: Re: [RFC] Optimize swab operations on mips_r2 cpu
Date: Thu, 26 Jan 2006 19:02:29 +0100	[thread overview]
Message-ID: <cda58cb80601261002w6eb02249k@mail.gmail.com> (raw)
In-Reply-To: <43D8FF16.40107@mips.com>

2006/1/26, Nigel Stephens <nigel@mips.com>:
>
> Then you'll have to have a look at the resulting disassembled code and
> figure what's changed. :)
>
> Thinking about this in more detail:
>
> 1) Using -march=4ksd reduces the cost of a multiply by 1 instruction
> (from 5 to 4 cycles), so a few more constant multiplications, previously
> expanded into a sequence of shifts, adds and subs, may now be replaced
> by a shorter sequence of "li" and "mul" instructions.
>

Is it really specific to 4ksd cpu ? Could this behaviour be triggered
by other options ?

> 2) Enabling branch-likely may allow some instructions to be moved into a
> branch delay slot which previously couldn't be -- but usually these are
> duplicates of the code at the original branch target, so have little
> effect on overall code size.
>
> 3) Using -march=mips32r2 with -O1 and above (but not -Os) enables 64-bit
> alignment of functions and frequently-used branch targets (e.g. loop
> headers); whereas -march=4ksc will not do that. This will add some
> additional "nops" to the code.
>

I noticed your last point when staring at the disassembled code. And
it seems to be ack by these figures:

   text    data     bss     dec     hex filename
2099642  110784   81956 2292382  22fa9e vmlinux-4ksd
2136269  110784   81956 2329009  2389b1 vmlinux-mips32r2
1953086  110784   81956 2145826  20be22 vmlinux-4ksd-Os
1954489  110784   81956 2147229  20c39d vmlinux-mips32r2-Os

I now have to check that your first and second points don't have too
much bad impact on the overall speed although I don't know how to
measure that...But if so, I could safely use -march=mips32r2 -Os
options.

Thanks
--
               Franck

  reply	other threads:[~2006-01-26 17:58 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-25  9:36 [RFC] Optimize swab operations on mips_r2 cpu Franck
2006-01-25 12:47 ` Ralf Baechle
2006-01-25 13:34   ` Franck
2006-01-25 14:11     ` Kevin D. Kissell
2006-01-25 14:14       ` Ralf Baechle
2006-01-25 14:32         ` Franck
2006-01-25 15:04           ` Ralf Baechle
2006-01-25 18:03             ` Franck
2006-01-25 18:15               ` Kevin D. Kissell
2006-01-26  8:11                 ` Franck
2006-01-26  8:26                   ` Kevin D. Kissell
2006-01-26  8:47                     ` Franck
2006-01-26  9:17                       ` Kevin D. Kissell
2006-01-26  9:17                         ` Kevin D. Kissell
2006-01-26 11:56                         ` Franck
2006-01-26 15:02                 ` Franck
2006-01-26 15:23                   ` Kevin D. Kissell
2006-01-26 15:23                     ` Kevin D. Kissell
2006-01-26 15:29                     ` Franck
2006-01-26 15:51                     ` Nigel Stephens
2006-01-26 16:31                       ` Franck
2006-01-26 16:53                         ` Kevin D. Kissell
2006-01-26 16:53                           ` Kevin D. Kissell
2006-01-26 16:55                         ` Nigel Stephens
2006-01-26 18:02                           ` Franck [this message]
2006-01-26 20:25                             ` Nigel Stephens
2006-01-27  9:03                               ` Franck
2006-01-27 10:13                                 ` Kevin D. Kissell
2006-01-27 10:13                                   ` Kevin D. Kissell
2006-01-27 10:45                                   ` Franck
2006-01-27 11:31                                     ` Ralf Baechle
2006-01-27 12:53                                     ` Kevin D. Kissell
2006-01-27 12:53                                       ` Kevin D. Kissell
2006-01-27 14:44                                       ` Franck
2006-01-27 11:30                                   ` Ralf Baechle
2006-01-27 13:45                                 ` Nigel Stephens
2006-01-27 14:54                                   ` Franck
2006-01-27 15:04                                     ` Maciej W. Rozycki
2006-01-27 15:39                                     ` Kevin D. Kissell
2006-01-27 15:39                                       ` Kevin D. Kissell
2006-01-27 17:32                                       ` Franck
2006-01-29 15:07                                         ` Ralf Baechle
2006-01-30 13:08                                           ` Maciej W. Rozycki
2006-01-30 14:31                                           ` Franck

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=cda58cb80601261002w6eb02249k@mail.gmail.com \
    --to=vagabon.xyz@gmail.com \
    --cc=kevink@mips.com \
    --cc=linux-mips@linux-mips.org \
    --cc=nigel@mips.com \
    /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