mini-llvm 0.1.0
Loading...
Searching...
No Matches
FPExt.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2
3#pragma once
4
5#include <concepts>
6#include <cstdlib>
7
8namespace mini_llvm::ops {
9
10template <typename To>
11 requires std::floating_point<To>
12struct FPExt {
13 template <typename From>
14 requires std::floating_point<From>
15 To operator()(From) const noexcept {
16 abort();
17 }
18
19 template <typename From>
20 requires (std::floating_point<From> && sizeof(To) >= sizeof(From))
21 To operator()(From x) const noexcept {
22 return static_cast<To>(x);
23 }
24};
25
26} // namespace mini_llvm::ops
Definition Add.h:9
Definition FPExt.h:12
To operator()(From) const noexcept
Definition FPExt.h:15