Unary XOR reduction operator
494599
def uxor(self):
        """"""
        return reduce(operator.xor, self._items, self.ftype.box(0))
917961
def is_unary_operator(oper):
    """"""
    # definition:
    # member in class
    # ret-type operator symbol()
    # ret-type operator [++ --](int)
    # globally
    # ret-type operator symbol( arg )
    # ret-type operator [++ --](X&, int)
    symbols = ['!', '&', '~', '*', '+', '++', '-', '--']
    if not isinstance(oper, calldef_members.operator_t):
        return False
    if oper.symbol not in symbols:
        return False
    if isinstance(oper, calldef_members.member_operator_t):
        if len(oper.arguments) == 0:
            return True
        elif oper.symbol in ['++', '--'] and \
                isinstance(oper.arguments[0].decl_type, cpptypes.int_t):
            return True
        return False

    if len(oper.arguments) == 1:
        return True
    elif oper.symbol in ['++', '--'] \
            and len(oper.arguments) == 2 \
            and isinstance(oper.arguments[1].decl_type, cpptypes.int_t):
        # may be I need to add additional check whether first argument is
        # reference or not?
        return True
    return False
790365
def signed_tree_multiplier(A, B, reducer=adders.wallace_reducer, adder_func=adders.kogge_stone):
    """"""
    if len(A) == 1 or len(B) == 1:
        raise pyrtl.PyrtlError("sign bit required, one or both wires too small")

    aneg, bneg = A[-1], B[-1]
    a = _twos_comp_conditional(A, aneg)
    b = _twos_comp_conditional(B, bneg)

    res = tree_multiplier(a[:-1], b[:-1]).zero_extended(len(A) + len(B))
    return _twos_comp_conditional(res, aneg ^ bneg)
858604
def _xor8(ins):
    
    op1, op2 = tuple(ins.quad[2:])
    if _int_ops(op1, op2) is not None:
        op1, op2 = _int_ops(op1, op2)

        output = _8bit_oper(op1)  # True or X = not X
        if op2 == 0:  # False xor X = X
            output.append('push af')
            return output

        output.append('sub 1')
        output.append('sbc a, a')
        output.append('push af')
        return output

    output = _8bit_oper(op1, op2)
    output.append('call __XOR8')
    output.append('push af')
    REQUIRES.add('xor8.asm')

    return output
126049
public static void xor(ByteBuffer src, ByteBuffer dst, int mask) {
    	int remainder = src.remaining() % 4;
    	int remaining = src.remaining() - remainder;
    	int end = remaining + src.position();

    	// xor a 32bit word at a time as long as possible
    	while (src.position() < end) {
    		int masked = src.getInt() ^ mask;
    		dst.putInt(masked);
    	}

    	// xor the remaining 3, 2, or 1 bytes
    	byte b;
    	switch (remainder) {
    	case 3:
    		b = (byte) (src.get() ^ ((mask >> 24) & 0xff));
    		dst.put(b);
    		b = (byte) (src.get() ^ ((mask >> 16) & 0xff));
    		dst.put(b);
    		b = (byte) (src.get() ^ ((mask >> 8) & 0xff));
    		dst.put(b);
    		break;
    	case 2:
    		b = (byte) (src.get() ^ ((mask >> 24) & 0xff));
    		dst.put(b);
    		b = (byte) (src.get() ^ ((mask >> 16) & 0xff));
    		dst.put(b);
    		break;
    	case 1:
    		b = (byte) (src.get() ^ (mask >> 24));
    		dst.put(b);
    		break;
    	case 0:
		default:
			break;
    	}
    }
298709
def make_unary(lineno, operator, operand, func=None, type_=None):
    
    return symbols.UNARY.make_node(lineno, operator, operand, func, type_)
865784
def p_xor_p_expression(tok):
        """"""
        if len(tok) == 4:
            tok[0] = LogicalBinOpRule(tok[2], tok[1], tok[3])
        else:
            tok[0] = tok[1]
439674
public void xor(BitMatrix mask) {
    if (width != mask.getWidth() || height != mask.getHeight()
        || rowSize != mask.getRowSize()) {
      throw new IllegalArgumentException("input matrix dimensions do not match");
    }
    BitArray rowArray = new BitArray(width);
    for (int y = 0; y < height; y++) {
      int offset = y * rowSize;
      int[] row = mask.getRow(y, rowArray).getBitArray();
      for (int x = 0; x < rowSize; x++) {
        bits[offset + x] ^= row[x];
      }
    }
  }
1029337
void xor(LongBitSet other) {
		assert other.numWords <= numWords : "numWords=" + numWords + ", other.numWords=" + other.numWords;
		int pos = Math.min(numWords, other.numWords);
		while (--pos >= 0) {
			bits[pos] ^= other.bits[pos];
		}
	}
922335
def logical_xor(f1, f2):  # function factory
    '''
    '''
    def f_xor(arr):
        return np.logical_xor(f1(arr), f2(arr))
    f_xor.__name__ = f1.__name__ + "_xor_" + f2.__name__
    return f_xor
918721
def unary_operation(self, rule, right, **kwargs):
        
        return self.evaluate_unop(rule.operation, right, **kwargs)
521387
def xorsum(t):
    
    _b = t[0]
    for i in t[1:]:
        _b = _b ^ i
        _b &= 0xff
    return _b
635960
def _xor_block(a, b):
    
    return ''.join([chr(ord(x) ^ ord(y)) for (x, y) in zip(a, b)])
281338
def calculate_unaryop(self, node, next_node):
        """"""
        position = (next_node.first_line, next_node.first_col + 1)
        possible = []
        for ch in OPERATORS[node.__class__]:
            try:
                pos = self.operators[ch].find_previous(position)
                if pos[1] < position:
                    possible.append(pos)
            except KeyError:
                pass

        return NodeWithPosition(
            *min(possible, key=lambda x: tuple(map(sub, position, x[0])))
        )
1289664
void d2xy(int n, int d, int[] xy) {
        int rx, ry, s, t = d;
        xy[0] = 0;
        xy[1] = 0;
        for (s = 1; s != n; s <<= 1) {
            rx = 1 & (t >> 1);
            ry = 1 & (t ^ rx);
            rot(s, xy, rx, ry);
            // if s was bits then shift
            xy[0] += s * rx;
            xy[1] += s * ry;
            t /= 4;
        }
    }
1309700
def XOR(classical_reg1, classical_reg2):
    
    left, right = unpack_reg_val_pair(classical_reg1, classical_reg2)
    return ClassicalExclusiveOr(left, right)
585773
public static function doUnaryOperation($operator, &$value)
    {
        if (self::$unaryOperations === null) {
            self::$unaryOperations = [
                    self::BITWISE_NOT   => function (&$i) { return ~$i; },
                    self::NOT           => function (&$i) { return !$i; },
                    self::INCREMENT     => function (&$i) { return $i++; },
                    self::DECREMENT     => function (&$i) { return $i--; },
                    self::PRE_INCREMENT => function (&$i) { return ++$i; },
                    self::PRE_DECREMENT => function (&$i) { return --$i; },
                    self::NEGATION      => function (&$i) { return -$i; },
                    self::PLUS          => function (&$i) { return +$i; },
            ];
        }

        if (!isset(self::$unaryOperations[$operator])) {
            throw new PinqException('Unary operator \'%s\' is not supported', $operator);
        }

        $operation = self::$unaryOperations[$operator];

        return $operation($value);
    }