[RFC,2/2] RISC-V: Fix documentation of __builtin_riscv_pause

Message ID 9bf2e7d86cbdb2d4b3956926b1db3061f701c80c.1691561509.git.research_trasio@irq.a4lg.com
State Unresolved
Headers
Series RISC-V: __builtin_riscv_pause for all environment |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Tsukasa OI Aug. 9, 2023, 6:11 a.m. UTC
  From: Tsukasa OI <research_trasio@irq.a4lg.com>

This built-in does not imply the 'Xgnuzihintpausestate' extension.
It does not change architectural state (because all HINTs are prohibited
from doing that).

gcc/ChangeLog:

	* doc/extend.texi: Fix the description of __builtin_riscv_pause.
---
 gcc/doc/extend.texi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

Jeff Law Aug. 28, 2023, 9:14 p.m. UTC | #1
On 8/9/23 00:11, Tsukasa OI via Gcc-patches wrote:
> From: Tsukasa OI <research_trasio@irq.a4lg.com>
> 
> This built-in does not imply the 'Xgnuzihintpausestate' extension.
> It does not change architectural state (because all HINTs are prohibited
> from doing that).
> 
> gcc/ChangeLog:
> 
> 	* doc/extend.texi: Fix the description of __builtin_riscv_pause.
I've pushed this to the trunk.
jeff
  
Hans-Peter Nilsson Aug. 28, 2023, 11:09 p.m. UTC | #2
On Mon, 28 Aug 2023, Jeff Law via Gcc-patches wrote:
> 
> 
> On 8/9/23 00:11, Tsukasa OI via Gcc-patches wrote:
> > From: Tsukasa OI <research_trasio@irq.a4lg.com>
> > 
> > This built-in does not imply the 'Xgnuzihintpausestate' extension.
> > It does not change architectural state (because all HINTs are prohibited
> > from doing that).
> > 
> > gcc/ChangeLog:
> > 
> > 	* doc/extend.texi: Fix the description of __builtin_riscv_pause.
> I've pushed this to the trunk.

I randomly noticed a typo: "hart", perhaps for "part"?
Not sure though.

brgds, H-P
  
Jeff Law Aug. 28, 2023, 11:15 p.m. UTC | #3
On 8/28/23 17:09, Hans-Peter Nilsson wrote:
> On Mon, 28 Aug 2023, Jeff Law via Gcc-patches wrote:
>>
>>
>> On 8/9/23 00:11, Tsukasa OI via Gcc-patches wrote:
>>> From: Tsukasa OI <research_trasio@irq.a4lg.com>
>>>
>>> This built-in does not imply the 'Xgnuzihintpausestate' extension.
>>> It does not change architectural state (because all HINTs are prohibited
>>> from doing that).
>>>
>>> gcc/ChangeLog:
>>>
>>> 	* doc/extend.texi: Fix the description of __builtin_riscv_pause.
>> I've pushed this to the trunk.
> 
> I randomly noticed a typo: "hart", perhaps for "part"?
> Not sure though.
Not a typo.  "hart" has a well defined meaning in the risc-v world.

Thanks,
jeff
  
Tsukasa OI Aug. 29, 2023, 2:15 a.m. UTC | #4
On 2023/08/29 8:09, Hans-Peter Nilsson wrote:
> On Mon, 28 Aug 2023, Jeff Law via Gcc-patches wrote:
>>
>>
>> On 8/9/23 00:11, Tsukasa OI via Gcc-patches wrote:
>>> From: Tsukasa OI <research_trasio@irq.a4lg.com>
>>>
>>> This built-in does not imply the 'Xgnuzihintpausestate' extension.
>>> It does not change architectural state (because all HINTs are prohibited
>>> from doing that).
>>>
>>> gcc/ChangeLog:
>>>
>>> 	* doc/extend.texi: Fix the description of __builtin_riscv_pause.
>> I've pushed this to the trunk.
> 
> I randomly noticed a typo: "hart", perhaps for "part"?
> Not sure though.
> 
> brgds, H-P
> 

Hi H-P,

As Jeff mentioned you, the word "hart" in the RISC-V world means a
HARdware Thread and commonly used to represent a hardware-based unit of
execution.

Tsukasa
  
Hans-Peter Nilsson Aug. 29, 2023, 9:26 a.m. UTC | #5
On Tue, 29 Aug 2023, Tsukasa OI wrote:

> On 2023/08/29 8:09, Hans-Peter Nilsson wrote:
> > On Mon, 28 Aug 2023, Jeff Law via Gcc-patches wrote:
> >>
> >>
> >> On 8/9/23 00:11, Tsukasa OI via Gcc-patches wrote:
> >>> From: Tsukasa OI <research_trasio@irq.a4lg.com>
> >>>
> >>> This built-in does not imply the 'Xgnuzihintpausestate' extension.
> >>> It does not change architectural state (because all HINTs are prohibited
> >>> from doing that).
> >>>
> >>> gcc/ChangeLog:
> >>>
> >>> 	* doc/extend.texi: Fix the description of __builtin_riscv_pause.
> >> I've pushed this to the trunk.
> > 
> > I randomly noticed a typo: "hart", perhaps for "part"?
> > Not sure though.
> > 
> > brgds, H-P
> > 
> 
> Hi H-P,
> 
> As Jeff mentioned you, the word "hart" in the RISC-V world means a
> HARdware Thread and commonly used to represent a hardware-based unit of
> execution.

Thanks for the explanation.  Perhaps it's worth telling general 
readers of the document that it's a term, by simply decorating 
"hart" like @samp{hart} or adding the text "(hardware thread)"?  
It's the only grep-hit in the document at this time.

brgds, H-P
  

Patch

diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 89c5b4ea2b20..7ebbe70c78d6 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -21570,9 +21570,9 @@  Returns the value that is currently set in the @samp{tp} register.
 @enddefbuiltin
 
 @defbuiltin{void __builtin_riscv_pause (void)}
-Generates the @code{pause} (hint) machine instruction.  This implies the
-Xgnuzihintpausestate extension, which redefines the @code{pause} instruction to
-change architectural state.
+Generates the @code{pause} (hint) machine instruction.  If the target implements
+the Zihintpause extension, it indicates that the current hart should be
+temporarily paused or slowed down.
 @enddefbuiltin
 
 @node RISC-V Vector Intrinsics