32#ifndef __ARCH_AMDGPU_COMMON_DTYPE_MXFP_HH__
33#define __ARCH_AMDGPU_COMMON_DTYPE_MXFP_HH__
68 data <<= (32 - int(FMT::sbits) - int(FMT::ebits) - int(FMT::mbits));
74 conv_out =
convertMXFP<FMT,
decltype(
f.getFmt())>(
f.getFmt());
75 data = conv_out.storage;
89 conv_out =
convertMXFP<FMT,
decltype(
f.getFmt())>(
f.getFmt());
90 data = conv_out.storage;
94 operator float()
const
107 return int(FMT::mbits) + int(FMT::ebits) + int(FMT::sbits);
133 int scale_val = bfp.
exp - bfp.
bias;
137 if (scale_val == 0xFF) {
150 in.exp = exp + scale_val;
163 assert(std::numeric_limits<FMT>::has_infinity);
168 assert(std::numeric_limits<FMT>::has_quiet_NaN);
201 a.data ^= 0x80000000;
239 return T(
float(
a) +
float(
b));
245 return T(
float(
a) -
float(
b));
251 return T(
float(
a) *
float(
b));
257 return T(
float(
a) /
float(
b));
292 return float(
a) < float(
b);
298 return float(
a) > float(
b);
304 return float(
a) <= float(
b);
310 return float(
a) >= float(
b);
316 return float(
a) == float(
b);
322 return float(
a) != float(
b);
mxfp & operator=(const mxfp &f)
uint32_t float_to_mxfp(float f)
static constexpr int size()
mxfp(const uint32_t &raw)
void scale(const float &f)
uint32_t float_to_mxfp_nocheck(float f)
mxfp & operator=(const float &f)
bool operator==(T a, T b)
dFMT convertMXFP(sFMT in, mxfpRoundingMode mode=roundTiesToEven, uint32_t seed=0)
bool operator!=(T a, T b)
bool operator<=(T a, T b)
bool operator>=(T a, T b)
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
constexpr bool isinf(gem5::AMDGPU::fp16_e5m10_info a)
constexpr bool isnan(gem5::AMDGPU::fp16_e5m10_info a)