public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] Fix minor bug in epiphany port
@ 2024-01-09 17:19 Jeff Law
  0 siblings, 0 replies; only message in thread
From: Jeff Law @ 2024-01-09 17:19 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 884 bytes --]


So I consider this port dead as it semi-randomly fails in reload due to 
unrelated changes earlier in the gimple and RTL pipelines.  Regardless 
Richard S's late-combine work did show a very obvious error in the port 
that we should go ahead and fix as long as the port is in-tree.

The epiphany add-with-immediate instruction allows an 11 bit signed 
immediate.  That gives the instruction an immediate range of -1024..1023.

The port actually allowed -8192..8191 due to the uber-weird constraint 
definition.  I've simplified the constraint to match the hardware 
documentation I was able to find.  That was enough to get the epiphany 
port to build libgcc/newlib with Richard S's late-combine work.

The testsuite is so flakey on that port (due to the reload failures) 
that my tester doesn't run it.  So no comparisons are available.

Anyway, I've pushed this to the trunk.

jeff

[-- Attachment #2: P --]
[-- Type: text/plain, Size: 2111 bytes --]

commit 0beb20c01cf7120c724f9882be41a77e970fe63d
Author: Jeff Law <jlaw@ventanamicro.com>
Date:   Tue Jan 9 10:17:54 2024 -0700

    [committed] Fix minor bug in epiphany port
    
    So I consider this port dead as it semi-randomly fails in reload due to
    unrelated changes earlier in the gimple and RTL pipelines.  Regardless Richard
    S's late-combine work did show a very obvious error in the port that we should
    go ahead and fix as long as the port is in-tree.
    
    The epiphany add-with-immediate instruction allows an 11 bit signed immediate.
    That gives the instruction an immediate range of -1024..1023.
    
    The port actually allowed -8192..8191 due to the uber-weird constraint
    definition.  I've simplified the constraint to match the hardware documentation
    I was able to find.  That was enough to get the epiphany port to build
    libgcc/newlib with Richard S's late-combine work.
    
    The testsuite is so flakey on that port (due to the reload failures) that my
    tester doesn't run it.  So no comparisons are available.
    
    gcc/
            * config/epiphany/constraints.md (Car): Allow -1024..1023, no more,
            no less.

diff --git a/gcc/config/epiphany/constraints.md b/gcc/config/epiphany/constraints.md
index e4fda2d34a4..5dc960175f1 100644
--- a/gcc/config/epiphany/constraints.md
+++ b/gcc/config/epiphany/constraints.md
@@ -98,12 +98,12 @@ (define_constraint "Rgs"
        (match_test "REGNO (op) >= FIRST_PSEUDO_REGISTER || REGNO (op) <= 7")))
 
 ;; Constant suitable for the addsi3_r pattern.
+;; No idea why we previously used RTX_OK_FOR_OFFSET with SI, HI an QI
+;; modes.  The instruction in question accepts 11 bit signed constants.
 (define_constraint "Car"
   "addsi3_r constant."
   (and (match_code "const_int")
-       (ior (match_test "RTX_OK_FOR_OFFSET_P (SImode, op)")
-	    (match_test "RTX_OK_FOR_OFFSET_P (HImode, op)")
-	    (match_test "RTX_OK_FOR_OFFSET_P (QImode, op)"))))
+       (match_test "IN_RANGE (INTVAL (op), -1024, 1023)")))
 
 ;; The return address if it can be replaced with GPR_LR.
 (define_constraint "Rra"

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-09 17:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-09 17:19 [committed] Fix minor bug in epiphany port Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).