mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 14:51:03 +01:00
Add support for builtin float comparison operations (#3899)
Adds support for builtin comparison operations for floats (`==`, `!=`, `<`, `<=`, `>`, `>=`).
This commit is contained in:
@@ -295,6 +295,30 @@ constexpr BuiltinInfo FloatMul = {
|
||||
constexpr BuiltinInfo FloatDiv = {
|
||||
"float.div", ValidateSignature<auto(FloatT, FloatT)->FloatT>};
|
||||
|
||||
// "float.eq": float equality comparison.
|
||||
constexpr BuiltinInfo FloatEq = {"float.eq",
|
||||
ValidateSignature<auto(FloatT, FloatT)->Bool>};
|
||||
|
||||
// "float.neq": float non-equality comparison.
|
||||
constexpr BuiltinInfo FloatNeq = {
|
||||
"float.neq", ValidateSignature<auto(FloatT, FloatT)->Bool>};
|
||||
|
||||
// "float.less": float less than comparison.
|
||||
constexpr BuiltinInfo FloatLess = {
|
||||
"float.less", ValidateSignature<auto(FloatT, FloatT)->Bool>};
|
||||
|
||||
// "float.less_eq": float less than or equal comparison.
|
||||
constexpr BuiltinInfo FloatLessEq = {
|
||||
"float.less_eq", ValidateSignature<auto(FloatT, FloatT)->Bool>};
|
||||
|
||||
// "float.greater": float greater than comparison.
|
||||
constexpr BuiltinInfo FloatGreater = {
|
||||
"float.greater", ValidateSignature<auto(FloatT, FloatT)->Bool>};
|
||||
|
||||
// "float.greater_eq": float greater than or equal comparison.
|
||||
constexpr BuiltinInfo FloatGreaterEq = {
|
||||
"float.greater_eq", ValidateSignature<auto(FloatT, FloatT)->Bool>};
|
||||
|
||||
} // namespace BuiltinFunctionInfo
|
||||
|
||||
CARBON_DEFINE_ENUM_CLASS_NAMES(BuiltinFunctionKind) = {
|
||||
|
||||
Reference in New Issue
Block a user