SH: Document extended asm operand modifers

Message ID 216c5bda-76b5-48c7-89e2-431443047c26@app.fastmail.com
State Committed
Headers
Series SH: Document extended asm operand modifers |

Checks

Context Check Description
rivoscibot/toolchain-ci-rivos-apply-patch success Patch applied
rivoscibot/toolchain-ci-rivos-lint warning Lint failed
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Build passed
rivoscibot/toolchain-ci-rivos-build--newlib-rv64gcv-lp64d-multilib success Build passed
rivoscibot/toolchain-ci-rivos-build--linux-rv64gc_zba_zbb_zbc_zbs-lp64d-multilib success Build passed
rivoscibot/toolchain-ci-rivos-build--linux-rv64gcv-lp64d-multilib success Build passed
rivoscibot/toolchain-ci-rivos-build--newlib-rv64gc-lp64d-non-multilib success Build passed
rivoscibot/toolchain-ci-rivos-build--linux-rv64gc-lp64d-non-multilib success Build passed
rivoscibot/toolchain-ci-rivos-test success Testing passed
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 success Test passed
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gcc_check--master-arm success Test passed

Commit Message

Pietro Monteiro Sept. 20, 2024, 9:48 p.m. UTC
  From: Pietro Monteiro <pietro@sociotechnical.xyz>

SH: Document extended asm operand modifers

gcc/ChangeLog:
	* doc/extend.texi (SH Operand Modifiers): New.

Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
---
Tested by running "make info pdf html" and looking at the pdf and html output. I used the comment on "gcc/config/sh.cc:sh_print_operand()", SH's TARGET_PRINT_OPERAND function, as a guide.

 gcc/doc/extend.texi | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

--
2.46.0
  

Comments

Jeff Law Sept. 29, 2024, 4:40 p.m. UTC | #1
On 9/20/24 3:48 PM, Pietro Monteiro wrote:
> From: Pietro Monteiro <pietro@sociotechnical.xyz>
> 
> SH: Document extended asm operand modifers
> 
> gcc/ChangeLog:
> 	* doc/extend.texi (SH Operand Modifiers): New.
> 
> Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
> ---
> Tested by running "make info pdf html" and looking at the pdf and html output. I used the comment on "gcc/config/sh.cc:sh_print_operand()", SH's TARGET_PRINT_OPERAND function, as a guide.
THanks.  I pushed this to the trunk.
jeff
  
Oleg Endo Sept. 29, 2024, 11:12 p.m. UTC | #2
On Sun, 2024-09-29 at 10:40 -0600, Jeff Law wrote:
> 
> On 9/20/24 3:48 PM, Pietro Monteiro wrote:
> > From: Pietro Monteiro <pietro@sociotechnical.xyz>
> > 
> > SH: Document extended asm operand modifers
> > 
> > gcc/ChangeLog:
> > 	* doc/extend.texi (SH Operand Modifiers): New.
> > 
> > Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
> > ---
> > Tested by running "make info pdf html" and looking at the pdf and html output. I used the comment on "gcc/config/sh.cc:sh_print_operand()", SH's TARGET_PRINT_OPERAND function, as a guide.
> THanks.  I pushed this to the trunk.
> jeff
> 

I was hesitating on this, because I wasn't sure if it makes sense to have
all those officially documented.  But anyway, thanks!

Best regards,
Oleg Endo
  
Jeff Law Sept. 29, 2024, 11:27 p.m. UTC | #3
On 9/29/24 5:12 PM, Oleg Endo wrote:
> 
> On Sun, 2024-09-29 at 10:40 -0600, Jeff Law wrote:
>>
>> On 9/20/24 3:48 PM, Pietro Monteiro wrote:
>>> From: Pietro Monteiro <pietro@sociotechnical.xyz>
>>>
>>> SH: Document extended asm operand modifers
>>>
>>> gcc/ChangeLog:
>>> 	* doc/extend.texi (SH Operand Modifiers): New.
>>>
>>> Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
>>> ---
>>> Tested by running "make info pdf html" and looking at the pdf and html output. I used the comment on "gcc/config/sh.cc:sh_print_operand()", SH's TARGET_PRINT_OPERAND function, as a guide.
>> THanks.  I pushed this to the trunk.
>> jeff
>>
> 
> I was hesitating on this, because I wasn't sure if it makes sense to have
> all those officially documented.  But anyway, thanks!
I'd been hesitating for the same reason.  But finally concluded that 
worst case we end up documenting something internal and we have to take 
it out or support it longer than expected.

