Date: Mon, 07 Jan 2002 11:55:34 -0800 (PST) From: John Baldwin <jhb@FreeBSD.org> To: Stephen Montgomery-Smith <stephen@math.missouri.edu> Cc: "Matthew D. Fuller" <fullermd@over-yonder.net>, freebsd-hackers@FreeBSD.org Subject: Re: Tell gcc I have a i686 Message-ID: <XFMail.020107115534.jhb@FreeBSD.org> In-Reply-To: <3C39F804.43A242DD@math.missouri.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
On 07-Jan-02 Stephen Montgomery-Smith wrote:
> John Baldwin wrote:
>>
>> > You know, I have no idea. It is someone elses code. These are the
>> > instructions. Can anyone tell me?
>> >
>> > "movl 32(%0),%1\n"
>> > "adcl %1,32(%0)\n"
>> >
>> > Also, from this discussion, what I have decided to do is provide it as
>> > an option for the user to add by editing the Makefile - not to do it
>> > automatically.
>>
>> These instructions are 386 instructions. What we need to see are the
>> contraints (the stuff after the actual instructions with colons in them) to
>> see
>> if it is somehow using Pentium Pro+ specific registers. And actually, just
>> for
>> the record, a PPro is a 686. :)
>>
>
> OK, this is it in context:
>
> register Word32 *_x = x;
> register int _a = 0;
>
> asm("xorl %1,%1\n" /* clear C */
> "movl 124(%0),%1\n"
> "adcl %1,124(%0)\n"
> : : "r" (_x), "r" (_a)
> );
Looks like rather silly code to double the value at x + 124. I say silly casue
it clears carry and then does a addcl. However, since CF is zero, this is the
same as doing an addl. Since it is just doubling the value, a shl would make
more sense (and only be 1 instruction.)
--
John Baldwin <jhb@FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!" - http://www.FreeBSD.org/
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.020107115534.jhb>
