This is an archive of the discontinued LLVM Phabricator instance.

[docs][LangRef] Added minor update inside the `frem`. Fix : #61653
ClosedPublic

Authored by aabhinavg on Mar 26 2023, 12:44 AM.

Details

Summary

Added minor update inside the frem. Fix : #61653

Diff Detail

Event Timeline

aabhinavg created this revision.Mar 26 2023, 12:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 26 2023, 12:44 AM
Herald added a subscriber: jdoerfert. · View Herald Transcript
aabhinavg requested review of this revision.Mar 26 2023, 12:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 26 2023, 12:44 AM

done some minor fix

RKSimon added inline comments.Mar 26 2023, 7:21 AM
llvm/docs/LangRef.rst
9603

This doesn't seem to match with what you've added above - is x86 setting errno?

aabhinavg added inline comments.Mar 26 2023, 7:36 AM
llvm/docs/LangRef.rst
9603

the ‘frem’ instruction is commonly used in the implementation of mathematical functions in the standard C library, known as libm. The libm library provides a wide range of mathematical functions, such as trigonometric functions, logarithmic functions, exponential functions, and more.

The implementation of these functions often involves the use of the ‘frem’ instruction to calculate remainders, which are used in various computations. For example, the implementation of the trigonometric function ‘sine’ typically involves computing the remainder of the angle divided by 2π, which can be done using the ‘frem’ instruction.

Overall, the ‘frem’ instruction is a fundamental building block for many mathematical functions in libm and is a crucial part of many numerical computations in general.

‘frem’ instruction itself does not set ‘errno’ on x86 systems, but errors can be detected by checking the result of the instruction or examining the floating-point status flags.

aabhinavg marked an inline comment as not done.Mar 27 2023, 7:49 AM

Sorry for the delay in replying to this. I don't think that such implementation details belong in the documentation of the operation.
Is there a particular problem that would have been avoided by adding in this information?

bchetioui requested changes to this revision.Apr 17 2023, 2:13 AM

Thanks!

I understand now that the intent behind the issue is that one may need to link libm in order to use frem, which was not obvious to me from the initial change.
I suggested an edit that conveys this more directly. Let me know what you think.

llvm/docs/LangRef.rst
9586–9589

Thanks for your patience. I propose the following rewrite for your change (or something to that effect). WDYT?

This revision now requires changes to proceed.Apr 17 2023, 2:13 AM
bchetioui added inline comments.Apr 17 2023, 2:14 AM
llvm/docs/LangRef.rst
9586–9589

Seems like I am missing a linefeed after the last line, please add that too :-)

aabhinavg updated this revision to Diff 514241.Apr 17 2023, 7:54 AM

Done the required fix

bchetioui accepted this revision.Apr 17 2023, 8:00 AM

Thank you, this looks good to me.

This revision is now accepted and ready to land.Apr 17 2023, 8:00 AM
This revision was landed with ongoing or failed builds.Apr 17 2023, 8:08 AM
This revision was automatically updated to reflect the committed changes.