History log of /gem5/src/arch/x86/isa/microasm.isa
Revision Date Author Comments
# 12390:464513ab8668 13-Dec-2017 Gabe Black <gabeblack@google.com>

x86: Use operand size 4 when it would be 2 for cmpxchg8b.

This means the instruction is treated as cmpxchg8b when the effective
operand size is 16 bits.

Change-Id: I4d9bb295f96097e1746a9bbccb2c579d14738fab
Reviewed-on: https://gem5-review.googlesource.com/6603
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 9471:4193ed60eed7 15-Jan-2013 Nilay Vaish <nilay@cs.wisc.edu>

x86: implements emms instruction


# 9372:7ba317c33683 30-Dec-2012 Nilay Vaish <nilay@cs.wisc.edu>

x86: implement x87 fp instruction fnstsw
This patch implements the fnstsw instruction. The code was originally written
by Vince Weaver. Gabe had made some comments about the code, but those were
never addressed. This patch addresses those comments.


# 7087:fb8d5786ff30 24-May-2010 Nathan Binkert <nate@binkert.org>

copyright: Change HP copyright on x86 code to be more friendly


# 6801:353726c415f4 19-Dec-2009 Gabe Black <gblack@eecs.umich.edu>

X86: Add a common named flag for signed media operations.


# 6800:335f8b406bb9 19-Dec-2009 Gabe Black <gblack@eecs.umich.edu>

X86: Create a common flag with a name to indicate high multiplies.


# 6799:36131e4dfb6e 19-Dec-2009 Gabe Black <gblack@eecs.umich.edu>

X86: Create a common flag with a name to indicate scalar media instructions.


# 6618:2cd3ce4fa03f 20-Aug-2009 Gabe Black <gblack@eecs.umich.edu>

X86: Add microassembler symbols for floating point stack register operands.


# 6517:584314d07394 17-Aug-2009 Gabe Black <gblack@eecs.umich.edu>

X86: Add microcode assembler symbols for mmx registers.


# 6457:f964c623723c 05-Aug-2009 Gabe Black <gblack@eecs.umich.edu>

X86: Let microops force folding an index into the high byte of a register.


# 6345:f9ae7c3a036c 16-Jul-2009 Gabe Black <gblack@eecs.umich.edu>

X86: Take limitted advantage of the compilers type checking for microop operands.


# 5936:c30088a243ad 25-Feb-2009 Gabe Black <gblack@eecs.umich.edu>

X86: Add segmentation checks for ldt related descriptors and selectors.


# 5930:ec124ac0984b 25-Feb-2009 Gabe Black <gblack@eecs.umich.edu>

X86: Rename oszForPseudoDesc maxOsz to reflect its more general use.


# 5906:fe94a5f1f229 25-Feb-2009 Gabe Black <gblack@eecs.umich.edu>

X86: Make the microcode assembler recognize r8-r15.


# 5900:6776001c9b92 25-Feb-2009 Gabe Black <gblack@eecs.umich.edu>

X86: Add a check to chks to verify a task state segment descriptor.


# 5899:b702f4fdf16c 25-Feb-2009 Gabe Black <gblack@eecs.umich.edu>

X86: Add a check to chks which raises #GP(selector) if selector is NULL or not in the GDT.


# 5855:d4e54239ed37 01-Feb-2009 Gabe Black <gblack@eecs.umich.edu>

X86: Distinguish between hardware and software interrupts/exceptions


# 5854:f58bee925c28 01-Feb-2009 Gabe Black <gblack@eecs.umich.edu>

X86: Fix the upper bound on some ranges that were setting up the micro code assembler.


# 5682:6f1cab082ba7 13-Oct-2008 Gabe Black <gblack@eecs.umich.edu>

X86: Add wrval/rdval microops for reading significant miscregs.


# 5676:cca6726c0d88 12-Oct-2008 Gabe Black <gblack@eecs.umich.edu>

X86: Implement local labels for the ROM that actually refer into the ROM.


# 5674:4a4f20dfbc60 12-Oct-2008 Gabe Black <gblack@eecs.umich.edu>

X86: Add a check type for interrupt gates.


# 5671:379f926bc5ff 12-Oct-2008 Gabe Black <gblack@eecs.umich.edu>

X86: Let the microassembler know about the microcode only H segment.


# 5667:78b94954f66a 12-Oct-2008 Gabe Black <gblack@eecs.umich.edu>

X86: Create a handy way to access labels from the ROM in microcode.


# 5666:e7925fa8f0d6 12-Oct-2008 Gabe Black <gblack@eecs.umich.edu>

X86: Make X86's microcode ROM actually do something.


# 5428:5a27fea50fee 12-Jun-2008 Gabe Black <gblack@eecs.umich.edu>

