search for: fpexcept

Displaying 20 results from an estimated 20 matches for "fpexcept".

Did you mean: except
2020 Feb 12
6
[RFC] Optional parameter tuples
...ter tuples would be very useful for constrained fp intrinsics and vector predication. Some examples: ; Default fpenv fadd (isomorphic to the fadd instruction) %z = call double @llvm.fadd(%a, %b) ; Constrained fp add %x = call double @llvm.fadd(%a, %b) fpenv(metadata !fpround.tonearest, metadata !fpexcept.strict) ; Constrained fp add with vector predication (https://reviews.llvm.org/D57504) %x = call <256 x double> @llvm.fadd(%a, %b) mask(<256 x i1> %mask), evl(i32 %evl), fpenv(metadata !fpround.tozero, metadata !fpexcept.strict) For constrained fp and VP, we only require a very restr...
2019 Nov 14
7
RFC: token arguments and operand bundles
...is: %sum = call double @llvm.experimental.constrained.fadd(double %x, double %y, Metadata "fpround.dynamic", Metadata "fpexcept.strict") The idea I am pursuing in my patch is to replace these metadata arguments with optional operand bundles, "fpround" and "fpexcept". If the operand bundles are present, they would mean what the arguments currently mean. If not, the default assumption is allowed. A t...
2019 Nov 14
3
RFC: token arguments and operand bundles
...constant or of a special type or in a special metadata slot, since we now need more special support for it. If the optimization passes couldn't identify a constant value for one of the arguments, these seem like they can fallback to assuming the most conservative semantics (of round.dynamic and fpexcept.strict--e.g. don't optimize) without loss of precision or generality. -Jameson On Thu, Nov 14, 2019 at 2:40 PM Kaylor, Andrew via llvm-dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>> wrote: Hello everyone, I’ve just uploaded a patch (https://reviews.llvm.org/D...
2020 Sep 09
3
constrained cosine rounding mode behavior
...; Function Attrs: norecurse nounwind readnone ssp uwtable define double @cosine_down(double returned) local_unnamed_addr #0 {   ; call the llvm intrinsic to perform downward cosine   %2 = call double @llvm.experimental.constrained.cos(double %0, metadata !"round.downward", metadata !"fpexcept.strict")   ret double %2 } ; Function Attrs: norecurse nounwind readnone ssp uwtable define double @cosine_up(double returned) local_unnamed_addr #0 {   ; call the llvm intrinsic to perform upward cosine   %2 = call double @llvm.experimental.constrained.cos(double %0, metadata !"round.up...
2019 May 29
2
[RFC] Add support for options -fp-model= and -fp-speculation= : specify floating point behavior
...-speculation is described here, https://software.intel.com/en-us/cpp-compiler-developer-guide-and-reference-fp-speculation-qfp-speculation These are the meanings of the fp-speculation settings: fast - Tells the compiler to speculate on floating-point operations. This is equivalent to "fpexcept.ignore" in the constrained intrinsics review D53157. strict - Tells the compiler to disable speculation on floating-point operations. This is equivalent to "fpexcept.strict" in the constrained intrinsics review D53157. safe - Tells the compiler to disable speculation if ther...
2019 Nov 15
3
RFC: token arguments and operand bundles
...by default. The state where the assumptions are not made is accomplished through the use of constrained intrinsics. However, we do not wish to completely eliminate optimizations in all cases, so we want a way to communicate to the optimizer what it can assume. That is the purpose of the fpround and fpexcept arguments. These are not intended to control the rounding mode or exception reporting. They only tell the compiler what it can assume. Understanding this, front ends can control these in any way they see fit. For instance, the front end might have a global setting the changes the rounding mode to...
2014 Aug 07
3
[LLVMdev] Proposal: Add a target lowering hook to state that target supports floating point exception behavior.
...ining an integer divide. void setIntDivIsCheap(bool isCheap = true) { IntDivIsCheap = isCheap; } + + /// Tells the code generator that this target supports floating point + /// exceptions and cares about preserving floating point exception behavior. + void setHasFloatingPointExceptions(bool FPExceptions = true) { + FloatingPointExceptions = FPExceptions; + } /// Tells the code generator which bitwidths to bypass. void addBypassSlowDiv(unsigned int SlowBitWidth, unsigned int FastBitWidth) { Index: lib/CodeGen/SelectionDAG/SelectionDAG.cpp ============================================...
2020 Sep 04
2
using experimental intrinsics failed
...function is like this: ; Function Attrs: norecurse nounwind readnone ssp uwtable define { double, double } @add(double, double, double, double) local_unnamed_addr #0 {   %5 = call double @llvm.experimental.constrained.fadd(double %0, double %2, metadata !"round.downward", metadata !"fpexcept.ignore")   %6 = fadd double %1, %3   %7 = insertvalue { double, double } undef, double %5, 0   %8 = insertvalue { double, double } %7, double %6, 1   ret { double, double } %8 } declare double @llvm.experimental.constrained.fadd(double, double, metadata, metadata) But now I get the error at...
2020 Sep 03
3
using experimental intrinsics failed
...ation. The document I found https://llvm.org/docs/LangRef.html#constrained-floating-point-intrinsics, seems to be doing the trick. Here is the piece of code that I did: %5 = call double @llvm.experimental.constrained.fadd(double %0, double %2, metadata !"round.downward", metadata !"fpexcept.ignore") It is taking the first and third argument and adding them together with the downward rounding mode. However, when I try to convert it to bit code, I got the error: error: use of undefined value '@llvm.experimental.constrained.fadd' Is there any flags I need to add in order...
2020 Sep 04
2
using experimental intrinsics failed
...tion Attrs: norecurse nounwind readnone ssp uwtable > > > define { double, double } @add(double, double, double, double) local_unnamed_addr #0 { > > >   %5 = call double @llvm.experimental.constrained.fadd(double %0, double %2, metadata !"round.downward", metadata !"fpexcept.ignore") > > >   %6 = fadd double %1, %3 > > >   %7 = insertvalue { double, double } undef, double %5, 0 > > >   %8 = insertvalue { double, double } %7, double %6, 1 > > >   ret { double, double } %8 > > > } > > > > > > declare dou...
2014 Aug 08
3
[LLVMdev] Proposal: Add a target lowering hook to state that target supports floating point exception behavior.
...etIntDivIsCheap(bool isCheap = true) { IntDivIsCheap = isCheap; } >> + >> + /// Tells the code generator that this target supports floating point >> + /// exceptions and cares about preserving floating point exception behavior. >> + void setHasFloatingPointExceptions(bool FPExceptions = true) { >> + FloatingPointExceptions = FPExceptions; >> + } >> >> /// Tells the code generator which bitwidths to bypass. >> void addBypassSlowDiv(unsigned int SlowBitWidth, unsigned int FastBitWidth) { >> Index: lib/CodeGen/SelectionDAG/SelectionD...
2020 Mar 02
2
Should rint and nearbyint be always constrained?
...er use instructions that encode that rounding mode explicitly or use the current rounding mode from the FP environment. The optimizer may assume that this operation does not raise the inexact exception when the return value differs from the input value, and if the exceptionBehavior argument is not fpexcept.ignore, the backend must encode this operation using instructions that guarantee that the inexact exception is not raised. If the exceptionBehavior argument is fpexcept.ignore, backends may encode this operation using either instructions that raise exceptions or instructions that do not. llvm.expe...
2020 Mar 03
2
Should rint and nearbyint be always constrained?
...or use the current >> rounding mode from the FP environment. >> >> >> >> The optimizer may assume that this operation does not raise the inexact >> exception when the return value differs from the input value, and if the >> exceptionBehavior argument is not fpexcept.ignore, the backend must encode >> this operation using instructions that guarantee that the inexact exception >> is not raised. If the exceptionBehavior argument is fpexcept.ignore, >> backends may encode this operation using either instructions that raise >> exceptions or...
2020 Mar 03
5
Should rint and nearbyint be always constrained?
...he FP environment. >>>> >>>> >>>> >>>> The optimizer may assume that this operation does not raise the inexact >>>> exception when the return value differs from the input value, and if the >>>> exceptionBehavior argument is not fpexcept.ignore, the backend must encode >>>> this operation using instructions that guarantee that the inexact exception >>>> is not raised. If the exceptionBehavior argument is fpexcept.ignore, >>>> backends may encode this operation using either instructions that raise...
2020 Mar 02
2
Should rint and nearbyint be always constrained?
> > I'm not sure why this is an issue. Yes, these two intrinsics depend > on the current rounding mode according to the C standard, and yes, > LLVM in default mode assumes that the current rounding mode is the > default rounding mode. But the same holds true for many other > intrinsics and even the arithmetic IR operations like add. Any other intrinsic, like `floor`,
2019 Oct 03
2
[RFC] Using basic block attributes to implement non-default floating point environment
...ization has been > taught to handle the intrinsics correctly then it isn’t limited by > anything other than the semantics of the constraints. Once we’ve > updated an optimization pass, it will be able to do everything with a > constrained intrinsic that has the “relaxed” settings > (“fpexcept.ignore” and “fpround.tonearest”) that it would be able to > do with the regular operation. The way I understood it, the constraint intrinsics are not the only problem but the regular ones can be. That is, optimizations will move around/combine/replace/... regular floating operations in the pres...
2019 Oct 08
2
PR43374 - when should comparing NaN values raise a floating point exception?
...create broken compares even at -O0, so there is no way to get c99 conforming behaviour. > > Now, send the optimized IR to codegen: > define i32 @is_nan(float %x) { > %cmp = fcmp uno float %x, 0.000000e+00 > %r = zext i1 %cmp to i32 > ret i32 %r > } > > $ llc -o - fpexception.ll -mtriple=armv7a > vmov s0, r0 > mov r0, #0 > vcmpe.f32 s0, s0 > vmrs APSR_nzcv, fpscr > movwvs r0, #1 > bx lr > > We produced "vcmpe" for code that should never cause an FP exception. ARM > codegen bug? sorry, the arm code gen is right here,...
2017 Nov 03
2
FW: clarification needed for the constrained fp implementation.
...2, label %4, label %8 ; <label>:4: ; preds = %3 %5 = tail call i32 @fegetround() %6 = tail call i32 @fesetround(i32 2048) %7 = call double llvm.experimental.constrained.fdiv.f64(double %0, double%1, metadata "round.dynamic", metadata "fpexcept.strict") %8 = tail call i32 @fesetround(i32 %5) br label %11 ; <label>:9: ; preds = %3 %10 = call double llvm.experimental.constrained.fdiv.f64(double %0, double%1, metadata "round.dynamic", metadata "fpexcept.strict") Br...
2019 Oct 01
7
[RFC] Using basic block attributes to implement non-default floating point environment
Hi all, This proposal is aimed at support of floating point environment, in which some properties like rounding mode or exception behavior differ from those used by default. This include in particular support of 'pragma STDC FENV_ACCESS', 'pragma STDC FENV_ROUND' as well as some other related facilities. Problem On many processors use of non-default floating mode requires
2019 Oct 01
5
PR43374 - when should comparing NaN values raise a floating point exception?
Hi, I’ve been investigating https://bugs.llvm.org/show_bug.cgi?id=43374, which is about clang/llvm producing code that triggers a floating point exception when x is NaN, when targeting ARM, in the below code example. int bar(float x) { return x!=x ? 0 : 1; } The C99 standard states in section 7.12.14: """ The relational and equality operators support the usual mathematical