function y = xor(s,t)
%MATLAB Code Generation Library Function

%   Copyright 2006-2021 The MathWorks, Inc.
%#codegen
coder.internal.implicitExpansionBuiltin;
eml_property('associative','commutative');
eml_invariant(nargin == 2, ...
    'MATLAB:minrhs');
eml_invariant(~iscell(s) && ~iscell(t), ...
    'Coder:toolbox:unsupportedClass', mfilename, class({}));
eml_invariant(isreal(s) && isreal(t), ...
    'Coder:toolbox:xor_2', ...
    'IfNotConst','Fail');

% This call to eml_bitxor doesn't do size checks, so explicitly check here
coder.internal.assertCompatibleDims(s,t);

if islogical(s) && islogical(t)
    y = logical(bitbinop('bitxor',s,t));
else
    y = logical(eml_bitxor(uint8(logical(s)),uint8(logical(t))));
end