mkql_builtins_bitxor.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 TBitXor : public TSimpleArithmeticBinary<TLeft, TRight, TOutput, TBitXor<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::CreateXor(left, right, "xor", block);
  15. }
  16. #endif
  17. };
  18. }
  19. void RegisterBitXor(IBuiltinFunctionRegistry& registry) {
  20. RegisterBinaryUnsignedFunctionOpt<TBitXor, TBinaryArgsOpt>(registry, "BitXor");
  21. }
  22. } // namespace NMiniKQL
  23. } // namespace NKikimr