Commit bbbc3fce authored by Julius Nehring-Wirxel's avatar Julius Nehring-Wirxel
Browse files

Change Word -> word_t

Stop mixing sized types with non-sized types
parent a382a49b
......@@ -42,17 +42,15 @@ TG_IMPL_ADD_TRAIT(type_name_prefix, char const*, f16, "f16");
TG_IMPL_ADD_TRAIT(type_name_prefix, char const*, f32, ""); // vec3, not fvec3
TG_IMPL_ADD_TRAIT(type_name_prefix, char const*, f64, "d");
TG_IMPL_ADD_TRAIT(is_scalar, bool, i8, true);
TG_IMPL_ADD_TRAIT(is_scalar, bool, i16, true);
TG_IMPL_ADD_TRAIT(is_scalar, bool, i32, true);
// TG_IMPL_ADD_TRAIT(is_scalar, bool, i64, true);
TG_IMPL_ADD_TRAIT(is_scalar, bool, signed char, true);
TG_IMPL_ADD_TRAIT(is_scalar, bool, signed short int, true);
TG_IMPL_ADD_TRAIT(is_scalar, bool, signed int, true);
TG_IMPL_ADD_TRAIT(is_scalar, bool, long int, true);
TG_IMPL_ADD_TRAIT(is_scalar, bool, long long int, true);
TG_IMPL_ADD_TRAIT(is_scalar, bool, u8, true);
TG_IMPL_ADD_TRAIT(is_scalar, bool, u16, true);
TG_IMPL_ADD_TRAIT(is_scalar, bool, u32, true);
// TG_IMPL_ADD_TRAIT(is_scalar, bool, u64, true);
TG_IMPL_ADD_TRAIT(is_scalar, bool, unsigned char, true);
TG_IMPL_ADD_TRAIT(is_scalar, bool, unsigned short int, true);
TG_IMPL_ADD_TRAIT(is_scalar, bool, unsigned int, true);
TG_IMPL_ADD_TRAIT(is_scalar, bool, unsigned long int, true);
TG_IMPL_ADD_TRAIT(is_scalar, bool, unsigned long long int, true);
......@@ -61,31 +59,27 @@ TG_IMPL_ADD_TRAIT(is_scalar, bool, f16, true);
TG_IMPL_ADD_TRAIT(is_scalar, bool, f32, true);
TG_IMPL_ADD_TRAIT(is_scalar, bool, f64, true);
TG_IMPL_ADD_TRAIT(is_integer, bool, i8, true);
TG_IMPL_ADD_TRAIT(is_integer, bool, i16, true);
TG_IMPL_ADD_TRAIT(is_integer, bool, i32, true);
// TG_IMPL_ADD_TRAIT(is_integer, bool, i64, true);
TG_IMPL_ADD_TRAIT(is_integer, bool, signed char, true);
TG_IMPL_ADD_TRAIT(is_integer, bool, signed short int, true);
TG_IMPL_ADD_TRAIT(is_integer, bool, signed int, true);
TG_IMPL_ADD_TRAIT(is_integer, bool, long int, true);
TG_IMPL_ADD_TRAIT(is_integer, bool, long long int, true);
TG_IMPL_ADD_TRAIT(is_signed_integer, bool, i8, true);
TG_IMPL_ADD_TRAIT(is_signed_integer, bool, i16, true);
TG_IMPL_ADD_TRAIT(is_signed_integer, bool, i32, true);
// TG_IMPL_ADD_TRAIT(is_signed_integer, bool, i64, true);
TG_IMPL_ADD_TRAIT(is_signed_integer, bool, signed char, true);
TG_IMPL_ADD_TRAIT(is_signed_integer, bool, signed short int, true);
TG_IMPL_ADD_TRAIT(is_signed_integer, bool, signed int, true);
TG_IMPL_ADD_TRAIT(is_signed_integer, bool, long int, true);
TG_IMPL_ADD_TRAIT(is_signed_integer, bool, long long int, true);
TG_IMPL_ADD_TRAIT(is_integer, bool, u8, true);
TG_IMPL_ADD_TRAIT(is_integer, bool, u16, true);
TG_IMPL_ADD_TRAIT(is_integer, bool, u32, true);
// TG_IMPL_ADD_TRAIT(is_integer, bool, u64, true);
TG_IMPL_ADD_TRAIT(is_integer, bool, unsigned char, true);
TG_IMPL_ADD_TRAIT(is_integer, bool, unsigned short int, true);
TG_IMPL_ADD_TRAIT(is_integer, bool, unsigned int, true);
TG_IMPL_ADD_TRAIT(is_integer, bool, unsigned long int, true);
TG_IMPL_ADD_TRAIT(is_integer, bool, unsigned long long int, true);
TG_IMPL_ADD_TRAIT(is_unsigned_integer, bool, u8, true);
TG_IMPL_ADD_TRAIT(is_unsigned_integer, bool, u16, true);
TG_IMPL_ADD_TRAIT(is_unsigned_integer, bool, u32, true);
// TG_IMPL_ADD_TRAIT(is_unsigned_integer, bool, u64, true);
TG_IMPL_ADD_TRAIT(is_unsigned_integer, bool, unsigned char, true);
TG_IMPL_ADD_TRAIT(is_unsigned_integer, bool, unsigned short int, true);
TG_IMPL_ADD_TRAIT(is_unsigned_integer, bool, unsigned int, true);
TG_IMPL_ADD_TRAIT(is_unsigned_integer, bool, unsigned long int, true);
TG_IMPL_ADD_TRAIT(is_unsigned_integer, bool, unsigned long long int, true);
......
......@@ -21,7 +21,7 @@ using intrinsic_i128 = __int128;
#pragma GCC diagnostic pop
#endif
using u64_word = fixed_int<1>::Word;
using u64_word = fixed_int<1>::word_t;
template <>
inline i128 imul(i128 lhs, i128 rhs)
......
......@@ -12,7 +12,7 @@
namespace tg::detail
{
using u64_word = fixed_uint<1>::Word;
using u64_word = fixed_uint<1>::word_t;
template <>
inline u128 mul(u64 lhs, u64 rhs)
......
......@@ -24,9 +24,9 @@ struct fixed_int
{
static_assert(words <= 4, "only up to 256 bit supported");
using Word = unsigned long long; // intrinsics parameter type
using word_t = unsigned long long; // intrinsics parameter type
Word d[words] = {};
word_t d[words] = {};
// ctors
constexpr fixed_int() = default;
......@@ -37,13 +37,13 @@ struct fixed_int
constexpr fixed_int(i64 rhs)
{
d[0] = Word(rhs);
d[0] = word_t(rhs);
if constexpr (words > 1)
d[1] = rhs < 0 ? Word(-1) : 0;
d[1] = rhs < 0 ? word_t(-1) : 0;
if constexpr (words > 2)
d[2] = rhs < 0 ? Word(-1) : 0;
d[2] = rhs < 0 ? word_t(-1) : 0;
if constexpr (words > 3)
d[3] = rhs < 0 ? Word(-1) : 0;
d[3] = rhs < 0 ? word_t(-1) : 0;
}
template <int rhs_words>
......
......@@ -24,9 +24,9 @@ struct fixed_uint
{
static_assert(words <= 4, "only up to 256 bit supported");
using Word = unsigned long long; // intrinsics parameter type
using word_t = unsigned long long; // intrinsics parameter type
Word d[words] = {};
word_t d[words] = {};
// ctors
constexpr fixed_uint() = default;
......@@ -35,7 +35,7 @@ struct fixed_uint
constexpr fixed_uint& operator=(fixed_uint const& rhs) = default;
constexpr fixed_uint& operator=(fixed_uint&& rhs) noexcept = default;
constexpr fixed_uint(u64 rhs) { d[0] = Word(rhs); }
constexpr fixed_uint(u64 rhs) { d[0] = word_t(rhs); }
template <int rhs_words>
explicit constexpr fixed_uint(fixed_int<rhs_words> const& rhs);
......
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