mini-llvm 0.1.0
Loading...
Searching...
No Matches
SGT.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
9namespace mini_llvm::ops {
10
11struct SGT {
12 template <typename T>
13 requires std::integral<T>
14 bool operator()(T x, T y) const noexcept {
15 return std::bit_cast<std::make_signed_t<T>>(x) > std::bit_cast<std::make_signed_t<T>>(y);
16 }
17
18 bool operator()(bool x, bool y) const noexcept {
19 return !x && y;
20 }
21};
22
23} // namespace mini_llvm::ops
Definition Add.h:9
Definition SGT.h:11
bool operator()(T x, T y) const noexcept
Definition SGT.h:14
bool operator()(bool x, bool y) const noexcept
Definition SGT.h:18