| 470 | } |
| 471 | |
| 472 | Status DecimalIR::AddFunctions(Engine* engine) { |
| 473 | auto decimal_ir = std::make_shared<DecimalIR>(engine); |
| 474 | |
| 475 | // Populate global variables used by decimal operations. |
| 476 | decimal_ir->AddGlobals(engine); |
| 477 | |
| 478 | // Lookup intrinsic functions |
| 479 | decimal_ir->InitializeIntrinsics(); |
| 480 | |
| 481 | ARROW_RETURN_NOT_OK(decimal_ir->BuildAdd()); |
| 482 | ARROW_RETURN_NOT_OK(decimal_ir->BuildSubtract()); |
| 483 | ARROW_RETURN_NOT_OK(decimal_ir->BuildCompare(kEQFunction, llvm::ICmpInst::ICMP_EQ)); |
| 484 | ARROW_RETURN_NOT_OK(decimal_ir->BuildCompare(kNEFunction, llvm::ICmpInst::ICMP_NE)); |
| 485 | ARROW_RETURN_NOT_OK(decimal_ir->BuildCompare(kLTFunction, llvm::ICmpInst::ICMP_SLT)); |
| 486 | ARROW_RETURN_NOT_OK(decimal_ir->BuildCompare(kLEFunction, llvm::ICmpInst::ICMP_SLE)); |
| 487 | ARROW_RETURN_NOT_OK(decimal_ir->BuildCompare(kGTFunction, llvm::ICmpInst::ICMP_SGT)); |
| 488 | ARROW_RETURN_NOT_OK(decimal_ir->BuildCompare(kGEFunction, llvm::ICmpInst::ICMP_SGE)); |
| 489 | return Status::OK(); |
| 490 | } |
| 491 | |
| 492 | // Do an bitwise-or of all the overflow bits. |
| 493 | llvm::Value* DecimalIR::GetCombinedOverflow( |
nothing calls this directly
no test coverage detected