public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* New pmacros
@ 2009-07-13 21:02 Doug Evans
  2009-07-13 21:36 ` Doug Evans
  0 siblings, 1 reply; 2+ messages in thread
From: Doug Evans @ 2009-07-13 21:02 UTC (permalink / raw)
  To: cgen

Hi.

I checked in the following patch to add several new builtin pmacros,
docs for them, and a testsuite for them.

.eval now has a new definition.
ia64.cpu port needs to be updated.
I'll do that this week.

I kinda wonder whether .foo is sufficiently dissimilar from foo
to avoid problems.
"p-foo" (or some such) may be a sufficiently better choice to
warrant switching.

Tested by rebuilding all files for opcodes and sid (and several gdb files).

Note: I added a couple more argument checks to define-pmacro
(currently commented out).
Some .cpu files are using this incorrectly.
I've patched all the affected .cpu files, I'll check them in and
enable the checks in a bit.

[patch elided for brevity,
see http://sourceware.org/ml/cgen-cvs/2009/msg00060.html]

2009-07-13  Doug Evans  <dje@sebabeach.org>

	Extend pmacro language, add testsuite.
	* Makefile.am (SUBDIRS): Add testsuite.
	* Makefile.in: Regenerate.
	* configure.in (AC_OUTPUT): Create testsuite/Makefile,
	testsuite/test-utils.sh.
	* configure: Regenerate.
	* dev.scm (cload): Handle testsuite app.
	(load-testsuite): New function.
	* pmacros.scm: (-pmacro-debug?): New global.
	(-smacro-table): New global.
	(-smacro-lookup, -smacro-set!): New functions.
	(-pmacro-make): New argument `syntactic-form?', all callers updated.
	(-pmacro-syntactic-form?): New function.
	(-pmacro-expected-number, -pmacro-verify-number): New functions.
	(-pmacro-expected-integer, -pmacro-verify-integer): New functions.
	(-pmacro-expected-non-negative-integer): New function.
	(-pmacro-verify-non-negative-integer): New function.
	(-pmacro-expand-expr-list): New function.
	(-pmacro-process-args-1): Renamed from -pmacro-process-args.
	(-pmacro-process-args): Renamed from -pmacro-invoke.
	(-pmacro-apply, -smacro-apply): New functions.
	(-pmacro-expand): Rewrite syntactic form processing.
	(-pmacro-build-lambda): Reformat.
	(define-pmacro): Watch for more errors in definition.
	(pmacro-debug): New function.
	(pmacro-trace): Set/reset -pmacro-debug?.
	(all existing builtin pmacro helpers): Rename to -pmacro-builtin-foo.
	(-pmacro-builtin-substring): Fix.  Add support for `end' marker.
	(-pmacro-builtin-for-each, et.al.): New helpers for .for-each, .let,
	.if, .case, .cond, .begin, .print, .dump, .error, .list, .ref,
	.length, .replicate, .equals, .and, .or, .not, .eq, .ne, .lt, .gt,
	.le, .ge, .add, .sub, .mul, .div, .rem, .sll, .srl, .sra, .bitand,
	.bitor, .bitxor, bitinv, .car, .cdr, .caar, .cadr, .cdar, .cddr.
	(pmacros-init!): Initialize -smacro-table.
	Rewrite pmacro initialization.
	* read.scm (reader-process-expanded): Renamed from
	-reader-process-expanded.  All callers updated.
	Recognize () as a no-op.
	(cpu-load): Tweak logging messages.
	* utils.scm (message): Add comment.
	* cpu/play.cpu: Add some instructions to play with .let.
	* doc/cgenint.texi: Move some debugging related docs to here from
	cgen.texi.
	* doc/pmacros.texi: Reorganize.  Add docs for new builtin pmacros.
	* testsuite/Makefile.am: New file.
	* testsuite/Makefile.in: New file.
	* testsuite/test-utils.sh.in: New file.
	* testsuite/run-tests.sh: New file.
	* testsuite/testsuite.cpu: New file.
	* testsuite/pmacros-1.test: New file.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: New pmacros
  2009-07-13 21:02 New pmacros Doug Evans
@ 2009-07-13 21:36 ` Doug Evans
  0 siblings, 0 replies; 2+ messages in thread
From: Doug Evans @ 2009-07-13 21:36 UTC (permalink / raw)
  To: cgen

Doug Evans wrote:
> I kinda wonder whether .foo is sufficiently dissimilar from foo
> to avoid problems.
> "p-foo" (or some such) may be a sufficiently better choice to
> warrant switching.
>
>   

Of course the other way to go, that may be sufficient, is to use +, -, 
==, !=, &&, ||, etc. (where possible).
One would then have to debate = vs ==.  1/2 :-)

I don't have a strong opinion, other than wanting to avoid an issue if 
there is indeed one.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-13 21:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-13 21:02 New pmacros Doug Evans
2009-07-13 21:36 ` Doug Evans

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).