<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 3:10 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">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></blockquote><div><br></div><div>I lean to (1).  </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<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></blockquote><div><br></div><div>There may also be cases of multiple assembly instructions on the</div><div>same line or split across multiple with line continuation. I don't know</div><div>of one offhand though.  </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<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>