X86: Change what the microop chks does.
Instead of computing the segment descriptor address, this now checks if a
selector value/descriptor are legal for a particular purpose.


# 5426:0bdcc60ccc45 12-Jun-2008 Gabe Black <gblack@eecs.umich.edu>

X86: Add microops and supporting code to manipulate the whole rflags register.


# 5326:7e4cef0e528b 12-Jan-2008 Gabe Black <gblack@eecs.umich.edu>

X86: Redo the bit test instructions.


# 5294:7222bdaed33b 02-Dec-2007 Gabe Black <gblack@eecs.umich.edu>

X86: Reorganize segmentation and implement segment selector movs.


# 5291:5d38610cff05 02-Dec-2007 Gabe Black <gblack@eecs.umich.edu>

X86: Implement the lgdt instruction.


# 5241:a6602acdd046 12-Nov-2007 Gabe Black <gblack@eecs.umich.edu>

X86: Implement the wrcr microop which writes a control register, and some control register work.


# 5232:d3801ea2792e 12-Nov-2007 Gabe Black <gblack@eecs.umich.edu>

X86: Various fixes to indexing segmentation related registers


# 5161:e7334f2d7bef 19-Oct-2007 Gabe Black <gblack@eecs.umich.edu>

X86: Implement the in/out instructions. These will still need support from the TLB and memory system.


# 5149:356e00996637 12-Oct-2007 Gabe Black <gblack@eecs.umich.edu>

X86: Implement MSR reads and writes and the wrsmr and rdmsr instructions.
There are no priviledge checks, so these instructions will all work in all
modes.


# 5121:a5f3cfdc4ee5 03-Oct-2007 Gabe Black <gblack@eecs.umich.edu>

X86: Fix x87 floating point stack register indexing.


# 5082:82dd253231c8 19-Sep-2007 Gabe Black <gblack@eecs.umich.edu>

X86: Put in the foundation for x87 stack based fp registers.


# 5045:bf06c4d63bf4 05-Sep-2007 Gabe Black <gblack@eecs.umich.edu>

X86: Add floating point micro registers.


# 5029:68c3f3be8c8a 29-Aug-2007 Gabe Black <gblack@eecs.umich.edu>

X86: Implement the movlpd instruction.


# 5008:2d852642081e 26-Aug-2007 Gabe Black <gblack@eecs.umich.edu>

X86: Make cpuid actually consider the eax parameter and return different values.


# 4953:1181cf10e11e 07-Aug-2007 Gabe Black <gblack@eecs.umich.edu>

X86: Implemented and hooked in SCAS (scan string)
Fixed the asz assembler symbol.
Adjusted the condion checks to have appropriate options.
Implemented the SCAS microcode.
Attached SCAS into the decoder.


# 4863:b6dacc9a39ff 04-Aug-2007 Gabe Black <gblack@eecs.umich.edu>

X86: Start implementing segmentation support.
Make instructions observe segment prefixes, default segment rules, segment
base addresses.
Also fix some microcode and add sib and riprel "keywords" to the x86
specialization of the microassembler.


# 4686:6ee937c0c431 17-Jul-2007 Gabe Black <gblack@eecs.umich.edu>

Add symbols for each of the flags a microop could set and each condition it could check.


# 4679:0b39fa8f5eb8 14-Jul-2007 Gabe Black <gblack@eecs.umich.edu>

Pull some hard coded base classes out of the isa description.


# 4620:5acc50eeacf7 21-Jun-2007 Gabe Black <gblack@eecs.umich.edu>

Make symbols for regular registers.


# 4615:4ee8c5745c5d 21-Jun-2007 Gabe Black <gblack@eecs.umich.edu>

Define symbols for the x86 specialization of the microassembler.


# 4605:ffadb6f891a1 20-Jun-2007 Gabe Black <gblack@eecs.umich.edu>

Comment out some unnecessary debug output.


# 4537:01bac5417818 08-Jun-2007 Gabe Black <gblack@eecs.umich.edu>

Adjust a few more comments.


# 4533:126c53d7644a 08-Jun-2007 Gabe Black <gblack@eecs.umich.edu>

Clean up where files are included, and get rid of some cruft.

src/arch/x86/isa/main.isa:
Clean up where files are included.


# 4528:f0b19ee67a7b 08-Jun-2007 Gabe Black <gblack@eecs.umich.edu>

Big changes to use the new microcode assembler.


# 4519:f8da6b45573f 04-Jun-2007 Gabe Black <gblack@eecs.umich.edu>

Reworking x86's microcode system. This is a work in progress, and X86 doesn't compile.

