Try to clarify the semantics of fptrunc
authorDan Liew <dan@su-root.co.uk>
Thu, 3 Sep 2015 18:43:56 +0000 (18:43 +0000)
committerDan Liew <dan@su-root.co.uk>
Thu, 3 Sep 2015 18:43:56 +0000 (18:43 +0000)
commit9308abaa99ffffc0df0d85f0d36de0c74fd0006a
tree770401a5219c32607a3f7edb29940bce65a3a5b9
parentad69a64d4aac849d14e51af0bb547a542d4b50bf
Try to clarify the semantics of fptrunc

* ``the value cannot fit within the destination type`` is ambiguous.
  It could mean overflow, underflow (not in the IEEE-754 sense) or a
  result that cannot be exactly represented and requires rounding or it
  could mean some combination of these. The semantics now state it means
  overflow **only**.

* Using "truncation" in the semantics is very misleading given that it
  doesn't necessarily truncate (i.e. round to zero). For example on
  x86_64 with SSE2 this is currently mapped to cvtsd2ss instruction
  who's rounding behaviour is dependent on the MXCSR register which
  is usually set to round to nearest even by default. The semantics
  now state that the rounding mode is undefined.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246792 91177308-0d34-0410-b5e6-96231b3b80d8
docs/LangRef.rst