DEV Community

Gustavo Tavares
Gustavo Tavares

Posted on

SPO600 Lab06 - sve2

Hi there,

This lab build up on top of the past lab, this time we need to make a new volume function that will use SVE2 syntax.

Even though it looks simple, it is really hard to understand inline assembler and intrinsic code.

For this lab, I decided to change one of the previous functions to use sve2.

My Approach

The one function I decided to change was vol4(remembering that vol4.c was made by the professor, not by me):

First things I had to change was adding the sve header file:
header

After that, instead of using the v registers, I used z as instructed in the sve2 instructions:
registers

(Image from: https://developer.arm.com/documentation/102340/0001/SVE2-architecture-fundamentals?lang=en)

code

The change was not huge, but without the sve2 instructions on the Makefile it could not compile:

Makefile

And to run it we need to to use qemu-aarch64:

qemu

Without it we have a illegal instruction error:
Core dumped:
coredump

On object dump, we can see that sqrdmulh is using the z registers.
Objdump -d
objdump

Thank you for your reading!

Top comments (0)