dbms: add functions bitTestAny, bitTestAll (non-vectorized) and tests [#METR-17245]

This commit is contained in:
Andrey Mironov 2015-08-20 15:07:29 +03:00
parent 5374c2a927
commit 8b890f1c06
4 changed files with 1059 additions and 0 deletions

View File

@ -1447,6 +1447,7 @@ public:
};
}
private:
template <typename T> bool execute(
Block & block, const ColumnNumbers & arguments, const size_t result,
const IColumn * const value_col_untyped)
@ -1564,4 +1565,174 @@ public:
}
};
template <typename Impl>
struct FunctionBitTestMany : public IFunction
{
public:
static constexpr auto && name = Impl::name;
static IFunction * create(const Context &) { return new FunctionBitTestMany; }
String getName() const override { return name; }
DataTypePtr getReturnType(const DataTypes & arguments) const override
{
if (arguments.size() < 2)
throw Exception{
"Number of arguments for function " + getName() + " doesn't match: passed "
+ toString(arguments.size()) + ", should be at least 2.",
ErrorCodes::TOO_LESS_ARGUMENTS_FOR_FUNCTION
};
const auto first_arg = arguments.front().get();
if (!typeid_cast<const DataTypeUInt8 *>(first_arg) && !typeid_cast<const DataTypeUInt16 *>(first_arg) &&
!typeid_cast<const DataTypeUInt32 *>(first_arg) && !typeid_cast<const DataTypeUInt64 *>(first_arg) &&
!typeid_cast<const DataTypeInt8 *>(first_arg) && !typeid_cast<const DataTypeInt16 *>(first_arg) &&
!typeid_cast<const DataTypeInt32 *>(first_arg) && !typeid_cast<const DataTypeInt64 *>(first_arg))
throw Exception{
"Illegal type " + first_arg->getName() + " of first argument of function " + getName(),
ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT
};
for (const auto i : ext::range(1, arguments.size()))
{
const auto pos_arg = arguments[i].get();
if (!typeid_cast<const DataTypeUInt8 *>(pos_arg) && !typeid_cast<const DataTypeUInt16 *>(pos_arg) &&
!typeid_cast<const DataTypeUInt32 *>(pos_arg) && !typeid_cast<const DataTypeUInt64 *>(pos_arg))
throw Exception{
"Illegal type " + pos_arg->getName() + " of " + toString(i) + " argument of function " + getName(),
ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT
};
}
return new DataTypeUInt8;
}
void execute(Block & block, const ColumnNumbers & arguments, const size_t result) override
{
const auto value_col = block.getByPosition(arguments.front()).column.get();
if (!execute<UInt8>(block, arguments, result, value_col) &&
!execute<UInt16>(block, arguments, result, value_col) &&
!execute<UInt32>(block, arguments, result, value_col) &&
!execute<UInt64>(block, arguments, result, value_col) &&
!execute<Int8>(block, arguments, result, value_col) &&
!execute<Int16>(block, arguments, result, value_col) &&
!execute<Int32>(block, arguments, result, value_col) &&
!execute<Int64>(block, arguments, result, value_col))
throw Exception{
"Illegal column " + value_col->getName() + " of argument of function " + getName(),
ErrorCodes::ILLEGAL_COLUMN
};
}
private:
template <typename T> bool execute(
Block & block, const ColumnNumbers & arguments, const size_t result,
const IColumn * const value_col_untyped)
{
if (const auto value_col = typeid_cast<const ColumnVector<T> *>(value_col_untyped))
{
const auto size = value_col->size();
const auto & mask = createMask<T>(size, block, arguments);
const auto & val = value_col->getData();
const auto out_col = new ColumnVector<UInt8>(size);
ColumnPtr out_col_ptr{out_col};
block.getByPosition(result).column = out_col_ptr;
auto & out = out_col->getData();
for (const auto i : ext::range(0, size))
out[i] = Impl::combine(val[i], mask[i]);
return true;
}
else if (const auto value_col = typeid_cast<const ColumnConst<T> *>(value_col_untyped))
{
const auto size = value_col->size();
const auto & mask = createMask<T>(size, block, arguments);
const auto & val = value_col->getData();
const auto out_col = new ColumnVector<UInt8>(size);
ColumnPtr out_col_ptr{out_col};
block.getByPosition(result).column = out_col_ptr;
auto & out = out_col->getData();
for (const auto i : ext::range(0, size))
out[i] = Impl::combine(val, mask[i]);
return true;
}
return false;
}
template <typename T>
PODArray<T> createMask(const std::size_t size, const Block & block, const ColumnNumbers & arguments)
{
PODArray<T> mask(size, T{});
for (const auto i : ext::range(1, arguments.size()))
addToMask(mask, block.getByPosition(arguments[i]).column.get());
return mask;
}
template <typename ValueType>
void addToMask(PODArray<ValueType> & mask, const IColumn * const pos_col)
{
if (!addToMaskImpl<UInt8>(mask, pos_col) && !addToMaskImpl<UInt16>(mask, pos_col) &&
!addToMaskImpl<UInt32>(mask, pos_col) && !addToMaskImpl<UInt64>(mask, pos_col))
throw Exception{
"Illegal column " + pos_col->getName() + " of argument of function " + getName(),
ErrorCodes::ILLEGAL_COLUMN
};
}
template <typename PosType, typename ValueType>
bool addToMaskImpl(PODArray<ValueType> & mask, const IColumn * const pos_col_untyped)
{
if (const auto pos_col = typeid_cast<const ColumnVector<PosType> *>(pos_col_untyped))
{
const auto & pos = pos_col->getData();
for (const auto i : ext::range(0, mask.size()))
mask[i] = mask[i] | (1 << pos[i]);
return true;
}
else if (const auto pos_col = typeid_cast<const ColumnConst<PosType> *>(pos_col_untyped))
{
const auto & pos = pos_col->getData();
const auto new_mask = 1 << pos;
for (const auto i : ext::range(0, mask.size()))
mask[i] = mask[i] | new_mask;
return true;
}
return false;
}
};
struct BitTestAnyImpl
{
static constexpr auto name = "bitTestAny";
template <typename T> static UInt8 combine(const T val, const T mask) { return (val & mask) != 0; }
};
struct BitTestAllImpl
{
static constexpr auto name = "bitTestAll";
template <typename T> static UInt8 combine(const T val, const T mask) { return (val & mask) == mask; }
};
using FunctionBitTestAny = FunctionBitTestMany<BitTestAnyImpl>;
using FunctionBitTestAll = FunctionBitTestMany<BitTestAllImpl>;
}

