Re: extended asm docs - re-written

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 26, 2013 at 1:05 AM, Andrew Haley <aph@xxxxxxxxxx> wrote:
> On 04/25/2013 10:45 PM, dw wrote:
>>
>>> I have generated a patch file for extend.texi
>>> (http://www.LimeGreenSocks.com/gcc/extend.texi.patch), or you can
>>> (temporarily) view the html at
>>> http://www.limegreensocks.com/gcc/Extended-Asm.html.
>>
>> So, it's been over a day and zero critiques.  I know people have looked
>> at this from the web server log, but no comments?
>
> It's a lot to review.
>
>> I wonder if people just read the new intro section (6.41), and missed
>> the fact that there are *7* new subsections underneath it (6.41.1 -
>> 6.41.7).  While the original text was recycled, it wouldn't be a stretch
>> to say that there are 13 pages of new docs here describing how gcc's
>> inline assembler feature works.
>>
>> I understand this is an area where not a lot of people count themselves
>> as experts.  Still, with that much new content, it seemed like somebody
>> would find *something* to kibitz.  Besides, the text isn't intended for
>> experts (they already know all this).  If there are points these docs
>> have left unclear, this is probably the best time to point them out.
>
> There are a lot of technical problems with this.  Some of the new material
> is vague and incorrect.  Starting from the very top:
>
> "volatile
>
> "Normally it is assumed that asm blocks only convert the input
> variables to output variables. However, certain asm blocks may perform
> other actions. Under those circumstances, the volatile qualifier may
> be necessary to disable certain optimizations."
>
> That'd be input values, not variables.  The rest is so vage and uses
> so many weasel words as to be useless.
>
> "goto
>
> "This qualifier informs the compiler that the asm block is a control
> flow only block that jumps to one of the labels listed in the
> GotoLabels section"
>
> If it's a "control flow only block", how come it has clobbers?
>
> Later, I see
>
> <<
>      int src = 1;
>      int dst;
>
>      asm ("add $1, %0" : "=r" (dst) : "r" (src));
>
>      printf("%d\n", dst);
>
> This code will take src, add 1, and store it in dst.
>
>>>
>
> Will it?  Why do you think that?  As far as I can see src isn't used
> for anything.
>
> That's a far as I got.
>
> Andrew.

>From my point of view, the layout of the content is much improved.
I'm not an expert with inline assembly, so I can't judge the
correctness of the content.  It seems clear that the original
documentation needs work.  I think after some formal review, if the
bugs can get worked out, this new document will be great.  I know that
when I've used inline assembly in the past, I've had to work from
existing examples, and modify.  It would be nice to have the rules all
laid out with examples as they are in this attempt at a replacement.

  Brian




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux