Re: [PATCH 02/11] Initial TI PRU libgcc port

2018-06-22 Thread Dimitar Dimitrov
On петък, 22 юни 2018 г. 10:55:29 EEST Jeff Law wrote:
> On 06/13/2018 12:57 PM, Dimitar Dimitrov wrote:
> > The floating point support has been borrowed from C6X libgcc port
> > to help with TI PRU toolchain ABI compatibility.
> > 
> > libgcc/ChangeLog:
> > 
> > 2018-06-13  Dimitar Dimitrov  
> > 
> > * config.host: Add PRU target.
> > * config/pru/asri.c: New file.
> > * config/pru/eqd.c: New file.
> > * config/pru/eqf.c: New file.
> > * config/pru/ged.c: New file.
> > * config/pru/gef.c: New file.
> > * config/pru/gtd.c: New file.
> > * config/pru/gtf.c: New file.
> > * config/pru/led.c: New file.
> > * config/pru/lef.c: New file.
> > * config/pru/lib2bitcountHI.c: New file.
> > * config/pru/lib2divHI.c: New file.
> > * config/pru/lib2divQI.c: New file.
> > * config/pru/lib2divSI.c: New file.
> > * config/pru/libgcc-eabi.ver: New file.
> > * config/pru/ltd.c: New file.
> > * config/pru/ltf.c: New file.
> > * config/pru/mpyll.S: New file.
> > * config/pru/pru-abi.h: New file.
> > * config/pru/pru-asm.h: New file.
> > * config/pru/pru-divmod.h: New file.
> > * config/pru/sfp-machine.h: New file.
> > * config/pru/t-pru: New file.
> 
> I don't see anything particularly concerning here.  It looks like the
> floating point stuff is a direct copy from the c6x port.  I'm going to
> assume the assembly code you've written in the various files is correct.
>  I'm also assuming we're trying to be compatible with another toolchain
> or published ABI, hence the exposure of the new symbols for low level
> operations.
> 
> So I'll this too.  Obviously it needs to wait for the main port patch to
> be reviewed as well.
That is correct, my main goal has been to be ABI compatible with the 
proprietary TI PRU toolchain. Luckily, TI folks reused c6x floating point ABI 
for PRU.

Regards,
Dimitar


Re: [PATCH 02/11] Initial TI PRU libgcc port

2018-06-22 Thread Jeff Law
On 06/13/2018 12:57 PM, Dimitar Dimitrov wrote:
> The floating point support has been borrowed from C6X libgcc port
> to help with TI PRU toolchain ABI compatibility.
> 
> libgcc/ChangeLog:
> 
> 2018-06-13  Dimitar Dimitrov  
> 
>   * config.host: Add PRU target.
>   * config/pru/asri.c: New file.
>   * config/pru/eqd.c: New file.
>   * config/pru/eqf.c: New file.
>   * config/pru/ged.c: New file.
>   * config/pru/gef.c: New file.
>   * config/pru/gtd.c: New file.
>   * config/pru/gtf.c: New file.
>   * config/pru/led.c: New file.
>   * config/pru/lef.c: New file.
>   * config/pru/lib2bitcountHI.c: New file.
>   * config/pru/lib2divHI.c: New file.
>   * config/pru/lib2divQI.c: New file.
>   * config/pru/lib2divSI.c: New file.
>   * config/pru/libgcc-eabi.ver: New file.
>   * config/pru/ltd.c: New file.
>   * config/pru/ltf.c: New file.
>   * config/pru/mpyll.S: New file.
>   * config/pru/pru-abi.h: New file.
>   * config/pru/pru-asm.h: New file.
>   * config/pru/pru-divmod.h: New file.
>   * config/pru/sfp-machine.h: New file.
>   * config/pru/t-pru: New file.
I don't see anything particularly concerning here.  It looks like the
floating point stuff is a direct copy from the c6x port.  I'm going to
assume the assembly code you've written in the various files is correct.
 I'm also assuming we're trying to be compatible with another toolchain
or published ABI, hence the exposure of the new symbols for low level
operations.

So I'll this too.  Obviously it needs to wait for the main port patch to
be reviewed as well.

jeff


[PATCH 02/11] Initial TI PRU libgcc port

2018-06-13 Thread Dimitar Dimitrov
The floating point support has been borrowed from C6X libgcc port
to help with TI PRU toolchain ABI compatibility.

libgcc/ChangeLog:

2018-06-13  Dimitar Dimitrov  