View File

@ -16,6 +16,8 @@ void registerFunctionsCoding(FunctionFactory & factory)
factory.registerFunction<FunctionUnhex>();
factory.registerFunction<FunctionBitmaskToArray>();
factory.registerFunction<FunctionBitTest>();
factory.registerFunction<FunctionBitTestAny>();
factory.registerFunction<FunctionBitTestAll>();
}
}

View File

@ -0,0 +1,771 @@
1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 0 0 0 0 0 0 0 0 0 0
1 1 1 0 0 0 0 0 0 0 1
1 2 2 0 0 0 0 0 0 1 0
1 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96 0 1 1 0 0 0 0 0
1 97 97 0 1 1 0 0 0 0 1
1 98 98 0 1 1 0 0 0 1 0
1 99 99 0 1 1 0 0 0 1 1
1 100 100 0 1 1 0 0 1 0 0
1 101 101 0 1 1 0 0 1 0 1
1 102 102 0 1 1 0 0 1 1 0
1 103 103 0 1 1 0 0 1 1 1
1 104 104 0 1 1 0 1 0 0 0
1 105 105 0 1 1 0 1 0 0 1
1 106 106 0 1 1 0 1 0 1 0
1 107 107 0 1 1 0 1 0 1 1
1 108 108 0 1 1 0 1 1 0 0
1 109 109 0 1 1 0 1 1 0 1
1 110 110 0 1 1 0 1 1 1 0
1 111 111 0 1 1 0 1 1 1 1
1 112 112 0 1 1 1 0 0 0 0
1 113 113 0 1 1 1 0 0 0 1
1 114 114 0 1 1 1 0 0 1 0
1 115 115 0 1 1 1 0 0 1 1
1 116 116 0 1 1 1 0 1 0 0
1 117 117 0 1 1 1 0 1 0 1
1 118 118 0 1 1 1 0 1 1 0
1 119 119 0 1 1 1 0 1 1 1
1 120 120 0 1 1 1 1 0 0 0
1 121 121 0 1 1 1 1 0 0 1
1 122 122 0 1 1 1 1 0 1 0
1 123 123 0 1 1 1 1 0 1 1
1 124 124 0 1 1 1 1 1 0 0
1 125 125 0 1 1 1 1 1 0 1
1 126 126 0 1 1 1 1 1 1 0
1 127 127 0 1 1 1 1 1 1 1
1 128 128 1 0 0 0 0 0 0 0
1 129 129 1 0 0 0 0 0 0 1
1 130 130 1 0 0 0 0 0 1 0
1 131 131 1 0 0 0 0 0 1 1
1 132 132 1 0 0 0 0 1 0 0
1 133 133 1 0 0 0 0 1 0 1
1 134 134 1 0 0 0 0 1 1 0
1 135 135 1 0 0 0 0 1 1 1
1 136 136 1 0 0 0 1 0 0 0
1 137 137 1 0 0 0 1 0 0 1
1 138 138 1 0 0 0 1 0 1 0
1 139 139 1 0 0 0 1 0 1 1
1 140 140 1 0 0 0 1 1 0 0
1 141 141 1 0 0 0 1 1 0 1
1 142 142 1 0 0 0 1 1 1 0
1 143 143 1 0 0 0 1 1 1 1
1 144 144 1 0 0 1 0 0 0 0
1 145 145 1 0 0 1 0 0 0 1
1 146 146 1 0 0 1 0 0 1 0
1 147 147 1 0 0 1 0 0 1 1
1 148 148 1 0 0 1 0 1 0 0
1 149 149 1 0 0 1 0 1 0 1
1 150 150 1 0 0 1 0 1 1 0
1 151 151 1 0 0 1 0 1 1 1
1 152 152 1 0 0 1 1 0 0 0
1 153 153 1 0 0 1 1 0 0 1
1 154 154 1 0 0 1 1 0 1 0
1 155 155 1 0 0 1 1 0 1 1
1 156 156 1 0 0 1 1 1 0 0
1 157 157 1 0 0 1 1 1 0 1
1 158 158 1 0 0 1 1 1 1 0
1 159 159 1 0 0 1 1 1 1 1
1 160 160 1 0 1 0 0 0 0 0
1 161 161 1 0 1 0 0 0 0 1
1 162 162 1 0 1 0 0 0 1 0
1 163 163 1 0 1 0 0 0 1 1
1 164 164 1 0 1 0 0 1 0 0
1 165 165 1 0 1 0 0 1 0 1
1 166 166 1 0 1 0 0 1 1 0
1 167 167 1 0 1 0 0 1 1 1
1 168 168 1 0 1 0 1 0 0 0
1 169 169 1 0 1 0 1 0 0 1
1 170 170 1 0 1 0 1 0 1 0
1 171 171 1 0 1 0 1 0 1 1
1 172 172 1 0 1 0 1 1 0 0
1 173 173 1 0 1 0 1 1 0 1
1 174 174 1 0 1 0 1 1 1 0
1 175 175 1 0 1 0 1 1 1 1
1 176 176 1 0 1 1 0 0 0 0
1 177 177 1 0 1 1 0 0 0 1
1 178 178 1 0 1 1 0 0 1 0
1 179 179 1 0 1 1 0 0 1 1
1 180 180 1 0 1 1 0 1 0 0
1 181 181 1 0 1 1 0 1 0 1
1 182 182 1 0 1 1 0 1 1 0
1 183 183 1 0 1 1 0 1 1 1
1 184 184 1 0 1 1 1 0 0 0
1 185 185 1 0 1 1 1 0 0 1
1 186 186 1 0 1 1 1 0 1 0
1 187 187 1 0 1 1 1 0 1 1
1 188 188 1 0 1 1 1 1 0 0
1 189 189 1 0 1 1 1 1 0 1
1 190 190 1 0 1 1 1 1 1 0
1 191 191 1 0 1 1 1 1 1 1
1 192 192 1 1 0 0 0 0 0 0
1 193 193 1 1 0 0 0 0 0 1
1 194 194 1 1 0 0 0 0 1 0
1 195 195 1 1 0 0 0 0 1 1
1 196 196 1 1 0 0 0 1 0 0
1 197 197 1 1 0 0 0 1 0 1
1 198 198 1 1 0 0 0 1 1 0
1 199 199 1 1 0 0 0 1 1 1
1 200 200 1 1 0 0 1 0 0 0
1 201 201 1 1 0 0 1 0 0 1
1 202 202 1 1 0 0 1 0 1 0
1 203 203 1 1 0 0 1 0 1 1
1 204 204 1 1 0 0 1 1 0 0
1 205 205 1 1 0 0 1 1 0 1
1 206 206 1 1 0 0 1 1 1 0
1 207 207 1 1 0 0 1 1 1 1
1 208 208 1 1 0 1 0 0 0 0
1 209 209 1 1 0 1 0 0 0 1
1 210 210 1 1 0 1 0 0 1 0
1 211 211 1 1 0 1 0 0 1 1
1 212 212 1 1 0 1 0 1 0 0
1 213 213 1 1 0 1 0 1 0 1
1 214 214 1 1 0 1 0 1 1 0
1 215 215 1 1 0 1 0 1 1 1
1 216 216 1 1 0 1 1 0 0 0
1 217 217 1 1 0 1 1 0 0 1
1 218 218 1 1 0 1 1 0 1 0
1 219 219 1 1 0 1 1 0 1 1
1 220 220 1 1 0 1 1 1 0 0
1 221 221 1 1 0 1 1 1 0 1
1 222 222 1 1 0 1 1 1 1 0
1 223 223 1 1 0 1 1 1 1 1
1 224 224 1 1 1 0 0 0 0 0
1 225 225 1 1 1 0 0 0 0 1
1 226 226 1 1 1 0 0 0 1 0
1 227 227 1 1 1 0 0 0 1 1
1 228 228 1 1 1 0 0 1 0 0
1 229 229 1 1 1 0 0 1 0 1
1 230 230 1 1 1 0 0 1 1 0
1 231 231 1 1 1 0 0 1 1 1
1 232 232 1 1 1 0 1 0 0 0
1 233 233 1 1 1 0 1 0 0 1
1 234 234 1 1 1 0 1 0 1 0
1 235 235 1 1 1 0 1 0 1 1
1 236 236 1 1 1 0 1 1 0 0
1 237 237 1 1 1 0 1 1 0 1
1 238 238 1 1 1 0 1 1 1 0
1 239 239 1 1 1 0 1 1 1 1
1 240 240 1 1 1 1 0 0 0 0
1 241 241 1 1 1 1 0 0 0 1
1 242 242 1 1 1 1 0 0 1 0
1 243 243 1 1 1 1 0 0 1 1
1 244 244 1 1 1 1 0 1 0 0
1 245 245 1 1 1 1 0 1 0 1
1 246 246 1 1 1 1 0 1 1 0
1 247 247 1 1 1 1 0 1 1 1
1 248 248 1 1 1 1 1 0 0 0
1 249 249 1 1 1 1 1 0 0 1
1 250 250 1 1 1 1 1 0 1 0
1 251 251 1 1 1 1 1 0 1 1
1 252 252 1 1 1 1 1 1 0 0
1 253 253 1 1 1 1 1 1 0 1
1 254 254 1 1 1 1 1 1 1 0
1 255 255 1 1 1 1 1 1 1 1
1 0 0 0 0 0 0 0 0 0 0
1 1 1 0 0 0 0 0 0 0 1
1 2 2 0 0 0 0 0 0 1 0
1 3 3 0 0 0 0 0 0 1 1
1 4 4 0 0 0 0 0 1 0 0
1 5 5 0 0 0 0 0 1 0 1
1 6 6 0 0 0 0 0 1 1 0
1 7 7 0 0 0 0 0 1 1 1
1 8 8 0 0 0 0 1 0 0 0
1 9 9 0 0 0 0 1 0 0 1
1 10 10 0 0 0 0 1 0 1 0
1 11 11 0 0 0 0 1 0 1 1
1 12 12 0 0 0 0 1 1 0 0
1 13 13 0 0 0 0 1 1 0 1
1 14 14 0 0 0 0 1 1 1 0
1 15 15 0 0 0 0 1 1 1 1
1 16 16 0 0 0 1 0 0 0 0
1 17 17 0 0 0 1 0 0 0 1
1 18 18 0 0 0 1 0 0 1 0
1 19 19 0 0 0 1 0 0 1 1
1 20 20 0 0 0 1 0 1 0 0
1 21 21 0 0 0 1 0 1 0 1
1 22 22 0 0 0 1 0 1 1 0
1 23 23 0 0 0 1 0 1 1 1
1 24 24 0 0 0 1 1 0 0 0
1 25 25 0 0 0 1 1 0 0 1
1 26 26 0 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0
1 73 73 0 1 0 0 1 0 0 1
1 74 74 0 1 0 0 1 0 1 0
1 75 75 0 1 0 0 1 0 1 1
1 76 76 0 1 0 0 1 1 0 0
1 77 77 0 1 0 0 1 1 0 1
1 78 78 0 1 0 0 1 1 1 0
1 79 79 0 1 0 0 1 1 1 1
1 80 80 0 1 0 1 0 0 0 0
1 81 81 0 1 0 1 0 0 0 1
1 82 82 0 1 0 1 0 0 1 0
1 83 83 0 1 0 1 0 0 1 1
1 84 84 0 1 0 1 0 1 0 0
1 85 85 0 1 0 1 0 1 0 1
1 86 86 0 1 0 1 0 1 1 0
1 87 87 0 1 0 1 0 1 1 1
1 88 88 0 1 0 1 1 0 0 0
1 89 89 0 1 0 1 1 0 0 1
1 90 90 0 1 0 1 1 0 1 0
1 91 91 0 1 0 1 1 0 1 1
1 92 92 0 1 0 1 1 1 0 0
1 93 93 0 1 0 1 1 1 0 1
1 94 94 0 1 0 1 1 1 1 0
1 95 95 0 1 0 1 1 1 1 1
1 96 96 0 1 1 0 0 0 0 0
1 97 97 0 1 1 0 0 0 0 1
1 98 98 0 1 1 0 0 0 1 0
1 99 99 0 1 1 0 0 0 1 1
1 100 100 0 1 1 0 0 1 0 0
1 101 101 0 1 1 0 0 1 0 1
1 102 102 0 1 1 0 0 1 1 0
1 103 103 0 1 1 0 0 1 1 1
1 104 104 0 1 1 0 1 0 0 0
1 105 105 0 1 1 0 1 0 0 1
1 106 106 0 1 1 0 1 0 1 0
1 107 107 0 1 1 0 1 0 1 1
1 108 108 0 1 1 0 1 1 0 0
1 109 109 0 1 1 0 1 1 0 1
1 110 110 0 1 1 0 1 1 1 0
1 111 111 0 1 1 0 1 1 1 1
1 112 112 0 1 1 1 0 0 0 0
1 113 113 0 1 1 1 0 0 0 1
1 114 114 0 1 1 1 0 0 1 0
1 115 115 0 1 1 1 0 0 1 1
1 116 116 0 1 1 1 0 1 0 0
1 117 117 0 1 1 1 0 1 0 1
1 118 118 0 1 1 1 0 1 1 0
1 119 119 0 1 1 1 0 1 1 1
1 120 120 0 1 1 1 1 0 0 0
1 121 121 0 1 1 1 1 0 0 1
1 122 122 0 1 1 1 1 0 1 0
1 123 123 0 1 1 1 1 0 1 1
1 124 124 0 1 1 1 1 1 0 0
1 125 125 0 1 1 1 1 1 0 1
1 126 126 0 1 1 1 1 1 1 0
1 127 127 0 1 1 1 1 1 1 1
1 128 128 1 0 0 0 0 0 0 0
1 129 129 1 0 0 0 0 0 0 1
1 130 130 1 0 0 0 0 0 1 0
1 131 131 1 0 0 0 0 0 1 1
1 132 132 1 0 0 0 0 1 0 0
1 133 133 1 0 0 0 0 1 0 1
1 134 134 1 0 0 0 0 1 1 0
1 135 135 1 0 0 0 0 1 1 1
1 136 136 1 0 0 0 1 0 0 0
1 137 137 1 0 0 0 1 0 0 1
1 138 138 1 0 0 0 1 0 1 0
1 139 139 1 0 0 0 1 0 1 1
1 140 140 1 0 0 0 1 1 0 0
1 141 141 1 0 0 0 1 1 0 1
1 142 142 1 0 0 0 1 1 1 0
1 143 143 1 0 0 0 1 1 1 1
1 144 144 1 0 0 1 0 0 0 0
1 145 145 1 0 0 1 0 0 0 1
1 146 146 1 0 0 1 0 0 1 0
1 147 147 1 0 0 1 0 0 1 1
1 148 148 1 0 0 1 0 1 0 0
1 149 149 1 0 0 1 0 1 0 1
1 150 150 1 0 0 1 0 1 1 0
1 151 151 1 0 0 1 0 1 1 1
1 152 152 1 0 0 1 1 0 0 0
1 153 153 1 0 0 1 1 0 0 1
1 154 154 1 0 0 1 1 0 1 0
1 155 155 1 0 0 1 1 0 1 1
1 156 156 1 0 0 1 1 1 0 0
1 157 157 1 0 0 1 1 1 0 1
1 158 158 1 0 0 1 1 1 1 0
1 159 159 1 0 0 1 1 1 1 1
1 160 160 1 0 1 0 0 0 0 0
1 161 161 1 0 1 0 0 0 0 1
1 162 162 1 0 1 0 0 0 1 0
1 163 163 1 0 1 0 0 0 1 1
1 164 164 1 0 1 0 0 1 0 0
1 165 165 1 0 1 0 0 1 0 1
1 166 166 1 0 1 0 0 1 1 0
1 167 167 1 0 1 0 0 1 1 1
1 168 168 1 0 1 0 1 0 0 0
1 169 169 1 0 1 0 1 0 0 1
1 170 170 1 0 1 0 1 0 1 0
1 171 171 1 0 1 0 1 0 1 1
1 172 172 1 0 1 0 1 1 0 0
1 173 173 1 0 1 0 1 1 0 1
1 174 174 1 0 1 0 1 1 1 0
1 175 175 1 0 1 0 1 1 1 1
1 176 176 1 0 1 1 0 0 0 0
1 177 177 1 0 1 1 0 0 0 1
1 178 178 1 0 1 1 0 0 1 0
1 179 179 1 0 1 1 0 0 1 1
1 180 180 1 0 1 1 0 1 0 0
1 181 181 1 0 1 1 0 1 0 1
1 182 182 1 0 1 1 0 1 1 0
1 183 183 1 0 1 1 0 1 1 1
1 184 184 1 0 1 1 1 0 0 0
1 185 185 1 0 1 1 1 0 0 1
1 186 186 1 0 1 1 1 0 1 0
1 187 187 1 0 1 1 1 0 1 1
1 188 188 1 0 1 1 1 1 0 0
1 189 189 1 0 1 1 1 1 0 1
1 190 190 1 0 1 1 1 1 1 0
1 191 191 1 0 1 1 1 1 1 1
1 192 192 1 1 0 0 0 0 0 0
1 193 193 1 1 0 0 0 0 0 1
1 194 194 1 1 0 0 0 0 1 0
1 195 195 1 1 0 0 0 0 1 1
1 196 196 1 1 0 0 0 1 0 0
1 197 197 1 1 0 0 0 1 0 1
1 198 198 1 1 0 0 0 1 1 0
1 199 199 1 1 0 0 0 1 1 1
1 200 200 1 1 0 0 1 0 0 0
1 201 201 1 1 0 0 1 0 0 1
1 202 202 1 1 0 0 1 0 1 0
1 203 203 1 1 0 0 1 0 1 1
1 204 204 1 1 0 0 1 1 0 0
1 205 205 1 1 0 0 1 1 0 1
1 206 206 1 1 0 0 1 1 1 0
1 207 207 1 1 0 0 1 1 1 1
1 208 208 1 1 0 1 0 0 0 0
1 209 209 1 1 0 1 0 0 0 1
1 210 210 1 1 0 1 0 0 1 0
1 211 211 1 1 0 1 0 0 1 1
1 212 212 1 1 0 1 0 1 0 0
1 213 213 1 1 0 1 0 1 0 1
1 214 214 1 1 0 1 0 1 1 0
1 215 215 1 1 0 1 0 1 1 1
1 216 216 1 1 0 1 1 0 0 0
1 217 217 1 1 0 1 1 0 0 1
1 218 218 1 1 0 1 1 0 1 0
1 219 219 1 1 0 1 1 0 1 1
1 220 220 1 1 0 1 1 1 0 0
1 221 221 1 1 0 1 1 1 0 1
1 222 222 1 1 0 1 1 1 1 0
1 223 223 1 1 0 1 1 1 1 1
1 224 224 1 1 1 0 0 0 0 0
1 225 225 1 1 1 0 0 0 0 1
1 226 226 1 1 1 0 0 0 1 0
1 227 227 1 1 1 0 0 0 1 1
1 228 228 1 1 1 0 0 1 0 0
1 229 229 1 1 1 0 0 1 0 1
1 230 230 1 1 1 0 0 1 1 0
1 231 231 1 1 1 0 0 1 1 1
1 232 232 1 1 1 0 1 0 0 0
1 233 233 1 1 1 0 1 0 0 1
1 234 234 1 1 1 0 1 0 1 0
1 235 235 1 1 1 0 1 0 1 1
1 236 236 1 1 1 0 1 1 0 0
1 237 237 1 1 1 0 1 1 0 1
1 238 238 1 1 1 0 1 1 1 0
1 239 239 1 1 1 0 1 1 1 1
1 240 240 1 1 1 1 0 0 0 0
1 241 241 1 1 1 1 0 0 0 1
1 242 242 1 1 1 1 0 0 1 0
1 243 243 1 1 1 1 0 0 1 1
1 244 244 1 1 1 1 0 1 0 0
1 245 245 1 1 1 1 0 1 0 1
1 246 246 1 1 1 1 0 1 1 0
1 247 247 1 1 1 1 0 1 1 1
1 248 248 1 1 1 1 1 0 0 0
1 249 249 1 1 1 1 1 0 0 1
1 250 250 1 1 1 1 1 0 1 0
1 251 251 1 1 1 1 1 0 1 1
1 252 252 1 1 1 1 1 1 0 0
1 253 253 1 1 1 1 1 1 0 1
1 254 254 1 1 1 1 1 1 1 0
1 255 255 1 1 1 1 1 1 1 1
1 0 0 0 0 0 0 0 0 0 0
1 1 1 0 0 0 0 0 0 0 1
1 2 2 0 0 0 0 0 0 1 0
1 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96 0 1 1 0 0 0 0 0
1 97 97 0 1 1 0 0 0 0 1
1 98 98 0 1 1 0 0 0 1 0
1 99 99 0 1 1 0 0 0 1 1
1 100 100 0 1 1 0 0 1 0 0
1 101 101 0 1 1 0 0 1 0 1
1 102 102 0 1 1 0 0 1 1 0
1 103 103 0 1 1 0 0 1 1 1
1 104 104 0 1 1 0 1 0 0 0
1 105 105 0 1 1 0 1 0 0 1
1 106 106 0 1 1 0 1 0 1 0
1 107 107 0 1 1 0 1 0 1 1
1 108 108 0 1 1 0 1 1 0 0
1 109 109 0 1 1 0 1 1 0 1
1 110 110 0 1 1 0 1 1 1 0
1 111 111 0 1 1 0 1 1 1 1
1 112 112 0 1 1 1 0 0 0 0
1 113 113 0 1 1 1 0 0 0 1
1 114 114 0 1 1 1 0 0 1 0
1 115 115 0 1 1 1 0 0 1 1
1 116 116 0 1 1 1 0 1 0 0
1 117 117 0 1 1 1 0 1 0 1
1 118 118 0 1 1 1 0 1 1 0
1 119 119 0 1 1 1 0 1 1 1
1 120 120 0 1 1 1 1 0 0 0
1 121 121 0 1 1 1 1 0 0 1
1 122 122 0 1 1 1 1 0 1 0
1 123 123 0 1 1 1 1 0 1 1
1 124 124 0 1 1 1 1 1 0 0
1 125 125 0 1 1 1 1 1 0 1
1 126 126 0 1 1 1 1 1 1 0
1 127 127 0 1 1 1 1 1 1 1
1 128 128 1 0 0 0 0 0 0 0
1 129 129 1 0 0 0 0 0 0 1
1 130 130 1 0 0 0 0 0 1 0
1 131 131 1 0 0 0 0 0 1 1
1 132 132 1 0 0 0 0 1 0 0
1 133 133 1 0 0 0 0 1 0 1
1 134 134 1 0 0 0 0 1 1 0
1 135 135 1 0 0 0 0 1 1 1
1 136 136 1 0 0 0 1 0 0 0
1 137 137 1 0 0 0 1 0 0 1
1 138 138 1 0 0 0 1 0 1 0
1 139 139 1 0 0 0 1 0 1 1
1 140 140 1 0 0 0 1 1 0 0
1 141 141 1 0 0 0 1 1 0 1
1 142 142 1 0 0 0 1 1 1 0
1 143 143 1 0 0 0 1 1 1 1
1 144 144 1 0 0 1 0 0 0 0
1 145 145 1 0 0 1 0 0 0 1
1 146 146 1 0 0 1 0 0 1 0
1 147 147 1 0 0 1 0 0 1 1
1 148 148 1 0 0 1 0 1 0 0
1 149 149 1 0 0 1 0 1 0 1
1 150 150 1 0 0 1 0 1 1 0
1 151 151 1 0 0 1 0 1 1 1
1 152 152 1 0 0 1 1 0 0 0
1 153 153 1 0 0 1 1 0 0 1
1 154 154 1 0 0 1 1 0 1 0
1 155 155 1 0 0 1 1 0 1 1
1 156 156 1 0 0 1 1 1 0 0
1 157 157 1 0 0 1 1 1 0 1
1 158 158 1 0 0 1 1 1 1 0
1 159 159 1 0 0 1 1 1 1 1
1 160 160 1 0 1 0 0 0 0 0
1 161 161 1 0 1 0 0 0 0 1
1 162 162 1 0 1 0 0 0 1 0
1 163 163 1 0 1 0 0 0 1 1
1 164 164 1 0 1 0 0 1 0 0
1 165 165 1 0 1 0 0 1 0 1
1 166 166 1 0 1 0 0 1 1 0
1 167 167 1 0 1 0 0 1 1 1
1 168 168 1 0 1 0 1 0 0 0
1 169 169 1 0 1 0 1 0 0 1
1 170 170 1 0 1 0 1 0 1 0
1 171 171 1 0 1 0 1 0 1 1
1 172 172 1 0 1 0 1 1 0 0
1 173 173 1 0 1 0 1 1 0 1
1 174 174 1 0 1 0 1 1 1 0
1 175 175 1 0 1 0 1 1 1 1
1 176 176 1 0 1 1 0 0 0 0
1 177 177 1 0 1 1 0 0 0 1
1 178 178 1 0 1 1 0 0 1 0
1 179 179 1 0 1 1 0 0 1 1
1 180 180 1 0 1 1 0 1 0 0
1 181 181 1 0 1 1 0 1 0 1
1 182 182 1 0 1 1 0 1 1 0
1 183 183 1 0 1 1 0 1 1 1
1 184 184 1 0 1 1 1 0 0 0
1 185 185 1 0 1 1 1 0 0 1
1 186 186 1 0 1 1 1 0 1 0
1 187 187 1 0 1 1 1 0 1 1
1 188 188 1 0 1 1 1 1 0 0
1 189 189 1 0 1 1 1 1 0 1
1 190 190 1 0 1 1 1 1 1 0
1 191 191 1 0 1 1 1 1 1 1
1 192 192 1 1 0 0 0 0 0 0
1 193 193 1 1 0 0 0 0 0 1
1 194 194 1 1 0 0 0 0 1 0
1 195 195 1 1 0 0 0 0 1 1
1 196 196 1 1 0 0 0 1 0 0
1 197 197 1 1 0 0 0 1 0 1
1 198 198 1 1 0 0 0 1 1 0
1 199 199 1 1 0 0 0 1 1 1
1 200 200 1 1 0 0 1 0 0 0
1 201 201 1 1 0 0 1 0 0 1
1 202 202 1 1 0 0 1 0 1 0
1 203 203 1 1 0 0 1 0 1 1
1 204 204 1 1 0 0 1 1 0 0
1 205 205 1 1 0 0 1 1 0 1
1 206 206 1 1 0 0 1 1 1 0
1 207 207 1 1 0 0 1 1 1 1
1 208 208 1 1 0 1 0 0 0 0
1 209 209 1 1 0 1 0 0 0 1
1 210 210 1 1 0 1 0 0 1 0
1 211 211 1 1 0 1 0 0 1 1
1 212 212 1 1 0 1 0 1 0 0
1 213 213 1 1 0 1 0 1 0 1
1 214 214 1 1 0 1 0 1 1 0
1 215 215 1 1 0 1 0 1 1 1
1 216 216 1 1 0 1 1 0 0 0
1 217 217 1 1 0 1 1 0 0 1
1 218 218 1 1 0 1 1 0 1 0
1 219 219 1 1 0 1 1 0 1 1
1 220 220 1 1 0 1 1 1 0 0
1 221 221 1 1 0 1 1 1 0 1
1 222 222 1 1 0 1 1 1 1 0
1 223 223 1 1 0 1 1 1 1 1
1 224 224 1 1 1 0 0 0 0 0
1 225 225 1 1 1 0 0 0 0 1
1 226 226 1 1 1 0 0 0 1 0
1 227 227 1 1 1 0 0 0 1 1
1 228 228 1 1 1 0 0 1 0 0
1 229 229 1 1 1 0 0 1 0 1
1 230 230 1 1 1 0 0 1 1 0
1 231 231 1 1 1 0 0 1 1 1
1 232 232 1 1 1 0 1 0 0 0
1 233 233 1 1 1 0 1 0 0 1
1 234 234 1 1 1 0 1 0 1 0
1 235 235 1 1 1 0 1 0 1 1
1 236 236 1 1 1 0 1 1 0 0
1 237 237 1 1 1 0 1 1 0 1
1 238 238 1 1 1 0 1 1 1 0
1 239 239 1 1 1 0 1 1 1 1
1 240 240 1 1 1 1 0 0 0 0
1 241 241 1 1 1 1 0 0 0 1
1 242 242 1 1 1 1 0 0 1 0
1 243 243 1 1 1 1 0 0 1 1
1 244 244 1 1 1 1 0 1 0 0
1 245 245 1 1 1 1 0 1 0 1
1 246 246 1 1 1 1 0 1 1 0
1 247 247 1 1 1 1 0 1 1 1
1 248 248 1 1 1 1 1 0 0 0
1 249 249 1 1 1 1 1 0 0 1
1 250 250 1 1 1 1 1 0 1 0
1 251 251 1 1 1 1 1 0 1 1
1 252 252 1 1 1 1 1 1 0 0
1 253 253 1 1 1 1 1 1 0 1
1 254 254 1 1 1 1 1 1 1 0
1 255 255 1 1 1 1 1 1 1 1

