This is the mail archive of the
cgen@sources.redhat.com
mailing list for the CGEN project.
Re: Register names and dollar signs
Greg McGary <greg@mcgary.org> writes:
> This patch prepends the prefix onto the keyword strings:
I just committed that one.
Now, I have another problem. I want to also allow numeric register
designations $0..$31 as aliases for the ABI-role names ($at, $v0..$v4,
$a0..$a9, $s0..$s2, $gp, $sp, $fp, $ra). The verbose way of doing
it is to define this lot:
(0 0) (1 1) (2 2) (3 3) (4 4) (5 5) (6 6) (7 7)
(8 8) (9 9) (10 10) (11 11) (12 12) (13 13) (14 14) (15 15)
(16 16) (17 17) (18 18) (19 19) (20 20) (21 21) (22 22) (23 23)
(24 24) (25 25) (26 26) (27 27) (28 28) (29 29) (30 30) (31 31)
However, I need this patch to make it work:
Index: desc.scm
===================================================================
RCS file: /cvs/src/src/cgen/desc.scm,v
retrieving revision 1.2
diff -u -p -r1.2 desc.scm
--- desc.scm 2000/12/02 00:18:57 1.2
+++ desc.scm 2000/12/02 00:19:59
@@ -122,7 +122,10 @@ static const CGEN_ATTR_ENTRY bool_attr[]
(string-map (lambda (e)
(string-append
" { \""
- (elm-get self 'prefix) (car e) ; operand name
+ (elm-get self 'prefix)
+ (if (number? (car e))
+ (number->string (car e))
+ (car e)) ; operand name
"\", "
(if (string? (cadr e))
(cadr e)
I'd like to commit this also.
Longer term, should we support a compact encoding, such as a boolean
attribute that says for every instance of (name value), implicitly
define (value value) as well?
Greg