summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/arm64/fp/sve-test.S
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2021-07-05 09:05:31 +0300
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2021-07-05 09:05:31 +0300
commit818b26588994d9d95743fca0a427f08ec6c1c41d (patch)
tree870d9abed0e43b82257350a93e6517816815cd6c /tools/testing/selftests/arm64/fp/sve-test.S
parent45a4b68354ffccbc9ca71027bd34754ca24f5183 (diff)
parentf8f84af5da9ee04ef1d271528656dac42a090d00 (diff)
downloadlinux-818b26588994d9d95743fca0a427f08ec6c1c41d.tar.xz
Merge branch 'next' into for-linus
Prepare input updates for 5.14 merge window.
Diffstat (limited to 'tools/testing/selftests/arm64/fp/sve-test.S')
-rw-r--r--tools/testing/selftests/arm64/fp/sve-test.S22
1 files changed, 17 insertions, 5 deletions
diff --git a/tools/testing/selftests/arm64/fp/sve-test.S b/tools/testing/selftests/arm64/fp/sve-test.S
index 9210691aa998..e3e08d9c7020 100644
--- a/tools/testing/selftests/arm64/fp/sve-test.S
+++ b/tools/testing/selftests/arm64/fp/sve-test.S
@@ -284,16 +284,28 @@ endfunction
// Set up test pattern in the FFR
// x0: pid
// x2: generation
+//
+// We need to generate a canonical FFR value, which consists of a number of
+// low "1" bits, followed by a number of zeros. This gives us 17 unique values
+// per 16 bits of FFR, so we create a 4 bit signature out of the PID and
+// generation, and use that as the initial number of ones in the pattern.
+// We fill the upper lanes of FFR with zeros.
// Beware: corrupts P0.
function setup_ffr
mov x4, x30
- bl pattern
+ and w0, w0, #0x3
+ bfi w0, w2, #2, #2
+ mov w1, #1
+ lsl w1, w1, w0
+ sub w1, w1, #1
+
ldr x0, =ffrref
- ldr x1, =scratch
- rdvl x2, #1
- lsr x2, x2, #3
- bl memcpy
+ strh w1, [x0], 2
+ rdvl x1, #1
+ lsr x1, x1, #3
+ sub x1, x1, #2
+ bl memclr
mov x0, #0
ldr x1, =ffrref