Path: blob/master/tools/testing/selftests/arm64/fp/za-fork-asm.S
26289 views
// SPDX-License-Identifier: GPL-2.0-only1// Copyright (C) 2021 ARM Limited.23#include "sme-inst.h"45.arch_extension sve67#define MAGIC 4289#define MAXVL 204810#define MAXVL_B (MAXVL / 8)1112.pushsection .text13.data14.align 415scratch:16.space MAXVL_B17.popsection1819.globl fork_test20fork_test:21smstart_za2223// For simplicity just set one word in one vector, other tests24// cover general data corruption issues.25ldr x0, =scratch26mov x1, #MAGIC27str x1, [x0]28mov w12, wzr29_ldr_za 12, 0 // ZA.H[W12] loaded from [X0]3031// Tail call into the C portion that does the fork & verify32b fork_test_c3334.globl verify_fork35verify_fork:36// SVCR should have ZA=1, SM=037mrs x0, S3_3_C4_C2_238and x1, x0, #339cmp x1, #240beq 1f41mov x0, xzr42b 100f431:4445// ZA should still have the value we loaded46ldr x0, =scratch47mov w12, wzr48_str_za 12, 0 // ZA.H[W12] stored to [X0]49ldr x1, [x0]50cmp x1, #MAGIC51beq 2f52mov x0, xzr53b 100f54552:56// All tests passed57mov x0, #158100:59ret60616263