Patchwork [08/28] mn10300: Define the A and D constraints.

login
register
mail settings
Submitter Richard Henderson
Date Jan. 10, 2011, 8:31 p.m.
Message ID <1294691517-19580-9-git-send-email-rth@redhat.com>
Download mbox | patch
Permalink /patch/78205/
State New
Headers show

Comments

Richard Henderson - Jan. 10, 2011, 8:31 p.m.
From: Richard Henderson <rth@twiddle.net>

This will allow combining am33 and mn103 alternatives
without having to resort to the enabled attribute.

The existing 'A' constraint renamed to 'c'.  Thankfully
this existing accumulator constraint doesn't appear in
either newlib or eglibc sources.
---
 gcc/config/mn10300/constraints.md |   11 ++++++++++-
 gcc/config/mn10300/mn10300.md     |    8 ++++----
 2 files changed, 14 insertions(+), 5 deletions(-)
Jeff Law - Jan. 11, 2011, 2:53 p.m.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/10/11 13:31, Richard Henderson wrote:
> From: Richard Henderson <rth@twiddle.net>
> 
> This will allow combining am33 and mn103 alternatives
> without having to resort to the enabled attribute.
> 
> The existing 'A' constraint renamed to 'c'.  Thankfully
> this existing accumulator constraint doesn't appear in
> either newlib or eglibc sources.
Isn't this a user-visible change?  What about the kernel, didn't it have
an mn103 port and it'd be more likely to expose the old A constraint
than newlib/glibc IMHO.

At the least this probably ought to be documented.

jeff
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNLG7VAAoJEBRtltQi2kC762AH/RLvvhQCLBQKegCr76T35eiE
RAYwAyQD5omvmcb+Q6p64CQfQOqNjj+6zv+KnPutNeoYTEwvrsHSw3j3xhLgiWI8
/OTZ8j7eulFyh7OqaMulpcUG2TNuATiyAkTg/kJ7j1vYTTue62IOCNds0gc70Jll
Bn/L14CrAhEd+vOJd0SPim3UQujxQl2np/UPtAhQ4Ou8QNlVxUf7IRjodJ2n/WiL
E2zjKL4sU8QSmWxIcVwiSlZnbK09ZjDwdVnRgD8ijeSwxHpEiG8R8nivZ9k7GazA
+cZba3dasPVR2a+M8jWl7vnp14HYCoA5eeQVLAvDNhozoW6QyPG+KEAvvlLQe68=
=Jqn0
-----END PGP SIGNATURE-----
Richard Henderson - Jan. 11, 2011, 4:30 p.m.
On 01/11/2011 06:53 AM, Jeff Law wrote:
> Isn't this a user-visible change?  What about the kernel, didn't it have
> an mn103 port and it'd be more likely to expose the old A constraint
> than newlib/glibc IMHO.

It is user-visible.  I tried to think of another letter that would
make as much sense as the d/D pair, but I thought biting the bullet
and making a/A match the same way was easier to remember.

As for the kernel, it doesn't use A either.  Which isn't surprising
given that it doesn't do floating-point at all.


r~
Jeff Law - Jan. 11, 2011, 6:12 p.m.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/11/11 09:30, Richard Henderson wrote:
> On 01/11/2011 06:53 AM, Jeff Law wrote:
>> Isn't this a user-visible change?  What about the kernel, didn't it have
>> an mn103 port and it'd be more likely to expose the old A constraint
>> than newlib/glibc IMHO.
> 
> It is user-visible.  I tried to think of another letter that would
> make as much sense as the d/D pair, but I thought biting the bullet
> and making a/A match the same way was easier to remember.
> 
> As for the kernel, it doesn't use A either.  Which isn't surprising
> given that it doesn't do floating-point at all.
Oh, I mis-read what A had been used for.  I think documenting in the
release notes is all we really need to do for this.

jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNLJ2bAAoJEBRtltQi2kC73fYH/i6Z6wlbDP84vFfzNTko8g5B
TO0RA1J1JLOXeZKjcztWOf9Ba/rSBvSk3dJlYklGCWRBX12IBtYD0JiV8382RB2Q
9aWBCJaMc80Y0ukTwIqIY/ZUOPSjzz0F+UqZyP0hFdPUJ5PJy1K6eEWXZnJtuZjS
HnbOMq8Y2EQ680E6PO3Mhoow9OM+v/HDeV6gIcYSoJwPatHDjxm7oZg5ErJZoY+q
fS3MM2ZJfgZesPu8D0z6MBXs4Ir8/JGFibs/ZJq9NfOZNuIIBFrtxaQX6gV5YToJ
+iMUNa9QbOoRHyBAE2dJEZVsn5PSon/4Tr8i/e9P4rNva0SjgupKG6ybEfEThA0=
=QgJ+
-----END PGP SIGNATURE-----

Patch

diff --git a/gcc/config/mn10300/constraints.md b/gcc/config/mn10300/constraints.md
index 509970c..c9863fc 100644
--- a/gcc/config/mn10300/constraints.md
+++ b/gcc/config/mn10300/constraints.md
@@ -23,6 +23,15 @@ 
 (define_register_constraint "a" "ADDRESS_REGS"
   "An address register.")
 
+;; This can be used for QI/HImode memory operations, and most arithmetic.
+;; AM33 supports these on all registers, where MN103 needs DATA_REGS.
+(define_register_constraint "D" "TARGET_AM33 ? GENERAL_REGS : DATA_REGS"
+  "A general register for AM33, and a data register otherwise.")
+
+;; Similarly for ADDRESS_REGS vs GENERAL_REGS.
+(define_register_constraint "A" "TARGET_AM33 ? GENERAL_REGS : ADDRESS_REGS"
+  "A general register for AM33, and an address register otherwise.")
+
 (define_register_constraint "y" "SP_REGS"
   "An SP register (if available).")
 
@@ -32,7 +41,7 @@ 
 (define_register_constraint "f" "TARGET_AM33_2 ? FP_REGS : NO_REGS"
   "A floating point register.")
 
-(define_register_constraint "A" "TARGET_AM33_2 ? FP_ACC_REGS : NO_REGS"
+(define_register_constraint "c" "TARGET_AM33_2 ? FP_ACC_REGS : NO_REGS"
   "A floating point accumulator register.")
 
 (define_memory_constraint "Q"
diff --git a/gcc/config/mn10300/mn10300.md b/gcc/config/mn10300/mn10300.md
index bfa453f..1773a03 100644
--- a/gcc/config/mn10300/mn10300.md
+++ b/gcc/config/mn10300/mn10300.md
@@ -2717,7 +2717,7 @@ 
 )
 
 (define_insn "fmasf4"
-  [(set (match_operand:SF         0 "register_operand" "=A")
+  [(set (match_operand:SF         0 "register_operand" "=c")
 	(fma:SF (match_operand:SF 1 "register_operand" "f")
 		(match_operand:SF 2 "register_operand" "f")
 		(match_operand:SF 3 "register_operand" "f")))
@@ -2730,7 +2730,7 @@ 
 )
 
 (define_insn "fmssf4"
-  [(set (match_operand:SF                 0 "register_operand" "=A")
+  [(set (match_operand:SF                 0 "register_operand" "=c")
 	(fma:SF (match_operand:SF         1 "register_operand" "f")
 		(match_operand:SF         2 "register_operand" "f")
 		(neg:SF (match_operand:SF 3 "register_operand" "f"))))
@@ -2743,7 +2743,7 @@ 
 )
 
 (define_insn "fnmasf4"
-  [(set (match_operand:SF                 0 "register_operand" "=A")
+  [(set (match_operand:SF                 0 "register_operand" "=c")
 	(fma:SF (neg:SF (match_operand:SF 1 "register_operand" "f"))
 		(match_operand:SF         2 "register_operand" "f")
 		(match_operand:SF         3 "register_operand" "f")))
@@ -2756,7 +2756,7 @@ 
 )
 
 (define_insn "fnmssf4"
-  [(set (match_operand:SF                 0 "register_operand" "=A")
+  [(set (match_operand:SF                 0 "register_operand" "=c")
 	(fma:SF (neg:SF (match_operand:SF 1 "register_operand" "f"))
 		(match_operand:SF         2 "register_operand" "f")
 		(neg:SF (match_operand:SF 3 "register_operand" "f"))))