fixes for host gcc 4.6.1
[zpugcc/jano.git] / toolchain / gcc / newlib / libc / machine / h8500 / cmpsi.c
blob3357343f559e244f97d8d5efc2a211f026a4dd3a
2 union u
4 struct
6 short int msw;
7 unsigned short lsw;
8 } w;
9 long l;
12 union us
14 struct
16 short int msw;
17 unsigned short lsw;
18 } w;
19 long l;
22 int
23 __cmpsi2(long arga,
24 short int msw_b, unsigned short int lsw_b)
26 union u u;
27 u.l = arga;
29 if (u.w.msw != msw_b)
31 if (u.w.msw < msw_b) return 0;
32 return 2;
34 if (u.w.lsw != lsw_b)
36 if (u.w.lsw < lsw_b) return 0;
37 return 2;
39 return 1;
43 int
44 __ucmpsi2(unsigned long arga,
45 unsigned short int msw_b, unsigned short int lsw_b)
47 union us u;
48 u.l = arga;
50 if (u.w.msw != msw_b)
52 if (u.w.msw < msw_b) return 0;
53 return 2;
55 if (u.w.lsw != lsw_b)
57 if (u.w.lsw < lsw_b) return 0;
58 return 2;
60 return 1;
64 union pu
66 struct {
67 char ignore;
68 signed char msb;
69 unsigned short lsw;
70 } w;
71 long l;
74 union pun
76 struct {
77 char ignore;
78 unsigned char msb;
79 unsigned short lsw;
80 } w;
81 long l;
85 int
86 __cmppsi2(long arga, long argb)
88 union pu a;
89 union pu b;
90 a.l = arga;
91 b.l = argb;
93 if (a.w.msb != b.w.msb)
95 if (a.w.msb < b.w.msb) return 0;
96 return 2;
98 if (a.w.lsw != b.w.lsw)
100 if (a.w.lsw < b.w.lsw) return 0;
101 return 2;
103 return 1;
108 __ucmppsi2(long arga, long argb)
110 union pun a;
111 union pun b;
112 a.l = arga;
113 b.l = argb;
115 if (a.w.msb != b.w.msb)
117 if (a.w.msb < b.w.msb) return 0;
118 return 2;
120 if (a.w.lsw != b.w.lsw)
122 if (a.w.lsw < b.w.lsw) return 0;
123 return 2;
125 return 1;