public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: george anzinger <george@mvista.com>
To: Andrew Morton <akpm@digeo.com>
Cc: Linus Torvalds <torvalds@transmeta.com>,
	felipe_alfaro@linuxmail.org, cobra@compuserve.com,
	linux-kernel@vger.kernel.org
Subject: Re: Runaway cron task on 2.5.63/4 bk?
Date: Tue, 11 Mar 2003 15:46:11 -0800	[thread overview]
Message-ID: <3E6E7543.5050205@mvista.com> (raw)
In-Reply-To: <20030311153437.3c6a3f38.akpm@digeo.com>

Andrew Morton wrote:
> Linus Torvalds <torvalds@transmeta.com> wrote:
> 
>>
>>On Tue, 11 Mar 2003, Andrew Morton wrote:
>>
>>>2.95.3 and 3.2.1 seem to do it right?
>>
>>Try the "64x32->64" version. gcc didn't use to get that one right, but
>>maybe it does now.
>>
> 
> 
> 
> long a;
> long long b;
> long long c;
> 
> void foo(void)
> {
> 	c = a * b;
> }
> 
> It seems to get that wrong.  At least, there are three multiplies in there. 
> 3.2.1 is similar.
> 

You might try it unsigned.  There are issues with the signed version.
> 
> 	.file	"t.c"
> 	.version	"01.01"
> gcc2_compiled.:
> .text
> 	.align 4
> .globl foo
> 	.type	 foo,@function
> foo:
> 	pushl %ebp
> 	movl %esp,%ebp
> 	subl $16,%esp
> 	pushl %esi
> 	pushl %ebx
> 	movl a,%eax
> 	movl %eax,%ebx
> 	movl %eax,%esi
> 	sarl $31,%esi
> 	movl %ebx,%eax
> 	mull b
> 	movl %eax,-8(%ebp)
> 	movl %edx,-4(%ebp)
> 	movl %ebx,%eax
> 	imull b+4,%eax
> 	addl %eax,%edx
> 	movl %edx,-4(%ebp)
> 	movl b,%eax
> 	imull %esi,%eax
> 	addl %eax,-4(%ebp)
> 	movl -8(%ebp),%eax
> 	movl -4(%ebp),%edx
> 	movl %eax,c
> 	movl %edx,c+4
> 	popl %ebx
> 	popl %esi
> 	movl %ebp,%esp
> 	popl %ebp
> 	ret
> .Lfe1:
> 	.size	 foo,.Lfe1-foo
> 	.comm	a,4,4
> 	.comm	b,8,4
> 	.comm	c,8,4
> 	.ident	"GCC: (GNU) 2.95.3 20010315 (release)"
> 
> 

-- 
George Anzinger   george@mvista.com
High-res-timers:  http://sourceforge.net/projects/high-res-timers/
Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml


  reply	other threads:[~2003-03-11 23:36 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-10 23:05 Runaway cron task on 2.5.63/4 bk? Felipe Alfaro Solana
2003-03-10 23:33 ` Linus Torvalds
2003-03-11 10:20   ` george anzinger
2003-03-11 22:44     ` Andrew Morton
2003-03-11 23:02       ` Linus Torvalds
2003-03-11 23:09         ` Andrew Morton
2003-03-11 23:18           ` Linus Torvalds
2003-03-11 23:34             ` Andrew Morton
2003-03-11 23:46               ` george anzinger [this message]
2003-03-11 23:46           ` Linus Torvalds
2003-03-12  1:55           ` Jamie Lokier
2003-03-12 12:04           ` Denis Vlasenko
2003-03-11 23:35         ` george anzinger
2003-03-12  0:48         ` Matti Aarnio
2003-03-12  3:45   ` [PATCH] " george anzinger
2003-03-12  4:57     ` Andrew Morton
2003-03-12 10:09       ` george anzinger
  -- strict thread matches above, loose matches on Subject: below --
2003-03-09  7:30 Kevin Brosius
2003-03-09  8:08 ` Andrew Morton
2003-03-09  8:17   ` Andrew Morton
2003-03-10 19:42     ` george anzinger
2003-03-10 19:49       ` Linus Torvalds
2003-03-10 22:21         ` george anzinger
2003-03-10 22:29           ` Andrew Morton
2003-03-10 22:46             ` george anzinger

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=3E6E7543.5050205@mvista.com \
    --to=george@mvista.com \
    --cc=akpm@digeo.com \
    --cc=cobra@compuserve.com \
    --cc=felipe_alfaro@linuxmail.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.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