[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pcc-list
Subject:    Re: [Pcc] Using softfloat in the compiler.
From:       Anders Magnusson <ragge () ludd ! ltu ! se>
Date:       2018-12-02 20:29:46
Message-ID: f3ce0fcb-5466-3307-7a4c-8ae3f6205e85 () ludd ! ltu ! se
[Download RAW message or body]

Thanks, I had missed to fix mips64, now done.  Based on the sizes in 
macdefs.h I assume that it uses double precision IEEE floating point for 
long double.

I have no idea though whether pcc works on this target.   Never tried 
any mips.

-- Ragge

Den 2018-12-02 kl. 21:08, skrev Janne Johansson:
> The mips64 had some float/softfloat issues I ran into recently, I
> managed to whip up this which I know isn't 100%, but at least made
> 1) the compiler to build natively on obsd-mips64 and
> 2) be able to at least make some hello world program run
>
> I sent it via bcallah@open who submitted the mips64 parts, but I guess
> he didn't have time to dig in deeper.
>
> quote:
> --------------
>
> This small diff allows it to compile, but I _zero_ clue if it is in any
> way near correct or enough even. The X80 thing sounds like that crappy
> x86 float stuff, but if I remove it, it will lack certain symbols*.
>
> The resulting binary can build hello world at least, but failed on some
> amalgamated bzip2.h+.c I tried.
>
> Index: arch/mips64/macdefs.h
> ===================================================================
> RCS file: /cvsroot/pcc/arch/mips64/macdefs.h,v
> retrieving revision 1.1
> diff -u -p -u -r1.1 macdefs.h
> --- arch/mips64/macdefs.h       6 Jul 2016 07:49:48 -0000       1.1
> +++ arch/mips64/macdefs.h       3 Nov 2018 21:10:44 -0000
> @@ -347,3 +347,10 @@ P1ND *mips64_builtin_va_arg(const struct
>   P1ND *mips64_builtin_va_end(const struct bitable *, P1ND *a);
>   P1ND *mips64_builtin_va_copy(const struct bitable *, P1ND *a);
>   #undef P1ND
> +/* floating point definitions */
> +#define        USE_IEEEFP_32
> +#define        FLT_PREFIX      IEEEFP_32
> +#define        USE_IEEEFP_64
> +#define        DBL_PREFIX      IEEEFP_64
> +#define USE_IEEEFP_X80
> +#define        LDBL_PREFIX     IEEEFP_X80
> Index: cc/ccom/pass1.h
> ===================================================================
> RCS file: /cvsroot/pcc/cc/ccom/pass1.h,v
> retrieving revision 1.307
> diff -u -p -u -r1.307 pass1.h
> --- cc/ccom/pass1.h     27 Oct 2018 12:49:09 -0000      1.307
> +++ cc/ccom/pass1.h     3 Nov 2018 21:10:45 -0000
> @@ -455,6 +455,7 @@ struct flt {
>   };
>   typedef struct flt FLT;
>   #define        fltallo()               stmtalloc(sizeof(FLT))
> +#define FCAST(x)        ((FLT *)x)
>
>   /*
>    * Only allowed to do float evaluation if either doing
>
>
>
> ==================
> *) pcc -O2 -pipe    -o bzip2 bzip2.c
> bzip2.c, line 1337: compiler error: offchg: unknown type
> error: /home/pcc/pcc-build/libexec/ccom terminated with status 1
>
>
> Den sön 2 dec. 2018 kl 12:17 skrev Anders Magnusson <ragge@ludd.ltu.se>:
>> Hi all,
>>
>> I have (at last!) converted the compiler to use softfloat.  This enables
>> use of the compiler as a cross-compiler.
>> Currently only the IEEE platforms are known to work.
>>
>> To have a simple debugging of the softfloat code, it is checked against
>> the hardware if host and target are the same machine.
>>
>> Have fun,
>>
>> -- Ragge
>> _______________________________________________
>> Pcc mailing list
>> Pcc@lists.ludd.ltu.se
>> https://lists.ludd.ltu.se/cgi-bin/mailman/listinfo/pcc
>
>

_______________________________________________
Pcc mailing list
Pcc@lists.ludd.ltu.se
https://lists.ludd.ltu.se/cgi-bin/mailman/listinfo/pcc
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic