mkql_builtins_bitnot.cpp 689 B

123456789101112131415161718192021222324252627282930
  1. #include "mkql_builtins_impl.h" // Y_IGNORE
  2. namespace NKikimr {
  3. namespace NMiniKQL {
  4. namespace {
  5. template<typename TInput, typename TOutput>
  6. struct TBitNot : public TSimpleArithmeticUnary<TInput, TOutput, TBitNot<TInput, TOutput>> {
  7. static TOutput Do(TInput val)
  8. {
  9. return ~val;
  10. }
  11. #ifndef MKQL_DISABLE_CODEGEN
  12. static Value* Gen(Value* arg, const TCodegenContext&, BasicBlock*& block)
  13. {
  14. return BinaryOperator::CreateNot(arg, "not", block);
  15. }
  16. #endif
  17. };
  18. }
  19. void RegisterBitNot(IBuiltinFunctionRegistry& registry) {
  20. RegisterUnaryUnsignedFunctionOpt<TBitNot, TUnaryArgsOpt>(registry, "BitNot");
  21. }
  22. } // namespace NMiniKQL
  23. } // namespace NKikimr