aboutsummaryrefslogtreecommitdiff
path: root/tftf/tests/extensions/sve
diff options
context:
space:
mode:
Diffstat (limited to 'tftf/tests/extensions/sve')
-rw-r--r--tftf/tests/extensions/sve/sve_operations.S39
-rw-r--r--tftf/tests/extensions/sve/test_sve.c13
2 files changed, 4 insertions, 48 deletions
diff --git a/tftf/tests/extensions/sve/sve_operations.S b/tftf/tests/extensions/sve/sve_operations.S
deleted file mode 100644
index e528b2bfe..000000000
--- a/tftf/tests/extensions/sve/sve_operations.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#include <asm_macros.S>
-
-#include "./test_sve.h"
-
-#ifdef __aarch64__
-#if __GNUC__ > 8 || (__GNUC__ == 8 && __GNUC_MINOR__ > 0)
-
-/*
- * Based on example code from the Arm Compiler Scalable Vector Extension User
- * Guide[1].
- * [1] https://developer.arm.com/docs/100891/latest/getting-started-with-the-sve-compiler/compiling-c-and-c-code-for-sve-enabled-targets
- */
-
- .arch armv8.2-a+crc+fp16+sve
- .global sve_subtract_arrays
-func sve_subtract_arrays
- mov x4, SVE_ARRAYSIZE
- mov x5, x4
- mov x3, 0
- whilelo p0.s, xzr, x4
-.loop:
- ld1w z0.s, p0/z, [x1, x3, lsl 2]
- ld1w z1.s, p0/z, [x2, x3, lsl 2]
- sub z0.s, z0.s, z1.s
- st1w z0.s, p0, [x0, x3, lsl 2]
- incw x3
- whilelo p0.s, x3, x5
- bne .loop
- ret
-endfunc sve_subtract_arrays
-
-#endif /* __GNUC__ > 8 || (__GNUC__ == 8 && __GNUC_MINOR__ > 0) */
-#endif /* __aarch64__ */
diff --git a/tftf/tests/extensions/sve/test_sve.c b/tftf/tests/extensions/sve/test_sve.c
index 235e2b8e3..bdd76e180 100644
--- a/tftf/tests/extensions/sve/test_sve.c
+++ b/tftf/tests/extensions/sve/test_sve.c
@@ -8,15 +8,14 @@
#include <arch_helpers.h>
#include <debug.h>
#include <stdlib.h>
+#include <test_helpers.h>
#include <tftf_lib.h>
+#include <lib/extensions/sve.h>
#include "./test_sve.h"
#if __GNUC__ > 8 || (__GNUC__ == 8 && __GNUC_MINOR__ > 0)
-extern void sve_subtract_arrays(int *difference, const int *sve_op_1,
- const int *sve_op_2);
-
static int sve_difference[SVE_ARRAYSIZE];
static int sve_op_1[SVE_ARRAYSIZE];
static int sve_op_2[SVE_ARRAYSIZE];
@@ -32,11 +31,7 @@ static int sve_op_2[SVE_ARRAYSIZE];
*/
test_result_t test_sve_support(void)
{
- /* Check if SVE is implemented and usable */
- if (is_armv8_2_sve_present() == false) {
- tftf_testcase_printf("SVE support absent\n");
- return TEST_RESULT_SKIPPED;
- }
+ SKIP_TEST_IF_SVE_NOT_SUPPORTED();
for (int i = 0; i < SVE_ARRAYSIZE; i++) {
/* Generate a random number between 200 and 299 */
@@ -46,7 +41,7 @@ test_result_t test_sve_support(void)
}
/* Perform SVE operations */
- sve_subtract_arrays(sve_difference, sve_op_1, sve_op_2);
+ sve_subtract_arrays(sve_difference, sve_op_1, sve_op_2, SVE_ARRAYSIZE);
return TEST_RESULT_SUCCESS;
}