mkql_builtins_bitand.cpp 770 B

123456789101112131415161718192021222324252627282930
  1. #include "mkql_builtins_impl.h" // Y_IGNORE
  2. namespace NKikimr {
  3. namespace NMiniKQL {
  4. namespace {
  5. template<typename TLeft, typename TRight, typename TOutput>
  6. struct TBitAnd : public TSimpleArithmeticBinary<TLeft, TRight, TOutput, TBitAnd<TLeft, TRight, TOutput>> {
  7. static TOutput Do(TOutput left, TOutput right)
  8. {
  9. return left & right;
  10. }
  11. #ifndef MKQL_DISABLE_CODEGEN
  12. static Value* Gen(Value* left, Value* right, const TCodegenContext&, BasicBlock*& block)
  13. {
  14. return BinaryOperator::CreateAnd(left, right, "and", block);
  15. }
  16. #endif
  17. };
  18. }
  19. void RegisterBitAnd(IBuiltinFunctionRegistry& registry) {
  20. RegisterBinaryUnsignedFunctionOpt<TBitAnd, TBinaryArgsOpt>(registry, "BitAnd");
  21. }
  22. } // namespace NMiniKQL
  23. } // namespace NKikimr