Jeff
  
Oleg Endo Sept. 30, 2024, 4:56 a.m. UTC | #4
On Sun, 2024-09-29 at 17:27 -0600, Jeff Law wrote:
> 
> On 9/29/24 5:12 PM, Oleg Endo wrote:
> > 
> > On Sun, 2024-09-29 at 10:40 -0600, Jeff Law wrote:
> > > 
> > > On 9/20/24 3:48 PM, Pietro Monteiro wrote:
> > > > From: Pietro Monteiro <pietro@sociotechnical.xyz>
> > > > 
> > > > SH: Document extended asm operand modifers
> > > > 
> > > > gcc/ChangeLog:
> > > > 	* doc/extend.texi (SH Operand Modifiers): New.
> > > > 
> > > > Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
> > > > ---
> > > > Tested by running "make info pdf html" and looking at the pdf and html output. I used the comment on "gcc/config/sh.cc:sh_print_operand()", SH's TARGET_PRINT_OPERAND function, as a guide.
> > > THanks.  I pushed this to the trunk.
> > > jeff
> > > 
> > 
> > I was hesitating on this, because I wasn't sure if it makes sense to have
> > all those officially documented.  But anyway, thanks!
> I'd been hesitating for the same reason.  But finally concluded that 
> worst case we end up documenting something internal and we have to take 
> it out or support it longer than expected.
> 
Yeah, right.  Anyway, now it's in.  All good. :)

Best regards,
Oleg Endo
  

Patch

diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index c95df845634..f0d8eb59dde 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -12548,6 +12548,35 @@  The list below describes the supported modifiers and their effects for RISC-V.
 @item @code{i} @tab Print the character ''@code{i}'' if the operand is an immediate.
 @end multitable

+@anchor{shOperandmodifiers}
+@subsubsection SH Operand Modifiers
+
+The list below describes the supported modifiers and their effects for the SH family of processors.
+
+@multitable @columnfractions .10 .90
+@headitem Modifier @tab Description
+@item @code{.} @tab Print ''@code{.s}'' if the instruction needs a delay slot.
+@item @code{,} @tab Print ''@code{LOCAL_LABEL_PREFIX}''.
+@item @code{@@} @tab Print ''@code{trap}'', ''@code{rte}'' or ''@code{rts}'' depending on the interrupt pragma used.
+@item @code{#} @tab Print ''@code{nop}'' if there is nothing to put in the delay slot.
+@item @code{'} @tab Print likelihood suffix (''@code{/u}'' for unlikely).
+@item @code{>} @tab Print branch target if ''@code{-fverbose-asm}''.
+@item @code{O} @tab Require a constant operand and print the constant expression with no punctuation.
+@item @code{R} @tab Print the ''@code{LSW}'' of a dp value - changes if in little endian.
+@item @code{S} @tab Print the ''@code{MSW}'' of a dp value - changes if in little endian.
+@item @code{T} @tab Print the next word of a dp value - same as ''@code{R}'' in big endian mode.
+@item @code{M} @tab Print ''@code{.b }'', ''@code{.w}'', ''@code{.l}'', ''@code{.s}'', ''@code{.d}'', suffix if operand is a MEM.
+@item @code{N} @tab Print ''@code{r63}'' if the operand is ''@code{const_int 0}''.
+@item @code{d} @tab Print a ''@code{V2SF}'' as ''@code{dN}'' instead of ''@code{fpN}''.
+@item @code{m} @tab Print the pair ''@code{base,offset}'' or ''@code{base,index}'' for LD and ST.
+@item @code{U} @tab Like ''@code{%m}'' for ''@code{LD}'' and ''@code{ST}'', ''@code{HI}'' and ''@code{LO}''.
+@item @code{V} @tab Print the position of a single bit set.
+@item @code{W} @tab Print the position of a single bit cleared.
+@item @code{t} @tab Print a memory address which is a register.
+@item @code{u} @tab Print the lowest 16 bits of ''@code{CONST_INT}'', as an unsigned value.
+@item @code{o} @tab Print an operator.
+@end multitable
+
 @lowersections
 @include md.texi
 @raisesections