Question regarding AArch64 and lengthes in instructions

57 views
Skip to first unread message

Novasix3

unread,
Jul 31, 2019, 6:13:32 AM7/31/19
to DynamoRIO Users
Hello,

I have a question regarding AArch64 : for some instructions (mostly the SIMD ones), there are sometime size associated with the operand.
Can DynamoRIO currently detect those ?

For instance, in the instruction : ld1r { v0.16b }, [x0]
We see that V0 (or in our case, Q0) is considered are 16 bytes, which is 128 bits. So is the "16b" part detected in some way ?
Moreover, is it detected in the case of multiple size for multiple operands ? "v0.2S v1.2S" -> can we detect both 2S.

Thanks for the answer :)

Hendrik Greving

unread,
Jul 31, 2019, 10:40:33 AM7/31/19
to dynamor...@googlegroups.com
The ARM people may comment on how the OPSZ enums are interpreted in ARM/AArch64. But generally you can query opnd_get_size() that gives you a OPSZ enum value of type opnd_size_t. The OPSZ type describes the operand's size. Hope this helps.


--
You received this message because you are subscribed to the Google Groups "DynamoRIO Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dynamorio-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dynamorio-users/0eda4888-1ec9-48ac-9179-dd087ada888e%40googlegroups.com.

Novasix3

unread,
Aug 1, 2019, 3:52:05 AM8/1/19
to DynamoRIO Users
Yes that technically gives me the right size, but how can I differenciate a "Q0.2S" from a "Q0.1D" or "Q0.4S" from "Q0.2D".
The sizes are the same, but the values I have to take into account are very different, and the AArch64 instructions don't make it easier, as for instance, FADD is the instruction to add floating scalar and vector, floats or doubles.
So there's no difference in the instruction other than the sizes of the different registers used.

Le mercredi 31 juillet 2019 16:40:33 UTC+2, Hendrik Greving a écrit :
The ARM people may comment on how the OPSZ enums are interpreted in ARM/AArch64. But generally you can query opnd_get_size() that gives you a OPSZ enum value of type opnd_size_t. The OPSZ type describes the operand's size. Hope this helps.


On Wed, Jul 31, 2019 at 3:13 AM Novasix3 <yoann...@netcourrier.com> wrote:
Hello,

I have a question regarding AArch64 : for some instructions (mostly the SIMD ones), there are sometime size associated with the operand.
Can DynamoRIO currently detect those ?

For instance, in the instruction : ld1r { v0.16b }, [x0]
We see that V0 (or in our case, Q0) is considered are 16 bytes, which is 128 bits. So is the "16b" part detected in some way ?
Moreover, is it detected in the case of multiple size for multiple operands ? "v0.2S v1.2S" -> can we detect both 2S.

Thanks for the answer :)

--
You received this message because you are subscribed to the Google Groups "DynamoRIO Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dynamor...@googlegroups.com.

Assad Hashmi

unread,
Aug 1, 2019, 6:53:58 AM8/1/19
to DynamoRIO Users
> Yes that technically gives me the right size, but how can I differenciate a "Q0.2S" from a "Q0.1D" or "Q0.4S" from "Q0.2D".
Currently we can't detect structured element sizes from the operand, just the flat element size based on:
DR_REG_Qn (128 bits)
DR_REG_Dn (64 bits)
DR_REG_Sn (32 bits)
DR_REG_Hn (16 bits)
DR_REG_Bn (8 bits)

SIMD support like this on AArch64 needs more work. 

Hendrik Greving

unread,
Aug 1, 2019, 10:11:52 AM8/1/19
to dynamor...@googlegroups.com, Assad....@arm.com
That's a question to the ARM guys on how to interpret the OPSZ or whether this info is lost. Assad, could you jump in?

To unsubscribe from this group and stop receiving emails from it, send an email to dynamorio-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dynamorio-users/040005ce-71cb-4f96-b336-a91daae24c1c%40googlegroups.com.

Hendrik Greving

unread,
Aug 1, 2019, 10:38:50 AM8/1/19
to dynamor...@googlegroups.com, Assad....@arm.com
Missed Assad's response.
@Novasix3 feel free to add support for this if you find this useful, it sounds to me like it would.

Derek Bruening

unread,
Aug 1, 2019, 11:43:55 AM8/1/19
to dynamor...@googlegroups.com, Assad Hashmi
For x86 and for ARM (32-bit), the operand also does not distinguish by itself, but the opcodes are distinct.  Perhaps the AArch64 opcodes should be split to match.

Alireza Khadem

unread,
Jun 1, 2023, 4:19:31 PM6/1/23
to DynamoRIO Users
Any updates on this? I need this feature.

Derek Bruening

unread,
Jun 1, 2023, 9:01:01 PM6/1/23
to Alireza Khadem, DynamoRIO Users
For AArch64 I thought this was implemented as opnd_get_vector_element_size()?

Alireza Khadem

unread,
Jun 2, 2023, 10:51:21 PM6/2/23
to DynamoRIO Users
I tested this. It always returns 0 (OPSZ_NA). It may be only implemented for SVE but I'm not sure.
Reply all
Reply to author
Forward
0 new messages