Hello, this is Dr. Miller, and this
is Episode twelve point five of
Assembly.
Today, we're going to talk about
ACMD or single instruction,
multiple data and loading data and
storing data ACMD.
So single instruction, multiple
data ACMD allows processors
to operate more efficiently, so
multiple pieces of data can be
loaded and it's more efficient
than reading data one
word at a time.
So some examples that you might use
it for would include images, movies
and encryption.
And for example, in eighty six
we had the Memex SC
and SC two.
And so with the popularity
of the Memex instructions,
ARM added this functionality
to theirs.
So samed loading data
so we can load data using and store
data using two different primitives,
we'll look at each one of these.
So ValdÃ©s and Vesty,
so one will load and the other one
will store data and allows
for a different interleave patterns
so we can do one, two, three,
four depending on
what our data looks like.
So here's the Velda are
extension register load.
So we've got Veldheer, we've got
the size so sixty four
and then we can either loaded a
label or load a
register. So our end,
we always have our conditional
operations that we can have
and then we can have a particular
offset or a label that we want to
use to load the data.
So here, we're going to have an
example, so we have a
bunch of arrays of different words
and you can see that these are one,
two, three, one,
two, three.
And these and then this one is
Cafe Fief and
or sorry, Cabaye fief
for each of those.
And then just going down the order
so we can see some of the
differences.
So let's look at how this runs.
So if we execute
this first instruction and we print
D zero, we can
see that the Valdese one dot
eight will load them sort of exactly
as they were defined
in here. So we get cafi Kobe
beef and cabbage fief
unloaded. When we look here at the
thirty two bit sized loading
of that, if we go to
the next one, so we're going to
use the load, the interleave for
two. And so basically it will load
every other one.
And so you can see that
it got the um
we got beef and cafe
in these. Right.
And so we got SEIA and
then we skipped two and then Effy
and then B and then skipped
two and then F
and then the second one.
Um.
Well, yeah, that's how we loaded the
data in the second to here
we're loading every other so you get
two, four, six, eight,
and then the third one only get one,
three, five and seven.
Right. So those get loaded.
Every other one gets loaded.
And then when we do the third one,
so Valdese three, so we're loading
every third one, we'll say
here I alternated one to
three, one, two, three.
And so when you load every
third one into the different
registers using this instruction
here, we can see that we get
an entire set of
ones, an entire set of twos,
an entire set of threes.
And your typical example for this
one would be so, for example, if
you're loading pixels, we have
three different colors, red, green
and blue. And so those
might be in the data.
Red, green, blue, red, green, blue,
red, green, blue.
And so when you go to load them and
we'll go ahead and load all of the
red pixels in one area, the green
and another and the blue in another.
And so that way, if you wanted to
maybe just increase the red in
the picture where you could just
increase those red pixels by loading
it in and then doing one
operation on all of that data at
once.
So storing data.
So we got the VCR
so we can store
a particular register and then at
the location pointed to by Aaryn,
right. So this is the register
that we want to save and then this
is the register holding the base
that we want to transfer to.
And then you could additionally add
an offset that you could
specify inside of their.
So here's an example, so we go ahead
and load the values A, B,
C, D
for ABCDE,
we load that into our zero and
then we use the Vidhu command
to basically copy that from here
into Q zero six
zero is going to have
A, B, C, D
all throughout.
And so then you
know, part of Q zero is D zero.
And so I can say V store sixty
four, D zero
and then R one.
And so that'll store
sixty for.
Bits worth in each right,
so we can get to thirty two
bits that we saw in their
hair, I just went ahead and printed
it off. So our one, when we're done
with here, when I print the value of
our one, I get A, B,
C, D and
R one plus four.
So that's going for bitin because
this took up four bytes.
We got A, B, C, D,
and then beyond that, there's zeros.
So I printed plus eight and there's
nothing stored beyond that.
So I'll leave it up to you.
You could type this program in and
see if you could save all of Q zero
using to V store commands.
That would be an interesting
example for you to try.
And then we got Vestey when
and where and is a
number that we can use in order to
store it.
And so again, we can do
interleaving using the
and inside of there and so we can
save data. We have a condition
that's added.
We have our data type.
And so the different data types
would say there's a whole listing of
them. I didn't include them all in
the slide, different
alignments. And so we'll just look
at an example here of storing a
single PN element structure to
one-Line.
So here again, I got a
a three D or A one, B
one, C one, so
I loaded all of those into these
registers, R one through our four.
And then I did a V move of
four zero as one as two
and three. Right. So these all make
up
Q zero or D zero.
D one.
And so I can store every other so
two and we're going to do every
other byte.
And so it's actually pretty easy to
see what happens here.
So if I
look at Q Zero before
we go ahead and store the data,
we've got DCB
A DC
sorry, D four, C
three, B to A one,
and then D eighty seven, D sixty
five.
So when we look in the output we can
see that it basically takes every
other one.
So we've got D D as a first one and
then D eight and then C, C
and then C seven and then
B and then B six.
Right. So it's kept copying here,
here, here, here, here, here.
Going down the line.
Right D for D for three
three three three.
So again the the two
means every other so copies every
other one. So it's Uninor
leaving or reinterred, leaving the
data from what it's stored
in and D zero and D one.
So if you use the interleaved to
load it then you can use the
interleave to save it.
Back in the example.
So today, we talked about the ACMD
loading of data and then the storing
of data.
It's looking forward, we're going to
use ACMD to process data
and then we'll do some ID
samed example,
we'll also talk about thumbhole and
conditional execution.
So how do you load data into
a D sized register with no
interleave?
So we got ValdÃ©s, one means
no, interleave, we're going to do
each bite and then our
zero points to our memory and one is
to register that we want to do so.
You could pick any register from
zero to D thirty one.
If you have questions, you can email
me, Miller, MJ at you and
Kidada KSTU, and you can find me on
Twitter at Milhouse 30.