Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
error_code asm
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Michael Brennan  
View profile  
 More options Sep 28 2004, 3:10 pm
Newsgroups: nlo.lists.kernelnewbies
From: Michael Brennan <mbren...@ezrs.com>
Date: Tue, 28 Sep 2004 21:10:12 +0200
Local: Tues, Sep 28 2004 3:10 pm
Subject: error_code asm
Hi!
A litte thing I noticed and wonder about. I looked at error_code in
arch/i386/kernel/entry.S. And this is how it starts (in 2.6.7):

error_code:
 pushl %ds
 pushl %eax
 xorl %eax, %eax
 pushl %ebp
 pushl %edi
 pushl %esi
 pushl %edx
 decl %eax   # eax = -1
 pushl %ecx
 pushl %ebx

My question is why the 'decl %eax' is 4 lines after the clearing of eax 'xorl
%eax %eax'. Can't it just be put right after xorl?

Of course you can put it anywhere you want, but I wonder if there is a
particular reason to put it there, or is just some personal taste?

/Michael

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Timur Tabi  
View profile  
 More options Sep 28 2004, 4:49 pm
Newsgroups: nlo.lists.kernelnewbies
From: Timur Tabi <timur.t...@ammasso.com>
Date: Tue, 28 Sep 2004 15:49:19 -0500
Local: Tues, Sep 28 2004 4:49 pm
Subject: Re: error_code asm

Michael Brennan wrote:
> error_code:
>  pushl %ds
>  pushl %eax
>  xorl %eax, %eax
>  pushl %ebp
>  pushl %edi
>  pushl %esi
>  pushl %edx
>  decl %eax   # eax = -1
>  pushl %ecx
>  pushl %ebx

> My question is why the 'decl %eax' is 4 lines after the clearing of eax 'xorl
> %eax %eax'. Can't it just be put right after xorl?

It's for CPU pipeline optimization.

--
Timur Tabi
Staff Software Engineer
timur.t...@ammasso.com

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Brennan  
View profile  
 More options Sep 28 2004, 7:54 pm
Newsgroups: nlo.lists.kernelnewbies
From: Michael Brennan <mbren...@ezrs.com>
Date: Wed, 29 Sep 2004 01:54:58 +0200
Local: Tues, Sep 28 2004 7:54 pm
Subject: Re: error_code asm
On Tuesday 28 September 2004 22.49, Timur Tabi wrote:

ok. i see.

Can anyone tell me where I can read more about optimizing for pipelining? I
searched the internet and looked in the intel specifications, but I only find
explanations on how the pipelining and prefetching works, not how to optimize
for it.

Could someone at least tell me how the optimization works in this example? (if
its not far too complex, then I'll forget about it)

/Michael

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brandon Niemczyk  
View profile  
 More options Sep 29 2004, 3:41 am
Newsgroups: nlo.lists.kernelnewbies
From: Brandon Niemczyk <bniemc...@gmail.com>
Date: Wed, 29 Sep 2004 03:41:51 -0400
Local: Wed, Sep 29 2004 3:41 am
Subject: Re: error_code asm

http://webster.cs.ucr.edu/AoA/Linux/HTML/CPUArchitecturea3.html#1014785

just knowing how pipelining and prefetching works will bring you a long way.

> Could someone at least tell me how the optimization works in this example? (if
> its not far too complex, then I'll forget about it)

there's time for the xor to finish before %eax is accessed again, so
that there isn't a pipeline stall.

> /Michael

> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/

--
Brandon Niemczyk
http://bniemczyk.doesntexist.com

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »