This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH v5 01/10] Initial TI PRU GCC port
On Wednesday, 10/17/2018 22:26:58 EEST Richard Sandiford wrote:
> > +; Note: "JUMP_INSNs and CALL_INSNs are not allowed to have any output
> > +; reloads;". Hence this insn must be prepared for a counter that is
> > +; not a register.
> > +(define_insn "doloop_end_internal<mode>"
> > + [(set (pc)
> > + (if_then_else (ne (match_operand:HISI 0 "nonimmediate_operand" "+r,*m")
> > + (const_int 1))
> > + (label_ref (match_operand 1 "" ""))
> > + (pc)))
> > + (set (match_dup 0)
> > + (plus:HISI (match_dup 0)
> > + (const_int -1)))
> > + (unspec [(match_operand 2 "const_int_operand" "")] UNSPECV_LOOP_END)
> > + (clobber (match_scratch:HISI 3 "=X,&r"))]
> > + ""
> > +{
> > + gcc_unreachable ();
> > +}
> > + ;; Worst case length:
> > + ;;
> > + ;; lbbo op3_reg, op3_ptr 4'
> > + ;; sub <op3_reg>, 1 4
> > + ;; qbeq .+8, <op3_reg>, 0 4
> > + ;; jmp <op1> 4
> > + ;; sbbo op3_reg, op3_ptr 4
> > + [(set (attr "length")
> > + (if_then_else
> > + (and (ge (minus (pc) (match_dup 1)) (const_int 0))
> > + (le (minus (pc) (match_dup 1)) (const_int 1020)))
> > + (cond [(eq_attr "alternative" "0") (const_int 4)
> > + (eq_attr "alternative" "0") (const_int 12)]
> > + (const_int 4))
> > + (cond [(eq_attr "alternative" "0") (const_int 12)
> > + (eq_attr "alternative" "0") (const_int 20)]
> > + (const_int 4))))])
>
> The second (eq_attr "alternative" "0") lines in each (cond ...)
> won't be used, since the first match wins.
Sorry about this. My intention was to have different weights for the two
different constraints. I have fixed it the attached patch.
> OK with those changes once the port is accepted. (No need to repost,
> just fix up locally and commit the fixed version when the time comes.)
See attached fixup patch. I'll need someone to apply it on my behalf, since I
do not have write access.
>
> Jeff, could you ask the SC about accepting the port, if that hasn't
> already been decided? Dimitar, I assume you'd be OK with being the
> maintainer?
Yes, I'll be glad to support the PRU port.
In case the port is accepted, I have attached patches for maintainer listing
and wwwdocs updates.
Thanks,
Dimitar
>From 4e07a710618e0dbbd5f97c83ebe3924a28d2ca20 Mon Sep 17 00:00:00 2001
From: Dimitar Dimitrov <dimitar@dinux.eu>
Date: Mon, 27 Aug 2018 16:40:28 +0300
Subject: [PATCH] Add myself as maintainer of PRU port
ChangeLog:
2018-10-18 Dimitar Dimitrov <dimitar@dinux.eu>
* MAINTAINERS: Add self as PRU maintainer.
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
---
MAINTAINERS | 1 +
1 file changed, 1 insertion(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 0d6c81d4af6..1d82083512d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -92,6 +92,7 @@ nios2 port Sandra Loosemore <sandra@codesourcery.com>
nvptx port Tom de Vries <tdevries@suse.de>
pdp11 port Paul Koning <ni1d@arrl.net>
powerpcspe port Andrew Jenner <andrew@codesourcery.com>
+pru port Dimitar Dimitrov <dimitar@dinux.eu>
riscv port Kito Cheng <kito.cheng@gmail.com>
riscv port Palmer Dabbelt <palmer@sifive.com>
riscv port Andrew Waterman <andrew@sifive.com>
--
2.11.0
>From a05619f2ebae9afe890fd336437cf9b67ef825ac Mon Sep 17 00:00:00 2001
From: Dimitar Dimitrov <dimitar@dinux.eu>
Date: Thu, 18 Oct 2018 07:11:23 +0300
Subject: [PATCH] Fixups for v5 initial PRU backend patch
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
---
gcc/config/pru/predicates.md | 3 ---
gcc/config/pru/pru.md | 10 ++++------
gcc/config/pru/pru.opt | 2 +-
gcc/doc/invoke.texi | 8 ++++----
4 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/gcc/config/pru/predicates.md b/gcc/config/pru/predicates.md
index 0e34d9c1a31..3e0a776ca54 100644
--- a/gcc/config/pru/predicates.md
+++ b/gcc/config/pru/predicates.md
@@ -75,7 +75,6 @@
else
return 0;
-
return REGNO_REG_CLASS (regno) == MULDST_REGS
|| regno >= FIRST_PSEUDO_REGISTER;
}
@@ -96,7 +95,6 @@
else
return 0;
-
return REGNO_REG_CLASS (regno) == MULSRC0_REG
|| regno >= FIRST_PSEUDO_REGISTER;
}
@@ -117,7 +115,6 @@
else
return 0;
-
return REGNO_REG_CLASS (regno) == MULSRC1_REG
|| regno >= FIRST_PSEUDO_REGISTER;
}
diff --git a/gcc/config/pru/pru.md b/gcc/config/pru/pru.md
index 248ae2c953d..1fa5f9310b0 100644
--- a/gcc/config/pru/pru.md
+++ b/gcc/config/pru/pru.md
@@ -933,12 +933,10 @@
(if_then_else
(and (ge (minus (pc) (match_dup 1)) (const_int 0))
(le (minus (pc) (match_dup 1)) (const_int 1020)))
- (cond [(eq_attr "alternative" "0") (const_int 4)
- (eq_attr "alternative" "0") (const_int 12)]
- (const_int 4))
- (cond [(eq_attr "alternative" "0") (const_int 12)
- (eq_attr "alternative" "0") (const_int 20)]
- (const_int 4))))])
+ (cond [(eq_attr "alternative" "0") (const_int 4)]
+ (const_int 12))
+ (cond [(eq_attr "alternative" "0") (const_int 12)]
+ (const_int 20))))])
(define_expand "doloop_end"
[(use (match_operand 0 "nonimmediate_operand"))
diff --git a/gcc/config/pru/pru.opt b/gcc/config/pru/pru.opt
index fb9b0fcbf5c..b112ac56fa2 100644
--- a/gcc/config/pru/pru.opt
+++ b/gcc/config/pru/pru.opt
@@ -32,7 +32,7 @@ Target RejectNegative Joined
mno-relax
Target Report RejectNegative
-Make GCC pass --no-relax command-line option to the linker instead of
+Make GCC pass the --no-relax command-line option to the linker instead of
the --relax option.
mloop
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 3f286aabc0c..1068cf71ee0 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -23626,9 +23626,9 @@ These command-line options are defined for PRU target:
@opindex minrt
Link with a minimum runtime environment, with no support for static
initializers and constructors. Using this option can significantly reduce
-the size of the final ELF binary. Beware that compiler could still generate
-code with static initializers and constructors. It is up to the programmer
-to ensure that the source program will not use those features.
+the size of the final ELF binary. Beware that the compiler could still
+generate code with static initializers and constructors. It is up to the
+programmer to ensure that the source program will not use those features.
@item -mmcu=@var{mcu}
@opindex mmcu
@@ -23637,7 +23637,7 @@ supported MCUs.
@item -mno-relax
@opindex mno-relax
-Make GCC pass @option{--no-relax} command-line option to the linker
+Make GCC pass the @option{--no-relax} command-line option to the linker
instead of the @option{--relax} option.
@item -mloop
--
2.11.0
Index: htdocs/backends.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/backends.html,v
retrieving revision 1.81
diff -u -r1.81 backends.html
--- htdocs/backends.html 30 Sep 2018 14:38:45 -0000 1.81
+++ htdocs/backends.html 19 Oct 2018 04:35:21 -0000
@@ -102,6 +102,7 @@
nvptx | S Q C q mg e
pa | ? Q CBD qr b i e
pdp11 | L IC qr b e
+pru | L F a s
riscv | Q C qr gia
rl78 | L F l g s
rs6000 | Q C qr pb ia
Index: htdocs/index.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/index.html,v
retrieving revision 1.1103
diff -u -r1.1103 index.html
--- htdocs/index.html 17 Oct 2018 08:23:10 -0000 1.1103
+++ htdocs/index.html 19 Oct 2018 04:35:21 -0000
@@ -54,6 +54,10 @@
<h2 id="news">News</h2>
<dl>
+<dt><span>PRU support</span>
+ <span class="date">[2018-10-20]</span></dt>
+ <dd>GCC support for TI PRU I/O processors has been added.</dd>
+
<dt><span>C-SKY support</span>
<span class="date">[2018-08-17]</span></dt>
<dd>GCC support for C-SKY V2 processors has been added. This back
Index: htdocs/readings.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/readings.html,v
retrieving revision 1.305
diff -u -r1.305 readings.html
--- htdocs/readings.html 6 Oct 2018 17:36:29 -0000 1.305
+++ htdocs/readings.html 19 Oct 2018 04:35:21 -0000
@@ -247,6 +247,12 @@
<br /><a href="http://simh.trailing-edge.com/">Simulators</a>
</li>
+ <li>pru
+ <br />Manufacturer: Texas Instruments
+ <br /><a href="http://processors.wiki.ti.com/index.php/PRU-ICSS">Official PRU Documentation</a>
+ <br /><a href="https://elinux.org/Category:PRU">Community PRU Documentation</a>
+ </li>
+
<li>riscv
<br />Manufacturer: Many (open ISA standard)
<br /><a href="https://riscv.org">RISC-V Foundation</a>
Index: htdocs/gcc-9/changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-9/changes.html,v
retrieving revision 1.22
diff -u -r1.22 changes.html
--- htdocs/gcc-9/changes.html 30 Sep 2018 14:38:54 -0000 1.22
+++ htdocs/gcc-9/changes.html 19 Oct 2018 04:35:21 -0000
@@ -178,6 +178,13 @@
<!-- <h3 id="powerpc">PowerPC / PowerPC64 / RS6000</h3> -->
+<h3 id="pru">PRU</h3>
+<ul>
+ <li>
+ A new back end targeting TI PRU I/O processors has been contributed to GCC.
+ </li>
+</ul>
+
<!-- <h3 id="s390">S/390, System z, IBM z Systems</h3> -->
<!-- <h3 id="riscv">RISC-V</h3> -->