Digitala Vetenskapliga Arkivet

Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
GNU Compiler Collection Auto-Vectorization for RISC-V’s Vector Extension 1.0: A Comparative Study Against x86-64 AVX2
KTH, School of Electrical Engineering and Computer Science (EECS).
KTH, School of Electrical Engineering and Computer Science (EECS).
2025 (English)Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE creditsStudent thesisAlternative title
GNU Compiler Collections automatiska vektorisering för RISC-V med vektortillägg 1.0 : En jämförande studie mot x86-64 AVX2 (Swedish)
Abstract [en]

As edge computing becomes an increasingly more relevant complement to cloud computing, reduced complexity instruction set architectures such as RISC-V can perform well in edge devices’ resource-limited environments. Leveraging single instruction, multiple data (SIMD) principles is essential to speed up processing while retaining a low power increase. While RISC-V’s Vector Extension was ratified in 2021, broad compiler support is still new. To fully leverage SIMD extensions, efficient compilers are needed. One broadly recognized compiler is the GNU Compiler Collection (GCC). The purpose of this paper is to compare GCC-generated binaries from the same test suite. The Test Suite for Vectorizing Compilers 2 (TSVC2) codebase was used to target both RISC-V with the vector extension (RVV) and x86-64 with Advanced Vector Extensions 2 (AVX2) in terms of dynamic instruction count and ratio of vectorized functions. This comparison provides statistics that highlight some efficiencies and inefficiencies that exist in the current auto-vectorization implementation for RVV. This is done by running the binaries through software that collects dynamic information from the runtime of the binaries, together with a static analysis of the compiler vectorization output. The gem5 simulator is used for RISC-V and Intel Advisor is used for running the binary on x86-64. The collected statistics are then summarized and analyzed. Results show that RVV vectorized 96/151 tests, versus 77/151 for AVX2, which is a 24.7% increase. RVV also achieved a 61% decrease in dynamic instruction count compared to 48% for AVX2, driven largely by loops with conditional control flow. The one scenario where RVV underperformed compared to AVX2 was in early loop exiting conditions. These findings show that GCC’s RVV backend largely outperforms its AVX2 counterpart in the TSVC2 benchmark, except in early loop exiting conditions.

Abstract [sv]

Då edge computing blir ett alltmer relevant komplement till molnprocessering kan instruktionsarkitekturer med reducerad komplexitet som RISC-V prestera väl i edge-enheters resursbegränsade miljöer. Att utnyttja single instruction, multiple data (SIMD) principer är avgörande för att effektivisera processering utan att öka energiförbrukningen för mycket. Även om RISC-Vs vektortillägg 1.0 (RVV) ratificerades 2021 är kompilatorstöd fortfarande begränsat. För att fullt utnyttja SIMD-tillägg krävs effektiva och smarta kompilatorer. En välkänd sådan är GNU Compiler Collection (GCC). Syftet med denna studie är att jämföra GCC-genererade binärfiler av TSVC 2-kodbasen (Test Suite for Vectorising Compilers), riktad mot både RISC-V med dess vektorextension, och x86-64 med Advanced Vector Extensions 2 (AVX2) vad gäller antal dynamiska instruktioner och antal vektoriserade funktioner. Denna jämförelse ger statistik som belyser såväl effektiviteter som ineffektiviteter i den nuvarande autovektoriseringsimplementeringen för RVV. Detta görs genom att köra filerna genom mjukvara som inhämtar dynamisk information under körningen av ett program, tillsammans med en statisk analys av kompilatorns vektoriseringsinformation. Simulatorn gem5 används för RISC-V och Intel Advisor för x86-64. Den insamlade statistiken sammanfattas och analyseras sedan. Resultaten visar att RVV vektoriserade 96/151 tester, medan AVX2 vektoriserade 77/151, vilket motsvarar en ökning på 24.7% för RVV jämfört med AVX2. RVV uppnådde även en minskning på 61% vad gäller antalet dynamiska instruktioner, jämfört med 48% för AVX2, huvudsakligen drivet av loopar med villkorlig flödeskontroll. Dessa resultat visar att GCCs kompilatorstöd för RVV överlag överträffar stödet för AVX2 inom TSVC 2, med undantag för scenarion där loopar avbryts tidigt.

Place, publisher, year, edition, pages
2025. , p. 34
Series
TRITA-EECS-EX ; 2025:311
National Category
Computer and Information Sciences
Identifiers
URN: urn:nbn:se:kth:diva-367650OAI: oai:DiVA.org:kth-367650DiVA, id: diva2:1985723
Supervisors
Examiners
Available from: 2025-08-05 Created: 2025-07-27 Last updated: 2025-08-05Bibliographically approved

Open Access in DiVA

fulltext(622 kB)648 downloads
File information
File name FULLTEXT01.pdfFile size 622 kBChecksum SHA-512
168c256016a1c97bc0bd456d5dab58636e776f3e3d47bafce303e92918879507b9c2b2f38684c6f38cd3303f77a8c1812fd993036aa6f7bca83e965471935886
Type fulltextMimetype application/pdf

By organisation
School of Electrical Engineering and Computer Science (EECS)
Computer and Information Sciences

Search outside of DiVA

GoogleGoogle Scholar
Total: 652 downloads
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

urn-nbn

Altmetric score

urn-nbn
Total: 787 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf