swar-all-elms.c 3.54 KB
////A: --has-swar
//C: -daiteq-swar-enable

#include <stdint.h>

typedef unsigned int su32x1b __attribute__((subword(1)));
typedef unsigned int su15x1b __attribute__((subword(1, 15)));

typedef unsigned int su16x2b __attribute__((subword(2)));
typedef unsigned int su13x2b __attribute__((subword(2, 15)));

typedef unsigned int su10x3b __attribute__((subword(3)));
typedef unsigned int su7x3b __attribute__((subword(3, 7)));

typedef unsigned int su8x4b __attribute__((subword(4)));
typedef unsigned int su5x4b __attribute__((subword(4, 5)));

typedef unsigned int su6x5b __attribute__((subword(5)));
typedef unsigned int su5x5b __attribute__((subword(5, 5)));

typedef unsigned int su5x6b __attribute__((subword(6)));
typedef unsigned int su4x6b __attribute__((subword(6, 4)));

typedef unsigned int su4x7b __attribute__((subword(7)));
typedef unsigned int su3x7b __attribute__((subword(7, 3)));

typedef unsigned int su4x8b __attribute__((subword(8)));
typedef unsigned int su3x8b __attribute__((subword(8, 3)));

typedef unsigned int su3x9b __attribute__((subword(9)));
typedef unsigned int su2x9b __attribute__((subword(9, 2)));

typedef unsigned int su3x10b __attribute__((subword(10)));
typedef unsigned int su2x10b __attribute__((subword(10, 2)));

typedef unsigned int su2x11b __attribute__((subword(11)));
typedef unsigned int su1x11b __attribute__((subword(11, 1)));

typedef unsigned int su2x12b __attribute__((subword(12)));
typedef unsigned int su1x12b __attribute__((subword(12, 1)));

typedef unsigned int su2x13b __attribute__((subword(13)));
typedef unsigned int su1x13b __attribute__((subword(13, 1)));

typedef unsigned int su2x14b __attribute__((subword(14)));
typedef unsigned int su1x14b __attribute__((subword(14, 1)));

typedef unsigned int su2x15b __attribute__((subword(15)));
typedef unsigned int su1x15b __attribute__((subword(15, 1)));

typedef unsigned int su2x16b __attribute__((subword(16)));
typedef unsigned int su1x16b __attribute__((subword(16, 1)));

typedef unsigned int su1x17b __attribute__((subword(17)));
typedef unsigned int su1x18b __attribute__((subword(18)));
typedef unsigned int su1x19b __attribute__((subword(19)));
typedef unsigned int su1x20b __attribute__((subword(20)));
typedef unsigned int su1x21b __attribute__((subword(21)));
typedef unsigned int su1x22b __attribute__((subword(22)));
typedef unsigned int su1x23b __attribute__((subword(23)));
typedef unsigned int su1x24b __attribute__((subword(24)));
typedef unsigned int su1x25b __attribute__((subword(25)));
typedef unsigned int su1x26b __attribute__((subword(26)));
typedef unsigned int su1x27b __attribute__((subword(27)));
typedef unsigned int su1x28b __attribute__((subword(28)));
typedef unsigned int su1x29b __attribute__((subword(29)));
typedef unsigned int su1x30b __attribute__((subword(30)));
typedef unsigned int su1x31b __attribute__((subword(31)));
typedef unsigned int su1x32b __attribute__((subword(32)));

void t_1b(void)
{
  volatile su32x1b a,b,z;
  volatile su15x1b c,d,y;
  
  z = a + b;
  y = c + d;
}

void t_2b(void)
{
  volatile su16x2b a,b,z;
  volatile su13x2b c,d,y;

  z = a + b;
  y = c + d;
}

void t_3b(void)
{
  volatile su10x3b a,b,z;
  volatile su7x3b c,d,y;

  z = a + b;
  y = c + d;
}

void t_4b(void)
{
  volatile su8x4b a,b,z;
  volatile su5x4b c,d,y;

  z = a + b;
  y = c + d;
}
/*
void t_5b(void)
{
  volatile su6x5b a,b,z;
  volatile su5x5b c,d,y;

  z = a + b;
  y = c + d;
}

void t_6b(void)
{
  volatile su5x6b a,b,z;
  volatile su4x6b c,d,y;

  z = a + b;
  y = c + d;
}
*/

int main(void)
{
  t_1b();
  t_2b();
  t_3b();
  t_4b();
//  t_5b();
//  t_6b();

  return 0;
}