File: f32consts.h

package info (click to toggle)
intel-graphics-compiler 1.0.17791.18-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 102,312 kB
  • sloc: cpp: 935,343; lisp: 286,143; ansic: 16,196; python: 3,279; yacc: 2,487; lex: 1,642; pascal: 300; sh: 174; makefile: 27
file content (27 lines) | stat: -rw-r--r-- 832 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*========================== begin_copyright_notice ============================

Copyright (C) 2024 Intel Corporation

SPDX-License-Identifier: MIT

============================= end_copyright_notice ===========================*/

#ifndef F32CONSTS_H
#define F32CONSTS_H

constexpr unsigned sign_bit = 1u << 31;
constexpr unsigned mod_bitmask = 0x7fffffffu;
constexpr unsigned exp_bitmask = 0x7f800000u;
constexpr unsigned exp_mask = 0xff;
constexpr unsigned exp_shift = 23;
constexpr unsigned exp_bias = 0x7f;
constexpr unsigned normalize_bitmask = 0x4f800000u;
constexpr unsigned mantissa_bitmask = 0x7fffffu;
constexpr unsigned exp_float_zero = 0x3f800000;
constexpr unsigned exp_float_min = 0x800000;
constexpr unsigned mantissa_loss = -2;

constexpr float twoPow127 = 0x1p+127f;
constexpr float twoPow126 = 0x1p+126f;

#endif