home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mips
- Path: sparky!uunet!ornl!rsg1.er.usgs.gov!news.cs.indiana.edu!umn.edu!csus.edu!netcom.com!netcom!mjohnson
- From: mjohnson@netcom2.Netcom.COM (Mark Johnson)
- Subject: Re: MIPS R3000 unknown opcodes
- In-Reply-To: najmi@ece.ucdavis.edu's message of 21 Nov 92 00:34:35 GMT
- Message-ID: <MJOHNSON.92Nov22073801@netcom2.Netcom.COM>
- Sender: mjohnson@netcom.com (Mark Johnson)
- Organization: Netcom Online Communications Service
- References: <19476@ucdavis.ucdavis.edu>
- Distribution: usa
- Date: Sun, 22 Nov 1992 15:38:01 GMT
- Lines: 74
-
-
- In article <19476@ucdavis.ucdavis.edu> najmi@ece.ucdavis.edu (Azfar Najmi) writes:
- > There are a number of opcodes in the output [of pixstats] for
- > which we cannot seem to find definitions. (We've looked in
- > the "MIPS RISC Architecture" by Gerry Kane).
-
-
-
- Indian proverb: Give a man a fish, and he eats for one day.
- Teach a man to fish, and he eats for a lifetime.
-
- The thing to do is PERFORM EXPERIMENTS. Be active. Try stuff.
- Force the answer out of the machine against its will.
-
-
- Here is an algorithm that will solve your problem.
-
- 1. Obtain a list of opcodes for the R2000/R3000. Number
- them from 0 to n. Since you have the Kane book, this
- step is Completed.
-
- 2. Write the C program "helloworld.c":
- #include <stdio.h>
- main() { printf("Hello, world\n"); }
-
- 3. Use the "-S" option of the C compiler to generate assembly
- language from the C code: cc -S helloworld.c . Save
- the assembly sourcecode.
-
- 4. Assemble the assembly sourcecode with "as" and pixify
- the binary with "pixie". Run the pixified binary and
- generate the pixstats.
-
- 5. These pixstats are the Control in your experiment.
- Save them.
-
- 6. Let i = 0
-
- 7. Copy the helloworld assembly sourcecode from step 3 and
- modify the copy by adding one instruction to the code.
- This instruction uses opcode number i .
-
- 8. Run this new assemly sourcecode through the assembler,
- then pixify the binary, then execute the pixified binary,
- then generate the pixstats.
-
- 9. Compare the pixstats from step 8 with the Control
- pixstats from step 5. This tells you ALL of the
- pixstats categories that opcode number i is counted
- in. Yes, some opcodes are counted in several
- pixstats categories.
-
- 10. Increment i . If i >= n , halt, Otherwise go to step
- number 7.
-
-
- When you do this, you will discover that "cop1" is a
- category that counts instructions that are executed
- by Coprocessor 1 -- which is the R3010 Floating Point
- Coprocessor. See Kane for details.
-
- You'll discover that "spec" are special opcodes --
- opcodes deemed by the author of pixstats to be
- special.
-
- You'll discover that the instructions "ctc1", "cfc1",
- "mtc1", and "mfc1" (which operate upon the two sets
- of registers within coprocessor 1) get counted in a
- most unconventional and amusing way.
-
-
- Have fun,
-
- Mark Johnson
-