mini-llvm
0.1.0
Toggle main menu visibility
Loading...
Searching...
No Matches
SIToFP.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: MIT
2
3
#pragma once
4
5
#include <bit>
6
#include <concepts>
7
#include <type_traits>
8
9
namespace
mini_llvm::ops
{
10
11
template
<
typename
To>
12
requires
std::floating_point<To>
13
struct
SIToFP
{
14
template
<
typename
From>
15
requires
std::integral<From>
16
To
operator()
(From x)
const
noexcept
{
17
return
static_cast<
To
>
(std::bit_cast<std::make_signed_t<From>>(x));
18
}
19
20
To
operator()
(
bool
x)
const
noexcept
{
21
return
static_cast<
To
>
(x);
22
}
23
};
24
25
}
// namespace mini_llvm::ops
mini_llvm::ops
Definition
Add.h:9
mini_llvm::ops::SIToFP
Definition
SIToFP.h:13
mini_llvm::ops::SIToFP::operator()
To operator()(bool x) const noexcept
Definition
SIToFP.h:20
mini_llvm::ops::SIToFP::operator()
To operator()(From x) const noexcept
Definition
SIToFP.h:16
include
mini-llvm
common
ops
SIToFP.h
Generated by
1.17.0