From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Fri, 27 Dec 2013 15:32:46 +1100 Message-ID: From: Bruce Ellis To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=047d7beba078004f0b04ee7c96f6 Subject: Re: [9fans] MIPS LE fp register ordering in MOVD Topicbox-Message-UUID: a92267d2-ead8-11e9-9d60-3106f5b1d025 --047d7beba078004f0b04ee7c96f6 Content-Type: text/plain; charset=UTF-8 You might be able to blame the play station 2 and the two different MIPS chips it had. I did two compilers. The FP was very unusual and one was LE and the other BE. Inferno port worked well. brucee On 27 December 2013 14:41, cherry wrote: > > > > On Thu, Dec 26, 2013 at 6:46 PM, cherry wrote: > >> Another issue is 0l/vl seems to output wrong bits for single precision >> floats in little endian mode, due to a similar reason: it used bytes 4-7 >> instead of 0-3. This seems to fix it: >> >> % diff /sys/src/cmd/vl/asm.c asm.c >> 672c672,675 >> < buf.dbuf[l] = cast[fnuxi8[i+4]]; >> --- >> > if(little) >> > buf.dbuf[l] = cast[fnuxi8[i]]; >> > else >> > buf.dbuf[l] = cast[fnuxi8[i+4]]; >> >> An alternative fix would be simply use fnuxi4 instead of fnuxi8, so that >> both BE and LE would work (I guess, don't have BE machine to test). >> > > Indeed I can test it, simply diff the output of vl before and after. > Using, fnuxi4 does NOT work for BE, as fnuxi4 is only set for LE > (obj.c:1385,1404), probably due to (the same or another) historical reason. > > - cherry > > --047d7beba078004f0b04ee7c96f6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
You might be able to blame the play station 2 and the two = different MIPS chips it had. I did two compilers. The FP was very unusual a= nd one was LE and the other BE. Inferno port worked well.

brucee


On 27 December 2013 14:41, cherry <lunaria21@gmail.com> wrote:



On Thu, Dec 26, 20= 13 at 6:46 PM, cherry <lunaria21@gmail.com> wrote:
Another issue is 0l/vl seem= s to output wrong bits for single precision floats in little endian mode, d= ue to a similar reason: it used bytes 4-7 instead of 0-3. This seems to fix= it:

% diff /sys/src/cmd/vl/asm.c asm.c
672c672,675
< =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 buf.dbuf[l] =3D cast[fnuxi8[i+4]]= ;
---
> =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 if(little)
> =C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 buf.dbuf[l] =3D cast[fnuxi8[i]];
> =C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 else
> =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 buf.dbuf= [l] =3D cast[fnuxi8[i+4]];

An alternative fix would be simply use fnuxi4 instead of fnuxi8, so tha= t both BE and LE would work (I guess, don't have BE machine to test).

Indeed I can test it, simply diff the outpu= t of vl before and after. Using, fnuxi4 does NOT work for BE, as fnuxi4 is = only set for LE (obj.c:1385,1404), probably due to (the same or another) hi= storical reason.

- cherry


--047d7beba078004f0b04ee7c96f6--