public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* Can't see what's wrong with my simulator semantics code....
@ 2001-06-30 10:20 Alan Lehotsky
  0 siblings, 0 replies; 6+ messages in thread
From: Alan Lehotsky @ 2001-06-30 10:20 UTC (permalink / raw)
  To: cgen

cgen claims

     ERROR: read:array unknown option  #\)

when processing the (set dest (if ...)) below.  If I comment out that
3 line "set", it compiles my simulator.
I'm sure I'm doing something really stupid, but this LOOKS like
expressions that compile....

-- Al

p.s.	The instruction basically takes one half of the 32 bit word
	and compares it against a 16 bit immediate.  The 'idx' is a 2 bit
	field where 00=> low 16 bits, 11=> high 16 bits....

=======================


(dni cmpwi "compare word immediate"
     ()
     "cmpwi $rd$idx,$imm16"
     (+ OP5_CMPWI rd idx imm16)
     (sequence ((SI dest))
	       (set dest (if SI (eq idx #3)
			        (and #xffff (srl rd #16))
			        (and #xffff rd)))
	       (set zbit (eq imm16 dest)))
     ()
)

===============
-- 
------------------------------------------------------------------------

		    Quality Software Management
		http://home.earthlink.net/users/~qsmgmt
			apl@alum.mit.edu
			(978)287-0435 Voice
			(978)808-6836 Cell
			(978)287-0436 Fax

	Software Process Improvement and Management Consulting
	     Language Design and Compiler Implementation

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

* Re: Can't see what's wrong with my simulator semantics code....
  2001-06-30 12:10   ` Alan Lehotsky
  2001-06-30 12:25     ` Geoff Keating
@ 2001-06-30 17:12     ` Ben Elliston
  1 sibling, 0 replies; 6+ messages in thread
From: Ben Elliston @ 2001-06-30 17:12 UTC (permalink / raw)
  To: Alan Lehotsky; +Cc: Geoff Keating, cgen

>>>>> "Alan" == Alan Lehotsky <apl@alum.mit.edu> writes:

  Alan> 	I found it.  You were close... The '#' only is for
  Alan> things like hex constants where it needs to be #x.

#d16 should work (d being for "decimal").

  Alan> 	I didn't know about the direct immediate forms, but using
  Alan> 		(const 16)
  Alan> 	works like a charm.

As should just "16".

Cheers, Ben

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

* Re: Can't see what's wrong with my simulator semantics code....
  2001-06-30 12:25     ` Geoff Keating
@ 2001-06-30 12:35       ` Alan Lehotsky
  0 siblings, 0 replies; 6+ messages in thread
From: Alan Lehotsky @ 2001-06-30 12:35 UTC (permalink / raw)
  To: Geoff Keating; +Cc: apl, cgen

At 12:41 PM -0700 6/30/01, Geoff Keating wrote:

> > Date: Sat, 30 Jun 2001 15:09:59 -0400
>> From: Alan Lehotsky <apl@alum.mit.edu>
>> Cc: apl@alum.mit.edu (Alan Lehotsky), cgen@sourceware.cygnus.com
>
>>	cgen is really "cool" when you don't have to fight the error messages.
>
>Yeah.  Line numbers would be a Really Useful Feature.
>
>--
>- Geoffrey Keating <geoffk@geoffk.org>


	You do know about adding "-v" to the CGENFLAGS when you do a make of the
	simulator.  It tells you some stuff that helps isolate where the errors are.

	Also, the old tried and true technique of inserting KNOWN errors to see if the
	parser finds the old error before your new error helps to isolate problems.....

-- 
------------------------------------------------------------------------

		    Quality Software Management
		http://home.earthlink.net/users/~qsmgmt
			apl@alum.mit.edu
			(978)287-0435 Voice
			(978)808-6836 Cell
			(978)287-0436 Fax

	Software Process Improvement and Management Consulting
	     Language Design and Compiler Implementation

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

* Re: Can't see what's wrong with my simulator semantics code....
  2001-06-30 12:10   ` Alan Lehotsky
@ 2001-06-30 12:25     ` Geoff Keating
  2001-06-30 12:35       ` Alan Lehotsky
  2001-06-30 17:12     ` Ben Elliston
  1 sibling, 1 reply; 6+ messages in thread
From: Geoff Keating @ 2001-06-30 12:25 UTC (permalink / raw)
  To: apl; +Cc: apl, cgen

> Date: Sat, 30 Jun 2001 15:09:59 -0400
> From: Alan Lehotsky <apl@alum.mit.edu>
> Cc: apl@alum.mit.edu (Alan Lehotsky), cgen@sourceware.cygnus.com

> 	cgen is really "cool" when you don't have to fight the error messages. 

Yeah.  Line numbers would be a Really Useful Feature.

-- 
- Geoffrey Keating <geoffk@geoffk.org>

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

* Re: Can't see what's wrong with my simulator semantics code....
  2001-06-30 11:55 ` Geoff Keating
@ 2001-06-30 12:10   ` Alan Lehotsky
  2001-06-30 12:25     ` Geoff Keating
  2001-06-30 17:12     ` Ben Elliston
  0 siblings, 2 replies; 6+ messages in thread
From: Alan Lehotsky @ 2001-06-30 12:10 UTC (permalink / raw)
  To: Geoff Keating; +Cc: Alan Lehotsky, cgen

At 12:12 PM -0700 6/30/01, Geoff Keating wrote:

>apl@alum.mit.edu (Alan Lehotsky) writes:
>
>> cgen claims
>>
>>      ERROR: read:array unknown option  #\)
>
>I'm not sure, but try '(and #xFFFF (srl rd 16))'...
>
>I have statements like
>
>     (set-psw Rd (and Rd (inv (sll 1 (and Rs #xF)))))
>
>which work.
>
>(It's kind of annoying that guile doesn't have a manual.)
>
>--
>- Geoffrey Keating <geoffk@geoffk.org>


	I found it.  You were close... The '#' only is for things like hex constants where it needs to be
	#x.

	I didn't know about the direct immediate forms, but using

		(const 16)

	works like a charm.


	cgen is really "cool" when you don't have to fight the error messages. 

-- Al
-- 
------------------------------------------------------------------------

		    Quality Software Management
		http://home.earthlink.net/users/~qsmgmt
			apl@alum.mit.edu
			(978)287-0435 Voice
			(978)808-6836 Cell
			(978)287-0436 Fax

	Software Process Improvement and Management Consulting
	     Language Design and Compiler Implementation

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

* Re: Can't see what's wrong with my simulator semantics code....
       [not found] <p04330101b763b6596543.cygnus.local.cgen@[192.168.1.254]>
@ 2001-06-30 11:55 ` Geoff Keating
  2001-06-30 12:10   ` Alan Lehotsky
  0 siblings, 1 reply; 6+ messages in thread
From: Geoff Keating @ 2001-06-30 11:55 UTC (permalink / raw)
  To: Alan Lehotsky; +Cc: cgen

apl@alum.mit.edu (Alan Lehotsky) writes:

> cgen claims
> 
>      ERROR: read:array unknown option  #\)

I'm not sure, but try '(and #xFFFF (srl rd 16))'...

I have statements like

     (set-psw Rd (and Rd (inv (sll 1 (and Rs #xF)))))

which work.

(It's kind of annoying that guile doesn't have a manual.)

-- 
- Geoffrey Keating <geoffk@geoffk.org>

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

end of thread, other threads:[~2001-06-30 17:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-30 10:20 Can't see what's wrong with my simulator semantics code Alan Lehotsky
     [not found] <p04330101b763b6596543.cygnus.local.cgen@[192.168.1.254]>
2001-06-30 11:55 ` Geoff Keating
2001-06-30 12:10   ` Alan Lehotsky
2001-06-30 12:25     ` Geoff Keating
2001-06-30 12:35       ` Alan Lehotsky
2001-06-30 17:12     ` Ben Elliston

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