5.135 · exercise

Predict: vectors

For each snippet, give the exact value left in the named general register. Every snippet works on lanes, then copies one lane or a total out to a w or x register.

0 of 6 correct

Predict the result

mov w9, 5
dup v0.4s, w9
mov w10, 3
dup v1.4s, w10
mul v2.4s, v0.4s, v1.4s
addv s3, v2.4s
mov w19, v3.s[0]

Predict the result

movi v0.16b, 180
movi v1.16b, 90
add v2.16b, v0.16b, v1.16b
umov w19, v2.b[7]

Predict the result

movi v0.8b, 30
movi v1.8b, 50
uqsub v2.8b, v0.8b, v1.8b
umov w19, v2.b[3]

Predict the result

// in .data:  primes: .word 7, 11, 13, 17
ldr x9, =primes
ld1 {v0.4s}, [x9]
mov w19, v0.s[1]

Predict the result

movi v0.16b, 20
addv b1, v0.16b
umov w19, v1.b[0]

Predict the result

movi v0.16b, 1
mov x19, v0.d[0]