[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[openrisc] Re: "nop"



A couples of things I think are good:

1. machine code with all bits set to zero should represent illeagal insn.
Another better way is that this insn represent absolute jump insn. So since
a lot of memory is zeroed and if your program goes 'tralalala' you might get
a jump to location 0x0 in memory and with enabled MMU protection on first
page of virtual memory you would be a page fault. I think this is what linux
kernel does for page zero (but I am not sure if on all architectures; at
least it does on some). This would catch all NULL pointer dereferences and a
lot of 'program going tralalala'. So I set l.jal in or1-ab to be '0x0 0x0
0x0 0x0'.

2. Insns should be split into several classes. Class I or basic class has
all necessary insns. Class II and following would have muls, mulu, divs etc.
insns that can also be emulated in case implementation does not support
them. So ley say you have OR1007 and OR1008. OR1007 supports only class I
while OR1008 supports all classes. You have such illegal exception handler
that can emulate ALL other insns from classes II, III etc. So programs work
both on OR1007 and OR1008. Then you make OR1010 with only one missing insn
from class II. Since you use the same illegal handler you can now emulate
only missing insn without actually making any modifications to illegal
handler. I think this approch would be grat. Actually user could remove
insns of its choice (depends on his application requirements) and all
programs would still work.

regards, Damjan

----- Original Message -----
From: Johan Rydberg <johan.rydberg@netinsight.se>
To: Damjan Lampret <lampret@opencores.org>; Jimmy Chen-Min Chen
<jimmy87@sunplus.com.tw>
Sent: Monday, March 20, 2000 11:21 AM
Subject: "nop"


>
> The best thinh would be if the bytes in the "nop" opcode could
> be the same, so you can byte fill a bit of memory with say 0x3
> and it will be represented as noops.
>
> --
> Johan Rydberg johan.rydberg@netinsight.net
> Net Insight AB, Sweden direct: +46-8-685 04 17
> http://www.netinsight.net phone:  +46-8-685 04 00
> fax:    +46-8-685 04 20
>