Thorin 1.9.0
The Higher ORder INtermediate representation
Loading...
Searching...
No Matches
types.h File Reference
#include <cstdint>
#include <limits>
#include <ostream>
#include <type_traits>
#include <cmath>
#include <half.hpp>
Include dependency graph for types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  thorin
 

Macros

#define HALF_ROUND_STYLE   1
 
#define HALF_ROUND_TIES_TO_EVEN   1
 
#define THORIN_1_8_16_32_64(m)   m(1) m(8) m(16) m(32) m(64)
 
#define THORIN_8_16_32_64(m)   m(8) m(16) m(32) m(64)
 
#define THORIN_16_32_64(m)   m(16) m(32) m(64)
 
#define CODE2(i)
 
#define CODE3(i)    template<> struct w2f_<i> { using type = f ## i; };
 

Typedefs

Width to Signed/Unsigned/Float
template<int w>
using thorin::w2u = typename detail::w2u_< w >::type
 
template<int w>
using thorin::w2s = typename detail::w2s_< w >::type
 
template<int w>
using thorin::w2f = typename detail::w2f_< w >::type
 

Functions

rem
half thorin::rem (half a, half b)
 
float thorin::rem (float a, float b)
 
double thorin::rem (double a, double b)
 
long double thorin::rem (long double a, long double b)
 

Aliases for some Base Types

#define CODE1(i)
 
using thorin::s8 = int8_t
 
using thorin::u8 = uint8_t
 
using thorin::s16 = int16_t
 
using thorin::u16 = uint16_t
 
using thorin::s32 = int32_t
 
using thorin::u32 = uint32_t
 
using thorin::s64 = int64_t
 
using thorin::u64 = uint64_t
 
using thorin::u1 = bool
 
using thorin::f16 = half
 
using thorin::f32 = float
 
using thorin::f64 = double
 
using thorin::level_t = u64
 
using thorin::nat_t = u64
 
using thorin::node_t = u8
 
using thorin::flags_t = u64
 
using thorin::plugin_t = u64
 
using thorin::tag_t = u8
 
using thorin::sub_t = u8
 

User-Defined Literals

#define CODE4(i)
 
constexpr s8 thorin::operator""_s8 (unsigned long long int s)
 
constexpr u8 thorin::operator""_u8 (unsigned long long int u)
 
constexpr s16 thorin::operator""_s16 (unsigned long long int s)
 
constexpr u16 thorin::operator""_u16 (unsigned long long int u)
 
constexpr s32 thorin::operator""_s32 (unsigned long long int s)
 
constexpr u32 thorin::operator""_u32 (unsigned long long int u)
 
constexpr s64 thorin::operator""_s64 (unsigned long long int s)
 
constexpr u64 thorin::operator""_u64 (unsigned long long int u)
 
constexpr size_t thorin::operator""_s (unsigned long long int i)
 A size_t literal. Use 0_s to disambiguate 0 from nullptr.
 
constexpr nat_t thorin::operator""_n (unsigned long long int i)
 
f16 thorin::operator""_f16 (long double d)
 
constexpr f32 thorin::operator""_f32 (long double d)
 
constexpr f64 thorin::operator""_f64 (long double d)
 

Macro Definition Documentation

◆ CODE1

#define CODE1 (   i)
Value:
using s ## i = int ## i ##_t; \
using u ## i = uint ## i ##_t;

Definition at line 32 of file types.h.

◆ CODE2

#define CODE2 (   i)
Value:
template<> struct w2u_<i> { using type = u ## i; }; \
template<> struct w2s_<i> { using type = s ## i; };

Definition at line 59 of file types.h.

◆ CODE3

#define CODE3 (   i)     template<> struct w2f_<i> { using type = f ## i; };

Definition at line 65 of file types.h.

◆ CODE4

#define CODE4 (   i)
Value:
constexpr s ## i operator"" _s ## i(unsigned long long int s) { return s ## i(s); } \
constexpr u ## i operator"" _u ## i(unsigned long long int u) { return u ## i(u); }

Definition at line 80 of file types.h.

◆ HALF_ROUND_STYLE

#define HALF_ROUND_STYLE   1

Definition at line 15 of file types.h.

◆ HALF_ROUND_TIES_TO_EVEN

#define HALF_ROUND_TIES_TO_EVEN   1

Definition at line 16 of file types.h.

◆ THORIN_16_32_64

#define THORIN_16_32_64 (   m)    m(16) m(32) m(64)

Definition at line 27 of file types.h.

◆ THORIN_1_8_16_32_64

#define THORIN_1_8_16_32_64 (   m)    m(1) m(8) m(16) m(32) m(64)

Definition at line 25 of file types.h.

◆ THORIN_8_16_32_64

#define THORIN_8_16_32_64 (   m)    m(8) m(16) m(32) m(64)

Definition at line 26 of file types.h.