141ccf82bSSarah Walker /*- 241ccf82bSSarah Walker * SPDX-License-Identifier: BSD-2-Clause 341ccf82bSSarah Walker * 441ccf82bSSarah Walker * Copyright (c) 2026 Arm Ltd 541ccf82bSSarah Walker * 641ccf82bSSarah Walker * Redistribution and use in source and binary forms, with or without 741ccf82bSSarah Walker * modification, are permitted provided that the following conditions 841ccf82bSSarah Walker * are met: 941ccf82bSSarah Walker * 1. Redistributions of source code must retain the above copyright 1041ccf82bSSarah Walker * notice, this list of conditions and the following disclaimer. 1141ccf82bSSarah Walker * 2. Redistributions in binary form must reproduce the above copyright 1241ccf82bSSarah Walker * notice, this list of conditions and the following disclaimer in the 1341ccf82bSSarah Walker * documentation and/or other materials provided with the distribution. 1441ccf82bSSarah Walker * 1541ccf82bSSarah Walker * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1641ccf82bSSarah Walker * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1741ccf82bSSarah Walker * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1841ccf82bSSarah Walker * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1941ccf82bSSarah Walker * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2041ccf82bSSarah Walker * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2141ccf82bSSarah Walker * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2241ccf82bSSarah Walker * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2341ccf82bSSarah Walker * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2441ccf82bSSarah Walker * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2541ccf82bSSarah Walker * SUCH DAMAGE. 2641ccf82bSSarah Walker */ 2741ccf82bSSarah Walker #include <sys/types.h> 2841ccf82bSSarah Walker #include <machine/ifunc.h> 2941ccf82bSSarah Walker 3041ccf82bSSarah Walker #include <elf.h> 3141ccf82bSSarah Walker 3241ccf82bSSarah Walker void *__memcpy_aarch64_simd(void *, const void *, size_t); 3341ccf82bSSarah Walker void *__memcpy_aarch64_mops(void *, const void *, size_t); 3441ccf82bSSarah Walker 3541ccf82bSSarah Walker DEFINE_UIFUNC(, void *, memcpy, (void *, const void *, size_t)) 3641ccf82bSSarah Walker { 3741ccf82bSSarah Walker if (ifunc_arg->_hwcap2 & HWCAP2_MOPS) 3841ccf82bSSarah Walker return (__memcpy_aarch64_mops); 3941ccf82bSSarah Walker 4041ccf82bSSarah Walker return (__memcpy_aarch64_simd); 4141ccf82bSSarah Walker } 4241ccf82bSSarah Walker 43