Skip to content
  • Projects
  • Groups
  • Snippets
  • Help

Martin / daiteq-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
  • daiteq-demo
  • simple
  • tests
  • swar
  • swar-pragma.c
  • Martin's avatar
    daiteq LLVM demos, Release 4 · 3428f119
    Martin committed Oct 11, 2021
    3428f119 Browse File
swar-pragma.c 331 Bytes
BlameHistoryPermalink
Edit
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
//A: --has-swar
//C: -daiteq-swar-enable

int main(void)
{
  unsigned int a;

  {
    __builtin_swarctrl(1);

    #pragma swar saturate
    __builtin_swarctrl(8);
    #pragma swar reduce
    __builtin_swarctrl(4);

    {
      #pragma swar normalize
      __builtin_swarctrl(16);
    }
  }

  __builtin_swarctrl(0);

  return 0;
}