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