Home
last modified time | relevance | path

Searched refs:rounding (Results 1 – 25 of 209) sorted by relevance

123456789

/llvm-project-15.0.7/flang/lib/Evaluate/
H A Dcomplex.cpp16 const Complex &that, Rounding rounding) const { in Add()
25 const Complex &that, Rounding rounding) const { in Subtract()
34 const Complex &that, Rounding rounding) const { in Multiply()
42 Part adbc{ad.Add(bc, rounding).AccumulateFlags(flags)}; in Multiply()
48 const Complex &that, Rounding rounding) const { in Divide()
64 den = dS.Add(that.re_, rounding).AccumulateFlags(flags); in Divide()
67 den = cS.Add(that.im_, rounding).AccumulateFlags(flags); in Divide()
73 re1 = re_.Add(bS, rounding).AccumulateFlags(flags); in Divide()
74 im1 = im_.Subtract(aS, rounding).AccumulateFlags(flags); in Divide()
76 re1 = aS.Add(im_, rounding).AccumulateFlags(flags); in Divide()
[all …]
H A Dreal.cpp58 const Real &y, Rounding rounding) const { in Add()
90 return y.Add(*this, rounding); in Add()
96 return y.Add(*this, rounding); in Add()
138 const Real &y, Rounding rounding) const { in Multiply()
295 result = scaled.SQRT(rounding); in SQRT()
409 auto quotient{Divide(y, rounding)}; in MOD()
432 auto quotient{Divide(y, rounding)}; in MODULO()
458 result = Subtract(y, rounding); in DIM()
602 common::RoundingMode rounding) { in MapRoundingMode() argument
603 switch (rounding) { in MapRoundingMode()
[all …]
H A Dint-power.h21 Rounding rounding = TargetCharacteristics::defaultRounding) {
38 result.value = result.value.Divide(squares, rounding)
41 result.value = result.value.Multiply(squares, rounding)
46 squares.Multiply(squares, rounding).AccumulateFlags(result.flags);
54 Rounding rounding = TargetCharacteristics::defaultRounding) {
56 return TimesIntPowerOf(one, base, power, rounding);
/llvm-project-15.0.7/libc/utils/MPFRWrapper/
H A DMPFRUtils.h159 RoundingMode rounding, testutils::StreamWrapper &OS);
176 RoundingMode rounding;
180 : input(testInput), ulp_tolerance(ulp_tolerance), rounding(rounding) {}
196 rounding);
201 rounding);
206 rounding);
212 rounding);
217 rounding);
230 rounding, OS);
237 rounding, OS);
[all …]
H A DMPFRUtils.cpp475 RoundingMode rounding) { in unary_operation() argument
476 MPFRNumber mpfrInput(input, precision, rounding); in unary_operation()
525 MPFRNumber mpfrInput(input, precision, rounding); in unary_operation_two_outputs()
538 MPFRNumber inputX(x, precision, rounding); in binary_operation_one_output()
539 MPFRNumber inputY(y, precision, rounding); in binary_operation_one_output()
554 RoundingMode rounding) { in binary_operation_two_outputs() argument
555 MPFRNumber inputX(x, precision, rounding); in binary_operation_two_outputs()
556 MPFRNumber inputY(y, precision, rounding); in binary_operation_two_outputs()
573 MPFRNumber inputX(x, precision, rounding); in ternary_operation_one_output()
574 MPFRNumber inputY(y, precision, rounding); in ternary_operation_one_output()
[all …]
/llvm-project-15.0.7/flang/include/flang/Evaluate/
H A Dcomplex.h64 Rounding rounding = TargetCharacteristics::defaultRounding) {
67 Part::FromInteger(n, rounding).AccumulateFlags(result.flags);
72 Rounding rounding = TargetCharacteristics::defaultRounding) const;
74 Rounding rounding = TargetCharacteristics::defaultRounding) const;
76 Rounding rounding = TargetCharacteristics::defaultRounding) const;
78 Rounding rounding = TargetCharacteristics::defaultRounding) const;
82 Rounding rounding = TargetCharacteristics::defaultRounding) const {
83 return re_.HYPOT(im_, rounding);
H A Dreal.h111 Rounding rounding = TargetCharacteristics::defaultRounding) const;
114 return Add(y.Negate(), rounding);
117 Rounding rounding = TargetCharacteristics::defaultRounding) const;
119 Rounding rounding = TargetCharacteristics::defaultRounding) const;
122 Rounding rounding = TargetCharacteristics::defaultRounding) const;
191 ValueWithRealFlags<Real> result{Multiply(twoPow, rounding)};
226 Rounding rounding = TargetCharacteristics::defaultRounding) {
248 result.flags |= result.value.Round(rounding, roundingBits);
328 result.flags |= result.value.Round(rounding, roundingBits);
368 Rounding rounding = TargetCharacteristics::defaultRounding);
[all …]
/llvm-project-15.0.7/llvm/test/Feature/
H A Dfp-intrinsics.ll3 ; Test to verify that constants aren't folded when the rounding mode is unknown.
16 ; Verify that 'a - 0' isn't simplified to 'a' when the rounding mode is unknown.
19 ; // Because the result of '0 - 0' is negative zero if rounding mode is
35 ; Verify that '-((-a)*b)' isn't simplified to 'a*b' when the rounding mode is
40 ; // rounding, this shouldn't be simplified.
220 ; Verify that nearbyint(42.1) isn't simplified when the rounding mode is
233 ; Verify that fma(42.1) isn't simplified when the rounding mode is
245 ; Verify that fptoui(42.1) isn't simplified when the rounding mode is
257 ; Verify that fptosi(42.1) isn't simplified when the rounding mode is
268 ; Verify that fptrunc(42.1) isn't simplified when the rounding mode is
[all …]
/llvm-project-15.0.7/flang/lib/Decimal/
H A Dbinary-to-decimal.cpp19 BinaryFloatingPointNumber<PREC> x, enum FortranRounding rounding) in BigRadixFloatingPointNumber() argument
20 : rounding_{rounding} { in BigRadixFloatingPointNumber()
296 Big number{x, rounding}; in ConvertToDecimal()
313 number.Minimize(Big{less, rounding}, Big{more, rounding}); in ConvertToDecimal()
341 enum FortranRounding rounding, float x) { in ConvertFloatToDecimal() argument
343 rounding, Fortran::decimal::BinaryFloatingPointNumber<24>(x)); in ConvertFloatToDecimal()
348 enum FortranRounding rounding, double x) { in ConvertDoubleToDecimal() argument
350 rounding, Fortran::decimal::BinaryFloatingPointNumber<53>(x)); in ConvertDoubleToDecimal()
356 enum FortranRounding rounding, long double x) { in ConvertLongDoubleToDecimal() argument
358 rounding, Fortran::decimal::BinaryFloatingPointNumber<64>(x)); in ConvertLongDoubleToDecimal()
[all …]
H A Ddecimal-to-binary.cpp242 bool isNegative, FortranRounding rounding) const { in ToBinary()
270 switch (rounding) { in ToBinary()
460 const char *&p, enum FortranRounding rounding, const char *end) { in ConvertToBinary() argument
461 return BigRadixFloatingPointNumber<PREC>{rounding}.ConvertToBinary(p, end); in ConvertToBinary()
479 const char **p, float *f, enum FortranRounding rounding) { in ConvertDecimalToFloat() argument
480 auto result{Fortran::decimal::ConvertToBinary<24>(*p, rounding)}; in ConvertDecimalToFloat()
486 const char **p, double *d, enum FortranRounding rounding) { in ConvertDecimalToDouble() argument
487 auto result{Fortran::decimal::ConvertToBinary<53>(*p, rounding)}; in ConvertDecimalToDouble()
493 const char **p, long double *ld, enum FortranRounding rounding) { in ConvertDecimalToLongDouble() argument
494 auto result{Fortran::decimal::ConvertToBinary<64>(*p, rounding)}; in ConvertDecimalToLongDouble()
/llvm-project-15.0.7/flang/unittests/Evaluate/
H A Dreal.cpp136 vr = R::FromInteger(ix, rounding); in basicTests()
159 auto check{R::Read(p, rounding)}; in basicTests()
298 real = real.value.FromInteger(ix, rounding); in inttest()
355 inttest<UINT, FLT, REAL>(0, pass, rounding); in subsetTests()
440 auto readBack{REAL::Read(p, rounding)}; in subsetTests()
530 basicTests<Real2>(rm, rounding); in roundTest()
531 basicTests<Real3>(rm, rounding); in roundTest()
532 basicTests<Real4>(rm, rounding); in roundTest()
533 basicTests<Real8>(rm, rounding); in roundTest()
534 basicTests<Real10>(rm, rounding); in roundTest()
[all …]
/llvm-project-15.0.7/llvm/test/CodeGen/AArch64/
H A Dfpenv.ll4 call void @llvm.set.rounding(i32 %rm)
20 call void @llvm.set.rounding(i32 0)
32 call void @llvm.set.rounding(i32 1)
44 call void @llvm.set.rounding(i32 2)
58 call void @llvm.set.rounding(i32 3)
70 declare void @llvm.set.rounding(i32)
/llvm-project-15.0.7/llvm/test/CodeGen/ARM/
H A Dfpenv.ll4 call void @llvm.set.rounding(i32 %rm)
19 call void @llvm.set.rounding(i32 0)
31 call void @llvm.set.rounding(i32 1)
43 call void @llvm.set.rounding(i32 2)
57 call void @llvm.set.rounding(i32 3)
69 declare void @llvm.set.rounding(i32)
/llvm-project-15.0.7/llvm/test/CodeGen/RISCV/
H A Dfpenv.ll50 call void @llvm.set.rounding(i32 %rm)
64 call void @llvm.set.rounding(i32 0)
78 call void @llvm.set.rounding(i32 1)
92 call void @llvm.set.rounding(i32 2)
106 call void @llvm.set.rounding(i32 3)
120 call void @llvm.set.rounding(i32 4)
124 declare void @llvm.set.rounding(i32)
/llvm-project-15.0.7/libc/test/src/math/exhaustive/
H A Dlog2f_test.cpp21 mpfr::RoundingMode rounding) override { in check()
22 mpfr::ForceRoundingMode r(rounding); in check()
29 __llvm_libc::log2f(x), 0.5, rounding); in check()
H A Dlogf_test.cpp21 mpfr::RoundingMode rounding) override { in check()
22 mpfr::ForceRoundingMode r(rounding); in check()
29 0.5, rounding); in check()
H A Dlog10f_test.cpp21 mpfr::RoundingMode rounding) override { in check()
22 mpfr::ForceRoundingMode r(rounding); in check()
29 __llvm_libc::log10f(x), 0.5, rounding); in check()
H A Dlog1pf_test.cpp21 mpfr::RoundingMode rounding) override { in check()
22 mpfr::ForceRoundingMode r(rounding); in check()
29 __llvm_libc::log1pf(x), 0.5, rounding); in check()
/llvm-project-15.0.7/llvm/test/MC/RISCV/
H A Drv32zhinx-invalid.s18 # Invalid rounding modes
19 …3, ree # CHECK: :[[@LINE]]:29: error: operand must be a valid floating point rounding mode mnemonic
20 …x17, 0 # CHECK: :[[@LINE]]:29: error: operand must be a valid floating point rounding mode mnemonic
21 … 0b111 # CHECK: :[[@LINE]]:30: error: operand must be a valid floating point rounding mode mnemonic
H A Drv32zfinx-invalid.s19 # Invalid rounding modes
20 …3, ree # CHECK: :[[@LINE]]:29: error: operand must be a valid floating point rounding mode mnemonic
21 …x17, 0 # CHECK: :[[@LINE]]:29: error: operand must be a valid floating point rounding mode mnemonic
22 … 0b111 # CHECK: :[[@LINE]]:30: error: operand must be a valid floating point rounding mode mnemonic
H A Drv32zdinx-invalid.s21 # Invalid rounding modes
22 …6, ree # CHECK: :[[@LINE]]:29: error: operand must be a valid floating point rounding mode mnemonic
23 …x16, 0 # CHECK: :[[@LINE]]:29: error: operand must be a valid floating point rounding mode mnemonic
24 … 0b111 # CHECK: :[[@LINE]]:30: error: operand must be a valid floating point rounding mode mnemonic
H A Drv32f-invalid.s26 # Invalid rounding modes
27 …3, ree # CHECK: :[[@LINE]]:29: error: operand must be a valid floating point rounding mode mnemonic
28 …f17, 0 # CHECK: :[[@LINE]]:29: error: operand must be a valid floating point rounding mode mnemonic
29 … 0b111 # CHECK: :[[@LINE]]:30: error: operand must be a valid floating point rounding mode mnemonic
/llvm-project-15.0.7/libc/src/math/generic/
H A Dexpf.cpp59 int rounding = fputil::get_round(); variable
60 if (rounding == FE_DOWNWARD || rounding == FE_TOWARDZERO)
H A Dexp2f.cpp97 int rounding = fputil::get_round(); variable
98 if (rounding == FE_DOWNWARD || rounding == FE_TOWARDZERO)
H A Dexpm1f.cpp66 int rounding = fputil::get_round(); variable
67 if (rounding == FE_DOWNWARD || rounding == FE_TOWARDZERO)

123456789