mesa/src/util/streaming-load-memcpy.h
Loïc Molinari 293cdbce75 util: Add AArch64 support to util_streaming_load_memcpy()
AArch64 supports non-temporal (streaming) loads and writes.
util_streaming_load_memcpy() is extended to support AArch64
non-temporal loads using inline assembly.

The mesa_util_sse41 name is updated to mesa_util_simd to reflect
support for non-x86 architectures.

This makes copies from non-cacheable to cacheable memory about 20%
faster on a Rock 5B.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34606>
2025-05-16 13:35:33 +00:00

41 lines
1.6 KiB
C

/*
* Copyright © 2013 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* Authors:
* Eric Anholt <eric@anholt.net>
* Matt Turner <mattst88@gmail.com>
*
*/
/* Copies memory from src to dst, using using non-temporal load instructions
* to get streaming read performance from uncached memory.
*/
#ifndef STREAMING_LOAD_MEMCPY_H
#define STREAMING_LOAD_MEMCPY_H
#include <stdlib.h>
void
util_streaming_load_memcpy(void *restrict dst, void *restrict src, size_t len);
#endif /* STREAMING_LOAD_MEMCPY_H */