swar-init.c
726 Bytes
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
////A: --has-swar
//C: -daiteq-swar-enable
//#include <stdint.h>
typedef unsigned int s4x8b __attribute__((subword(8)));
typedef signed int ss4x8b __attribute__((subword(8)));
char t[4] = {1,10,100,127};
s4x8b a = {1,10,100,127};
s4x8b c = {2,3,4,1};
s4x8b d = {100,200};
ss4x8b e = {100,-100,50,-50};
//s4x8b f = 0x12345678; /* error: not supported now */
//s4x8b h = {260}; /* error: out of range */
//s4x8b i = {-26}; /* error: out of range */
s4x8b j[3] = {{1,2,3,4},{5,6,7,8},{9,10,11,12}};
s4x8b k = {1,2,3,4,5}; /* warning: excess elements */
int main(void)
{
unsigned int b;
d = 0xffeeddcc;
//c = {11,22,33,44};
a = d;
a = a * c;
b = *((unsigned int *) &a);
return 0;
}