Ignore:
Timestamp:
Oct 25, 2017, 4:57:58 PM (19 months ago)
Author:
nmedfort
Message:

First stage of MultiBlockKernel? and pipeline restructuring

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/IR_Gen/CBuilder.h

    r5675 r5706  
    5757    llvm::Value * CreateUDivCeil(llvm::Value * number, llvm::Value * divisor, const llvm::Twine &Name = "");
    5858   
     59    llvm::Value * CreateUDivCeil(llvm::Value * number, const uint64_t divisor, const llvm::Twine &Name = "");
     60
    5961    // Round up to a multiple of divisor.
    6062    llvm::Value * CreateRoundUp(llvm::Value * number, llvm::Value * divisor, const llvm::Twine &Name = "");
    6163           
     64    // Get minimum of two unsigned numbers
     65    llvm::Value * CreateUMin(llvm::Value * a, llvm::Value * b) {
     66        assert (a->getType() == b->getType());
     67        return CreateSelect(CreateICmpULT(a, b), a, b);
     68    }
     69
     70    // Get minimum of two signed numbers
     71    llvm::Value * CreateSMin(llvm::Value * a, llvm::Value * b) {
     72        assert (a->getType() == b->getType());
     73        return CreateSelect(CreateICmpSLT(a, b), a, b);
     74    }
     75
     76    // Get maximum of two unsigned numbers
     77    llvm::Value * CreateUMax(llvm::Value * a, llvm::Value * b) {
     78        assert (a->getType() == b->getType());
     79        return CreateSelect(CreateICmpUGT(a, b), a, b);
     80    }
     81
     82    // Get maximum of two signed numbers
     83    llvm::Value * CreateSMax(llvm::Value * a, llvm::Value * b) {
     84        assert (a->getType() == b->getType());
     85        return CreateSelect(CreateICmpSGT(a, b), a, b);
     86    }
     87
    6288    llvm::Value * CreateMalloc(llvm::Value * size);
    6389
Note: See TracChangeset for help on using the changeset viewer.