From: Aina Niemetz Date: Fri, 26 Mar 2021 18:32:38 +0000 (-0700) Subject: FloatingPointLiteral: Make constructors that shouldn't be used outside of FloatingPoi... X-Git-Tag: cvc5-1.0.0~2025 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c84f7715ef73036b6b862b135881de991f66d0d4;p=cvc5.git FloatingPointLiteral: Make constructors that shouldn't be used outside of FloatingPoint(Literal) private. (#6211) --- diff --git a/src/util/floatingpoint_literal_symfpu.h.in b/src/util/floatingpoint_literal_symfpu.h.in index d7e1a2241..2424bad66 100644 --- a/src/util/floatingpoint_literal_symfpu.h.in +++ b/src/util/floatingpoint_literal_symfpu.h.in @@ -342,40 +342,6 @@ class FloatingPointLiteral const BitVector& bv, bool signedBV); - /** - * Create a FP literal from unpacked representation. - * - * This unpacked representation accounts for additional bits required for the - * exponent to allow subnormals to be normalized. - * - * This should NOT be used to create a literal from its IEEE bit-vector - * representation -- for this, the above constructor is to be used while - * creating a SymFPUUnpackedFloatLiteral via symfpu::unpack. - */ - FloatingPointLiteral(const FloatingPointSize& size, - const bool sign, - const BitVector& exp, - const BitVector& sig) - : d_fp_size(size) -// clang-format off -#if @CVC4_USE_SYMFPU@ - // clang-format on - , - d_symuf(SymFPUUnpackedFloatLiteral(sign, exp, sig)) -#endif - { - } - -// clang-format off -#if @CVC4_USE_SYMFPU@ - // clang-format on - - /** Create a FP literal from a symFPU unpacked float. */ - FloatingPointLiteral(const FloatingPointSize& size, - SymFPUUnpackedFloatLiteral symuf) - : d_fp_size(size), d_symuf(symuf){}; -#endif - ~FloatingPointLiteral() {} /** Return the size of this FP literal. */ @@ -489,6 +455,41 @@ class FloatingPointLiteral #endif private: + + /** + * Create a FP literal from unpacked representation. + * + * This unpacked representation accounts for additional bits required for the + * exponent to allow subnormals to be normalized. + * + * This should NOT be used to create a literal from its IEEE bit-vector + * representation -- for this, the above constructor is to be used while + * creating a SymFPUUnpackedFloatLiteral via symfpu::unpack. + */ + FloatingPointLiteral(const FloatingPointSize& size, + const bool sign, + const BitVector& exp, + const BitVector& sig) + : d_fp_size(size) +// clang-format off +#if @CVC4_USE_SYMFPU@ + // clang-format on + , + d_symuf(SymFPUUnpackedFloatLiteral(sign, exp, sig)) +#endif + { + } + +// clang-format off +#if @CVC4_USE_SYMFPU@ + // clang-format on + + /** Create a FP literal from a symFPU unpacked float. */ + FloatingPointLiteral(const FloatingPointSize& size, + SymFPUUnpackedFloatLiteral symuf) + : d_fp_size(size), d_symuf(symuf){}; +#endif + /** The floating-point size of this floating-point literal. */ FloatingPointSize d_fp_size; // clang-format off