~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/testing/selftests/arm64/fp/fp-pidbench.S

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0-only
  2 // Copyright (C) 2021 ARM Limited.
  3 // Original author: Mark Brown <broonie@kernel.org>
  4 //
  5 // Trivial syscall overhead benchmark.
  6 //
  7 // This is implemented in asm to ensure that we don't have any issues with
  8 // system libraries using instructions that disrupt the test.
  9 
 10 #include <asm/unistd.h>
 11 #include "assembler.h"
 12 
 13 .arch_extension sve
 14 
 15 .macro test_loop per_loop
 16         mov     x10, x20
 17         mov     x8, #__NR_getpid
 18         mrs     x11, CNTVCT_EL0
 19 1:
 20         \per_loop
 21         svc     #0
 22         sub     x10, x10, #1
 23         cbnz    x10, 1b
 24 
 25         mrs     x12, CNTVCT_EL0
 26         sub     x0, x12, x11
 27         bl      putdec
 28         puts    "\n"
 29 .endm
 30 
 31 // Main program entry point
 32 .globl _start
 33 function _start
 34         puts    "Iterations per test: "
 35         mov     x20, #10000
 36         lsl     x20, x20, #8
 37         mov     x0, x20
 38         bl      putdec
 39         puts    "\n"
 40 
 41         // Test having never used SVE
 42         puts    "No SVE: "
 43         test_loop
 44 
 45         // Check for SVE support - should use hwcap but that's hard in asm
 46         mrs     x0, ID_AA64PFR0_EL1
 47         ubfx    x0, x0, #32, #4
 48         cbnz    x0, 1f
 49         puts    "System does not support SVE\n"
 50         b       out
 51 1:
 52 
 53         // Execute a SVE instruction
 54         puts    "SVE VL: "
 55         rdvl    x0, #8
 56         bl      putdec
 57         puts    "\n"
 58 
 59         puts    "SVE used once: "
 60         test_loop
 61 
 62         // Use SVE per syscall
 63         puts    "SVE used per syscall: "
 64         test_loop "rdvl x0, #8"
 65 
 66         //  And we're done
 67 out:
 68         mov     x0, #0
 69         mov     x8, #__NR_exit
 70         svc     #0

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php