Commit 9f3488d8 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[cleanup] Minor cleanup in boxed-float.h

The Float32(uint32_t) constructor should not be public, use
Float32::FromBits explicitly if needed.

R=ahaas@chromium.org

Change-Id: I414e621deebde8cdb474f17e08fcc489dbc083cd
Reviewed-on: https://chromium-review.googlesource.com/738173Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48934}
parent 00680272
......@@ -18,12 +18,7 @@ namespace internal {
// the exact bit pattern during deoptimization when passing this value.
class Float32 {
public:
Float32() : bit_pattern_(0) {}
Float32(const Float32&) = default;
explicit constexpr Float32(uint32_t bit_pattern)
: bit_pattern_(bit_pattern) {}
Float32() = default;
// This constructor does not guarantee that bit pattern of the input value
// is preserved if the input is a NaN.
......@@ -50,7 +45,10 @@ class Float32 {
static constexpr Float32 FromBits(uint32_t bits) { return Float32(bits); }
private:
uint32_t bit_pattern_;
uint32_t bit_pattern_ = 0;
explicit constexpr Float32(uint32_t bit_pattern)
: bit_pattern_(bit_pattern) {}
};
static_assert(IS_TRIVIALLY_COPYABLE(Float32),
......@@ -62,9 +60,7 @@ static_assert(IS_TRIVIALLY_COPYABLE(Float32),
// TODO(ahaas): Unify this class with Double in double.h
class Float64 {
public:
Float64() : bit_pattern_(0) {}
Float64(const Float64&) = default;
Float64() = default;
// This constructor does not guarantee that bit pattern of the input value
// is preserved if the input is a NaN.
......@@ -90,9 +86,10 @@ class Float64 {
static constexpr Float64 FromBits(uint64_t bits) { return Float64(bits); }
private:
uint64_t bit_pattern_ = 0;
explicit constexpr Float64(uint64_t bit_pattern)
: bit_pattern_(bit_pattern) {}
uint64_t bit_pattern_;
};
static_assert(IS_TRIVIALLY_COPYABLE(Float64),
......
......@@ -2426,7 +2426,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
// Ensure byte indices are in [0, 31] so masks are never NaNs.
four_lanes &= 0x1F1F1F1F;
__ vmov(SwVfpRegister::from_code(scratch_s_base + j),
Float32(four_lanes));
Float32::FromBits(four_lanes));
}
NeonListOperand table(table_base, table_size);
if (dst != src0 && dst != src1) {
......@@ -3025,7 +3025,7 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
__ str(temp, dst);
} else {
SwVfpRegister dst = g.ToFloatRegister(destination);
__ vmov(dst, Float32(src.ToFloat32AsInt()));
__ vmov(dst, Float32::FromBits(src.ToFloat32AsInt()));
}
} else {
DCHECK_EQ(Constant::kFloat64, src.type());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment