This is an archive of the discontinued LLVM Phabricator instance.

[LangRef] describe the default FP environment
ClosedPublic

Authored by spatel on Mar 9 2018, 10:30 AM.

Details

Summary

Follow-up for @lattner's suggestion in D44216: add a section and examples to describe the FP env.

I thought about mentioning IEEE-754 here, but I don't know how far we can or want to go in that direction.

Diff Detail

Repository
rL LLVM

Event Timeline

spatel created this revision.Mar 9 2018, 10:30 AM
efriedma added inline comments.Mar 9 2018, 2:29 PM
docs/LangRef.rst
2300 ↗(On Diff #137789)

Using undef here is confusing, since it's not any specific value. If you want an SNaN, write an SNaN.

spatel updated this revision to Diff 138057.Mar 12 2018, 10:57 AM

Patch updated:

  1. Fix example to show SNaN explicitly.
  2. Remove duplicate text from the opcode definitions. Now that we have a description of the environment, we can just point to it. Presumably, we'll do the same for non-constrained FP intrinsics, but I'll double-check those and make another patch.
scanon accepted this revision.Mar 20 2018, 8:05 AM

I'm OK with this.

This revision is now accepted and ready to land.Mar 20 2018, 8:05 AM

I'm OK with this.

LGTM too.

I thought about mentioning IEEE-754 here, but I don't know how far we can or want to go in that direction.

I wouldn't mind doing this. We do, in fact, assume IEEE-754 representation (except for in special types) and we probably should document that.

I thought about mentioning IEEE-754 here, but I don't know how far we can or want to go in that direction.

I wouldn't mind doing this. We do, in fact, assume IEEE-754 representation (except for in special types) and we probably should document that.

Great - thanks for clarifying that. We'd be in big trouble with existing folds if that wasn't true. :)
I'll commit this as-is and enhance in follow-ups.

This revision was automatically updated to reflect the committed changes.