* config.host: Add PRU target.
* config/pru/asri.c: New file.
* config/pru/eqd.c: New file.
* config/pru/eqf.c: New file.
* config/pru/ged.c: New file.
* config/pru/gef.c: New file.
* config/pru/gtd.c: New file.
* config/pru/gtf.c: New file.
* config/pru/led.c: New file.
* config/pru/lef.c: New file.
* config/pru/lib2bitcountHI.c: New file.
* config/pru/lib2divHI.c: New file.
* config/pru/lib2divQI.c: New file.
* config/pru/lib2divSI.c: New file.
* config/pru/libgcc-eabi.ver: New file.
* config/pru/ltd.c: New file.
* config/pru/ltf.c: New file.
* config/pru/mpyll.S: New file.
* config/pru/pru-abi.h: New file.
* config/pru/pru-asm.h: New file.
* config/pru/pru-divmod.h: New file.
* config/pru/sfp-machine.h: New file.
* config/pru/t-pru: New file.

Signed-off-by: Dimitar Dimitrov 
---
 libgcc/config.host |   7 +++
 libgcc/config/pru/asri.c   |  33 ++
 libgcc/config/pru/eqd.c|  45 +
 libgcc/config/pru/eqf.c|  45 +
 libgcc/config/pru/ged.c|  45 +
 libgcc/config/pru/gef.c|  45 +
 libgcc/config/pru/gtd.c|  45 +
 libgcc/config/pru/gtf.c|  45 +
 libgcc/config/pru/led.c|  45 +
 libgcc/config/pru/lef.c|  45 +
 libgcc/config/pru/lib2bitcountHI.c |  43 +
 libgcc/config/pru/lib2divHI.c  |  42 +
 libgcc/config/pru/lib2divQI.c  |  42 +
 libgcc/config/pru/lib2divSI.c  |  48 ++
 libgcc/config/pru/libgcc-eabi.ver  |  88 ++
 libgcc/config/pru/ltd.c|  45 +
 libgcc/config/pru/ltf.c|  45 +
 libgcc/config/pru/mpyll.S  |  57 +
 libgcc/config/pru/pru-abi.h| 109 
 libgcc/config/pru/pru-asm.h|  35 +++
 libgcc/config/pru/pru-divmod.h | 117 ++
 libgcc/config/pru/sfp-machine.h| 125 +
 libgcc/config/pru/t-pru|  50 +++
 23 files changed, 1246 insertions(+)
 create mode 100644 libgcc/config/pru/asri.c
 create mode 100644 libgcc/config/pru/eqd.c
 create mode 100644 libgcc/config/pru/eqf.c
 create mode 100644 libgcc/config/pru/ged.c
 create mode 100644 libgcc/config/pru/gef.c
 create mode 100644 libgcc/config/pru/gtd.c
 create mode 100644 libgcc/config/pru/gtf.c
 create mode 100644 libgcc/config/pru/led.c
 create mode 100644 libgcc/config/pru/lef.c
 create mode 100644 libgcc/config/pru/lib2bitcountHI.c
 create mode 100644 libgcc/config/pru/lib2divHI.c
 create mode 100644 libgcc/config/pru/lib2divQI.c
 create mode 100644 libgcc/config/pru/lib2divSI.c
 create mode 100644 libgcc/config/pru/libgcc-eabi.ver
 create mode 100644 libgcc/config/pru/ltd.c
 create mode 100644 libgcc/config/pru/ltf.c
 create mode 100644 libgcc/config/pru/mpyll.S
 create mode 100644 libgcc/config/pru/pru-abi.h
 create mode 100644 libgcc/config/pru/pru-asm.h
 create mode 100644 libgcc/config/pru/pru-divmod.h
 create mode 100644 libgcc/config/pru/sfp-machine.h
 create mode 100644 libgcc/config/pru/t-pru

diff --git a/libgcc/config.host b/libgcc/config.host
index 18cabaf24f6..ff229c38f0c 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -165,6 +165,9 @@ nios2*-*-*)
 powerpc*-*-*)
cpu_type=rs6000
;;
+pru-*-*)
+   cpu_type=pru
+   ;;
 rs6000*-*-*)
;;
 riscv*-*-*)
@@ -1145,6 +1148,10 @@ powerpcle-*-eabi*)
tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-crtstuff 
t-crtstuff-pic t-fdpbit"
extra_parts="$extra_parts crtbegin.o crtend.o crtbeginS.o crtendS.o 
crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
;;
+pru-*-*)
+   tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl t-softfp 
t-gnu-prefix pru/t-pru"
+   tm_file="$tm_file pru/pru-abi.h"
+   ;;
 riscv*-*-linux*)
tmake_file="${tmake_file} riscv/t-softfp${host_address} t-softfp 
riscv/t-elf riscv/t-elf${host_address}"
extra_parts="$extra_parts crtbegin.o crtend.o crti.o crtn.o crtendS.o 
crtbeginT.o"
diff --git a/libgcc/config/pru/asri.c b/libgcc/config/pru/asri.c
new file mode 100644
index 000..591d660f227
--- /dev/null
+++ b/libgcc/config/pru/asri.c
@@ -0,0 +1,33 @@
+/* PRU ABI compatibility functions
+   Arithmetic right shift
+   Copyright (C) 2017-2018 Free Software Foundation, Inc.
+   Contributed by Dimitar Dimitrov 
+
+   This file is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+