View File

@ -0,0 +1,115 @@
select
bitTest(0, 0) = 0,
bitTest(1, 0) = 1,
bitTest(1, 1) = 0,
bitTest(0xff, 7) = 1;
select
bitTestAll(0, 0) = 0,
bitTestAll(1, 0) = 1,
bitTestAll(1, 1) = 0,
bitTestAll(0xff, 0) = 1,
bitTestAll(0xff, 1) = 1,
bitTestAll(0xff, 2) = 1,
bitTestAll(0xff, 3) = 1,
bitTestAll(0xff, 4) = 1,
bitTestAll(0xff, 5) = 1,
bitTestAll(0xff, 6) = 1,
bitTestAll(0xff, 7) = 1,
bitTestAll(0xff, 0, 1) = 1,
bitTestAll(0xff, 2, 3) = 1,
bitTestAll(0xff, 4, 5) = 1,
bitTestAll(0xff, 6, 7) = 1,
bitTestAll(0xff, 0, 1, 2, 3) = 1,
bitTestAll(0xff, 4, 5, 6, 7) = 1,
bitTestAll(0xff, 0, 1, 2, 3, 4, 5, 6, 7) = 1,
bitTestAll(0x81, 0) = 1,
bitTestAll(0x81, 1) = 0,
bitTestAll(0x81, 2) = 0,
bitTestAll(0x81, 3) = 0,
bitTestAll(0x81, 4) = 0,
bitTestAll(0x81, 5) = 0,
bitTestAll(0x81, 6) = 0,
bitTestAll(0x81, 7) = 1,
bitTestAll(0x81, 0, 1) = 0,
bitTestAll(0x81, 2, 3) = 0,
bitTestAll(0x81, 4, 5) = 0,
bitTestAll(0x81, 6, 7) = 0,
bitTestAll(0x81, 0, 1, 2, 3) = 0,
bitTestAll(0x81, 4, 5, 6, 7) = 0,
bitTestAll(0x81, 0, 1, 2, 3, 4, 5, 6, 7) = 0,
bitTestAll(0x81, 0, 7) = 1;
select
bitTestAny(0, 0) = 0,
bitTestAny(1, 0) = 1,
bitTestAny(1, 1) = 0,
bitTestAny(0xff, 0) = 1,
bitTestAny(0xff, 1) = 1,
bitTestAny(0xff, 2) = 1,
bitTestAny(0xff, 3) = 1,
bitTestAny(0xff, 4) = 1,
bitTestAny(0xff, 5) = 1,
bitTestAny(0xff, 6) = 1,
bitTestAny(0xff, 7) = 1,
bitTestAny(0xff, 0, 1) = 1,
bitTestAny(0xff, 2, 3) = 1,
bitTestAny(0xff, 4, 5) = 1,
bitTestAny(0xff, 6, 7) = 1,
bitTestAny(0xff, 0, 1, 2, 3) = 1,
bitTestAny(0xff, 4, 5, 6, 7) = 1,
bitTestAny(0xff, 0, 1, 2, 3, 4, 5, 6, 7) = 1,
bitTestAny(0x81, 0) = 1,
bitTestAny(0x81, 1) = 0,
bitTestAny(0x81, 2) = 0,
bitTestAny(0x81, 3) = 0,
bitTestAny(0x81, 4) = 0,
bitTestAny(0x81, 5) = 0,
bitTestAny(0x81, 6) = 0,
bitTestAny(0x81, 7) = 1,
bitTestAny(0x81, 0, 1) = 1,
bitTestAny(0x81, 2, 3) = 0,
bitTestAny(0x81, 4, 5) = 0,
bitTestAny(0x81, 6, 7) = 1,
bitTestAny(0x81, 0, 1, 2, 3) = 1,
bitTestAny(0x81, 4, 5, 6, 7) = 1,
bitTestAny(0x81, 0, 1, 2, 3, 4, 5, 6, 7) = 1;
select n = n_,
number as n,
bitOr(bitShiftLeft(bitOr(bitShiftLeft(bitOr(bitShiftLeft(bitOr(bitShiftLeft(bitOr(bitShiftLeft(bitOr(bitShiftLeft(bitOr(bitShiftLeft(b7, 1), b6), 1), b5), 1), b4), 1), b3), 1), b2), 1), b1), 1), b0) as n_,
bitTest(n, 7) as b7,
bitTest(n, 6) as b6,
bitTest(n, 5) as b5,
bitTest(n, 4) as b4,
bitTest(n, 3) as b3,
bitTest(n, 2) as b2,
bitTest(n, 1) as b1,
bitTest(n, 0) as b0
from system.numbers limit 256;
select n = n_,
number as n,
bitOr(bitShiftLeft(bitOr(bitShiftLeft(bitOr(bitShiftLeft(bitOr(bitShiftLeft(bitOr(bitShiftLeft(bitOr(bitShiftLeft(bitOr(bitShiftLeft(b7, 1), b6), 1), b5), 1), b4), 1), b3), 1), b2), 1), b1), 1), b0) as n_,
bitTestAll(n, 7) as b7,
bitTestAll(n, 6) as b6,
bitTestAll(n, 5) as b5,
bitTestAll(n, 4) as b4,
bitTestAll(n, 3) as b3,
bitTestAll(n, 2) as b2,
bitTestAll(n, 1) as b1,
bitTestAll(n, 0) as b0
from system.numbers limit 256;
select n = n_,
number as n,
bitOr(bitShiftLeft(bitOr(bitShiftLeft(bitOr(bitShiftLeft(bitOr(bitShiftLeft(bitOr(bitShiftLeft(bitOr(bitShiftLeft(bitOr(bitShiftLeft(b7, 1), b6), 1), b5), 1), b4), 1), b3), 1), b2), 1), b1), 1), b0) as n_,
bitTestAny(n, 7) as b7,
bitTestAny(n, 6) as b6,
bitTestAny(n, 5) as b5,
bitTestAny(n, 4) as b4,
bitTestAny(n, 3) as b3,
bitTestAny(n, 2) as b2,
bitTestAny(n, 1) as b1,
bitTestAny(n, 0) as b0
from system.numbers limit 256;