src/arch/x86/isa/decoder/one_byte_opcodes.isa:
src/arch/x86/isa/macroop.isa:
src/arch/x86/isa/main.isa:
src/arch/x86/isa/microasm.isa:
src/arch/x86/isa/microops/base.isa:
src/arch/x86/isa/microops/microops.isa:
src/arch/x86/isa/operands.isa:
src/arch/x86/isa/microops/regop.isa:
src/arch/x86/isa/microops/specop.isa:
Reworking x86's microcode system


# 4371:c5003760793e 10-Apr-2007 Gabe Black <gblack@eecs.umich.edu>

Reworked x86 a bit


# 4349:b223256d0a79 08-Apr-2007 Gabe Black <gblack@eecs.umich.edu>

Accidentally didn't save when moving the specialization code out of here.


# 4348:5c21bdb46e6d 06-Apr-2007 Gabe Black <gblack@eecs.umich.edu>

Move the instruction specialization stuff out of the microassembler file, and added some comments to main.isa


# 4344:174e31456abe 06-Apr-2007 Gabe Black <gblack@eecs.umich.edu>

Consolidated the microcode assembler to help separate it from more x86-centric stuff.


# 4343:3f11bcf873b3 06-Apr-2007 Gabe Black <gblack@eecs.umich.edu>

Refactored the x86 isa description some more. There should be more seperation between x86 specific parts, and those parts which are implemented in the isa description but could eventually be moved elsewhere.


# 4338:24d31b35bcf9 04-Apr-2007 Gabe Black <gblack@eecs.umich.edu>

The process of going from an instruction definition to an instruction to be returned by the decoder has been fleshed out more. The following steps describe how an instruction implementation becomes a StaticInst.

1. Microops are created. These are StaticInsts use templates to provide a basic form of polymorphism without having to make the microassembler smarter.
2. An instruction class is created which has a "templated" microcode program as it's docstring. The template parameters are refernced with ^ following by a number.
3. An instruction in the decoder references an instruction template using it's mnemonic. The parameters to it's format end up replacing the placeholders. These parameters describe a source for an operand which could be memory, a register, or an immediate. It it's a register, the register index is used. If it's memory, eventually a load/store will be pre/postpended to the instruction template and it's destination register will be used in place of the ^. If it's an immediate, the immediate is used. Some operand types, specifically those that come from the ModRM byte, need to be decoded further into memory vs. register versions. This is accomplished by making the decode_block text for these instructions another case statement based off ModRM.
4. Once all of the template parameters have been handled, the instruction goes throw the microcode assembler which resolves labels and creates a list of python op objects. If an operand is a register, it uses a % prefix, an immediate uses $, and a label uses @. If the operand is just letters, numbers, and underscores, it can appear immediately after the prefix. If it's not, it can be encolsed in non nested {}s.
5. If there is a single "op" object (which corresponds to a single microop) the decoder is set up to return it directly. If not, a macroop wrapper is created around it.

In the future, I'm considering seperating the operand type specialization from the template substitution step. A problem this introduces is that either the template arguments need to be kept around for the specialization step, or they need to be re-extracted. Re-extraction might be the way to go so that the operand formats can be coded directly into the micro assembler template without having to pass them in as parameters. I don't know if that's actually useful, though.

src/arch/x86/isa/decoder/one_byte_opcodes.isa:
src/arch/x86/isa/microasm.isa:
src/arch/x86/isa/microops/microops.isa:
src/arch/x86/isa/operands.isa:
src/arch/x86/isa/microops/base.isa:
Implemented polymorphic microops and changed around the microcode assembler syntax.


# 4336:bd6ab22f8e11 04-Apr-2007 Gabe Black <gblack@eecs.umich.edu>

Reworking how x86's isa description works. I'm adopting the following definitions to make figuring out what's what a little easier:

MicroOp: A single operation actually implemented in hardware.
MacroOp: A collection of microops which are executed as a unit.
Instruction: An architected instruction which can be implemented with a macroop or a microop.


# 4323:13ca4002d2ac 03-Apr-2007 Gabe Black <gblack@eecs.umich.edu>

A batch of changes and fixes. Macroops are now generated automatically, multiops do alot more of what they're supposed to (excluding memory operands), and microops are slightly more implemented.


# 4309:47807357f0d7 29-Mar-2007 Gabe Black <gblack@eecs.umich.edu>

Add a microcode assembler. A microcode "program" is a series of statements. Each statement has an optional label at the beginning, a capitilized microcode class name which is roughly equivalent to a mnemonic in a regular ISA, and then an optional series of operands seperated by white space. The operands are either a decimal constant, a label, or a code fragment surrounded by non nested {}s. Labels are a letter or underscore followed by letters, underscores, or digits. The syntax for describing code segments might need to be changed if a need arrises to have {}s in the code itself.