Skip to content
  • Projects
  • Groups
  • Snippets
  • Help

release / riscv-demo

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • riscv-demo
  • simple
  • tests
  • swar
  • low_array_add_su10x3b.c
  • Martin's avatar
    Release 2022.1 · a22edae1
    Martin committed Sep 07, 2022
    a22edae1 Browse Files
low_array_add_su10x3b.c 382 Bytes
BlameHistoryPermalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
////A: --has-swar
//C: -daiteq-swar-enable

#include <stdint.h>

#define ARRAYSIZE    20
typedef unsigned int su10x3b __attribute__((subword(3)));

int main(void)
{
  volatile su10x3b a[ARRAYSIZE], b[ARRAYSIZE], z[ARRAYSIZE];
  
  for (register int i=0;i<ARRAYSIZE;++i)
    z[i] = a[i] + b[i];

  for (register int i=0;i<ARRAYSIZE;++i) {
    z[i] = a[i] + b[i];
  }

  return 0;
}