diff --git a/src/binops.cpp b/src/binops.cpp index 7a2e747..c08aee8 100644 --- a/src/binops.cpp +++ b/src/binops.cpp @@ -52,7 +52,9 @@ namespace types { } // Signed comparisons - for (auto& ty : { int_ty }) { + for (auto& ty : { + short_int_ty, int_ty, long_int_ty, long_long_int_ty, char_ty, + }) { definitions.push_back(BinopDefinition{ ty, types::BinOp::LessThan, ty, [](codegen::Builder& builder, llvm::Value* lhs, llvm::Value* rhs) { @@ -77,11 +79,14 @@ namespace types { } // Unsigned comparisons - for (auto& ty : { bool_ty, char_ty }) { + for (auto& ty : { + ushort_int_ty, uint_ty, ulong_int_ty, ulong_long_int_ty, uchar_ty, + bool_ty + }) { definitions.push_back(BinopDefinition{ ty, types::BinOp::LessThan, ty, [](codegen::Builder& builder, llvm::Value* lhs, llvm::Value* rhs) { - return builder.builder->CreateICmpULT(lhs, rhs, "icmpslt"); + return builder.builder->CreateICmpULT(lhs, rhs, "icmpult"); }, [](BinopDefinition&, std::shared_ptr, std::shared_ptr) { return std::shared_ptr{ @@ -92,7 +97,7 @@ namespace types { definitions.push_back(BinopDefinition{ ty, types::BinOp::GreaterThan, ty, [](codegen::Builder& builder, llvm::Value* lhs, llvm::Value* rhs) { - return builder.builder->CreateICmpUGT(lhs, rhs, "icmpsgt"); + return builder.builder->CreateICmpUGT(lhs, rhs, "icmpugt"); }, [](BinopDefinition&, std::shared_ptr, std::shared_ptr) { return std::shared_ptr{