From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <4cdfdc69c18eaaf525552885049926cf@proxima.alt.za> References: <4cdfdc69c18eaaf525552885049926cf@proxima.alt.za> Date: Sat, 29 Oct 2011 16:54:37 +0100 Message-ID: From: Charles Forsyth To: lucio@proxima.alt.za, Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] ARM compiler shortcoming? Topicbox-Message-UUID: 3be9bfae-ead7-11e9-9d60-3106f5b1d025 i've tried this example with a cc that has com64.c unchanged from sources (ie, without the change erik suggested), and a 5c that has no relevant changes at all, and it was fine. On 29 October 2011 16:29, Lucio De Re wrote: > My guess is that the ARM compiler does not like 64-bit values in > conditional expressions. =C2=A0The following C snippet: > > =C2=A0 =C2=A0 =C2=A0 =C2=A0typedef unsigned long long =C2=A0 =C2=A0 =C2= =A0uvlong; > > =C2=A0 =C2=A0 =C2=A0 =C2=A0uvlong uvinf =C2=A0 =C2=A0=3D ((uvlong)0x7FF00= 000<<32)|0x00000000; > =C2=A0 =C2=A0 =C2=A0 =C2=A0uvlong uvneginf =3D ((uvlong)0xFFF00000<<32)|0= x00000000; > > =C2=A0 =C2=A0 =C2=A0 =C2=A0double u2d(uvlong v); > > =C2=A0 =C2=A0 =C2=A0 =C2=A0double > =C2=A0 =C2=A0 =C2=A0 =C2=A0__Inf(int sign) > =C2=A0 =C2=A0 =C2=A0 =C2=A0{ > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return u2d(sign < = 0 ? uvneginf : uvinf); > =C2=A0 =C2=A0 =C2=A0 =C2=A0} > > compiled with 8c seems OK, but with 5c causes an error: > > =C2=A0 =C2=A0 =C2=A0 =C2=A0% 5c -FTVw /tmp/nan64.c > =C2=A0 =C2=A0 =C2=A0 =C2=A0/tmp/nan64.c:11 unknown vlong LIST > > Using an if statement seems to get rid of the problem. > > ++L > > >