Today’s blog will be separated into two parts. In part A, I will compare my previous sound sample program with a similar program that was provided by our professor. I will then, test the performance and compare it with my solution. You may check the previous blog about benchmarking and testing digital sound sample program to get the basic understanding of the code. After, in part B, I discuss about an open source software called Traverso DAW primarily about it’s assembly-code. Here is the source code provided to us.
I have modified the amount of samples of both of the programs to 5 million. When initiating the time command, it appears that the version 3 using the bit shift algorithm seems to perform faster.
// Q: what is an alternate approach?
A1: The alternate approach here is to remove the assigned registers asm(“r20”) and let the compiler decide which register to assign. There are no errors doing this way.
// Q: should we use 32767 or 32768 in next line? why?
A2: The value should be 32767 because, it is the max value of this data-type that can hold for int16_t short.
// Q: what does it mean to “duplicate” values in the // next line?
A3: My assumption here is that we are duplicating the value of w0 into v1.8h. when I ran the command objdump -d to view the duplication what I see there is register w22 value that is being inserted into v1.8h.
// Q: what happens if we remove the following
// two lines? Why?
A4: What happened is, we get a compiler error. This is because the compiler can’t find in the _asm_ (inline assembler) the operands %in and %out.
// Q: are the results usable? are they correct?
A5: The results are usable and seems to be correct because it is within the range of generating data sample.
For this part I have to choose an open source package and find it’s assembly-language code. Traverso DAW is a cross-platform multi track audio recording and audio editing suite with support for CD mastering and non-linear processing. It is free software, licensed under GNU General Public License. The Source code can be downloaded from GitHub. There are two assembly files that I was able to find with the file extension of .S.
Traverso is a cross-platform software (Windows, Linux, macOS) so it’s fairly compatible with the most CPU architectures just to list a few from the list of compatible platforms: