<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 12, 2023 at 4:50 PM Gedare Bloom <<a href="mailto:gedare@rtems.org">gedare@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, Jun 12, 2023 at 2:28 PM Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>> wrote:<br>
><br>
><br>
><br>
> On Mon, Jun 12, 2023 at 3:10 PM Gedare Bloom <<a href="mailto:gedare@rtems.org" target="_blank">gedare@rtems.org</a>> wrote:<br>
>><br>
>> We have a mix of ways to write inline assembly. It would be convenient<br>
>> to choose one way. The prevailing options are based on breaking around<br>
>> the colons (reg/field separators), either to break at colons if the<br>
>> line length > 80, or to always break at colons.<br>
>><br>
>> I personally find it is easier to read inline assembly that has broken<br>
>> at the colons. But we have these options:<br>
>> 1. Always break at the colon<br>
>> 2. Only break when the line length is exceeded<br>
><br>
><br>
> I lean to (1).<br>
>><br>
>><br>
>> With #2, we also can break as usual, or we can force breaks at the<br>
>> colons. I have seen examples of both in the source tree. Any strong<br>
>> opinions one way or another?<br>
><br>
><br>
> There may also be cases of multiple assembly instructions on the<br>
> same line or split across multiple with line continuation. I don't know<br>
> of one offhand though.<br>
A complicated example of that would be<br>
<a href="https://git.rtems.org/rtems/tree/cpukit/score/cpu/arm/armv7m-exception-default.c#n60" rel="noreferrer" target="_blank">https://git.rtems.org/rtems/tree/cpukit/score/cpu/arm/armv7m-exception-default.c#n60</a><br>
<br></blockquote><div><br></div><div>Yikes! Does that look ok after clang-format processes it?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
>><br>
>><br>
>> here's a line broken because of line lengths, that has not split the<br>
>> arguments at the colons:<br>
>> <a href="https://git.rtems.org/rtems/tree/cpukit/score/cpu/arm/include/rtems/score/aarch32-system-registers.h#n69" rel="noreferrer" target="_blank">https://git.rtems.org/rtems/tree/cpukit/score/cpu/arm/include/rtems/score/aarch32-system-registers.h#n69</a><br>
>><br>
>> Here's a line broken because of line lengths:<br>
>> <a href="https://git.rtems.org/rtems/tree/cpukit/score/cpu/arm/include/rtems/score/cpu.h#n501" rel="noreferrer" target="_blank">https://git.rtems.org/rtems/tree/cpukit/score/cpu/arm/include/rtems/score/cpu.h#n501</a><br>
>><br>
>> Here's a line broken always:<br>
>> <a href="https://git.rtems.org/rtems/tree/cpukit/score/cpu/aarch64/cpu.c#n153" rel="noreferrer" target="_blank">https://git.rtems.org/rtems/tree/cpukit/score/cpu/aarch64/cpu.c#n153</a><br>
>><br>
>> And for good measure, here's an unbroken line that should be broken:<br>
>> <a href="https://git.rtems.org/rtems/tree/cpukit/score/cpu/microblaze/include/rtems/score/cpu.h#n206" rel="noreferrer" target="_blank">https://git.rtems.org/rtems/tree/cpukit/score/cpu/microblaze/include/rtems/score/cpu.h#n206</a><br>
>><br>
>> With the newest version of clang-format we will be able to accommodate<br>
>> always breaking the lines. It currently is inconsistent with whether<br>
>> it puts the first argument on its own line, or keeps it with the<br>
>> "__asm__ volatile (" that I could probably make consistent if we<br>
>> decide we need it to be.<br>
>><br>
>> Gedare<br>
>> _______________________________________________<br>
>> devel mailing list<br>
>> <a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
>> <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div></div>