next up previous contents
Next: Performance Counters Up: Appendices Previous: Appendices   Contents


PTLsim uop Reference

The following sections document the semantics and encoding of each micro-operation (uop) supported by the PTLsim processor core. The opinfo[] table in ptlhwdef.cpp and constants in ptlhwdef.h give actual numerical values for the opcodes and other fields described below.

 
Merging Rules

Mnemonic Syntax Operation
op


Merging Rules:

The x86 compatible ALUs implement operations on 1, 2, 4 or 8 byte quantities. Unless otherwise indicated, all operations take a 2-bit size shift field (sz) used to determine the effective size in bytes of the operation as follows:

Flags are calculated based on the sz-byte value produced by the ALU, not the final 64-bit result in rd.


Other Pseudo-Operators


The descriptions in this reference use various pseudo-operators to describe the semantics of each uop. These operators are described below.

EvalFlags(ra)

The EvalFlags pseudo-operator evaluates the ZAPS, CF, OF flags attached to the source operand ra in accordance with the type of condition code evaluation specified by the uop. The operator returns 1 if the evaluation is true; otherwise 0 is returned.

SignExt(ra, N)

The SignExt operator sign extends the ra operand by the number of bits specified by N. Specifically, bit ra[N] is copied to all high order bits from bit 63 down to bit N. If N is not specified, it is assumed to mean the number of bits in the effective size of the uop's result (as described under Merging Rules).

MergeWithSFR(mem, sfr)

The MergeWithSFR pseudo-operator is described in the reference page for load uops.

MergeAlign(mem, sfr)

The MergeAlign pseudo-operator is described in the reference page for load uops.

mov and or xor andnot ornot nand nor eqv
Logical Operations

Mnemonic Syntax Operation
mov


Notes:

add sub addadd addsub subadd subsub addm subm addc subc
Add and Subtract

Mnemonic Syntax Operation
add


Notes:

sel
Conditional Select

Mnemonic Syntax Operation
sel.cc


Notes:

set
Conditional Set

Mnemonic Syntax Operation
set.cc


Notes:

set.sub set.and
Conditional Compare and Set

Mnemonic Syntax Operation
set.sub.cc


Notes:

br
Conditional Branch

Mnemonic Syntax Operation
br.cc


Notes:

br.sub br.and
Compare and Conditional Branch

Mnemonic Syntax Operation
br.cc


Notes:

jmp
Indirect Jump

Mnemonic Syntax Operation
jmp


Notes:

jmpp
Indirect Jump Within Microcode

Mnemonic Syntax Operation
jmpp


Notes:

bru
Unconditional Branch

Mnemonic Syntax Operation
bru


Notes:

brp
Unconditional Branch Within Microcode

Mnemonic Syntax Operation
bru


Notes:

chk
Check Speculation

Mnemonic Syntax Operation
chk.cc


Notes:

ld ld.lo ld.hi ldx ldx.lo ldx.hi
Load

Mnemonic Syntax Operation
ld


Notes:

Unaligned Load Support:

Exceptions:

st
Store

Mnemonic Syntax Operation
st


Notes:

Unaligned Store Support:

Exceptions:

ldp ldxp
Load from Internal Microcode Space

Mnemonic Syntax Operation
ldp


Notes:

stp
Store to Internal Microcode Space

Mnemonic Syntax Operation
stp


Notes:

shl shr sar rotl rotr rotcl rotcr
Shifts and Rotates

Mnemonic Syntax Operation
shl


Notes:

mask
Masking, Insertion and Extraction

Mnemonic Syntax Operation
mask.x|z


Notes:


Control Field Format

The 18-bit rc immediate has the following three 6-bit fields:

DS MC MS
12


Operation:

M = 1'[(ms+mc-1):ms]

T = (ra & ~M) | ((rb >>> ds) & M)

if (Z) {

  # Zero extend

  rd = ra $\leftarrow$ (T & 1'[(ms+mc-1):0])

else if (X) {

  # Sign extend

  rd = ra $\leftarrow$ (T[ms+mc-1]) ? (T | 1'[63:(ms+mc)]) : (T & 1'[(ms+mc-1):0])

} else {

  rd = ra $\leftarrow$ T

}

bswap
Byte Swap

Mnemonic Syntax Operation
bswap


Notes:

collcc
Collect Condition Codes

Mnemonic Syntax Operation
collcc


Notes:

movccr movrcc
Move Condition Code Flags Between Register Value and Flag Parts

Mnemonic Syntax Operation
movccr


Notes:

andcc orcc ornotcc xorcc
Logical Operations on Condition Codes

Mnemonic Syntax Operation
andcc


Notes:

mull mulh
Integer Multiplication

Mnemonic Syntax Operation
mull


Notes:

bt bts btr btc
Bit Testing and Manipulation

Mnemonic Syntax Operation
bt


Notes:

ctz clz
Count Trailing or Leading Zeros

Mnemonic Syntax Operation
ctz


Notes:

ctpop
Count Population of '1' Bits

Mnemonic Syntax Operation
ctpop


Notes:

 
Floating Point Format and Merging


All floating point uops use the same encoding to specify the precision and vector format of the operands. The uop's size field is encoded as follows:

Most floating point operations merge the result with the ra operand to prepare the destination. Since a full 64-bit result is generated with the vector and double formats, the ra operand is not needed and may be specified as zero to reduce dependencies.

Exceptions to this encoding are listed where appropriate.

Unless otherwise noted, all operations update the internal floating point status register (FPSR, equivalent to the MXCSR register in x86 code) by ORing in any exceptions that occur. If the uop is encoded to generate an actual exception on excepting conditions, the FLAG_INV flag is attached to the output to cause an exception at commit time.

No condition code flags are generated by floating point uops unless otherwise noted.

addf subf mulf divf minf maxf
Floating Point Arithmetic

Mnemonic Syntax Operation
addf


Notes:

maddf msubf
Fused Multiply Add and Subtract

Mnemonic Syntax Operation
maddf


Notes:

sqrtf rcpf rsqrtf
Square Root, Reciprocal and Reciprocal Square Root

Mnemonic Syntax Operation
sqrtf


Notes:

cmpf
Compare Floating Point

Mnemonic Syntax Operation
cmpf.type


Notes:

cmpccf
Compare Floating Point and Generate Condition Codes

Mnemonic Syntax Operation
cmpccf.type


Notes:

cvtf.i2s.ins cvtf.i2s.p cvtf.i2d.lo cvtf.i2d.hi
Convert 32-bit Integer to Floating Point

Mnemonic Syntax Operation Used By
cvtf.i2s.ins


Notes:

cvtf.q2s.ins cvtf.q2d
Convert 64-bit Integer to Floating Point

Mnemonic Syntax Operation Used By
cvtf.q2s.ins


Notes:

cvtf.s2i cvt.s2q cvtf.s2i.p
Convert Single Precision Floating Point to Integer

Mnemonic Syntax Operation Used By
cvtf.s2i


Notes:

cvtf.d2i cvtf.d2q cvtf.d2i.p
Convert Double Precision Floating Point to Integer

Mnemonic Syntax Operation Used By
cvtf.d2i


Notes:

cvtf.d2s.ins cvtf.d2s.p cvtf.s2d.lo cvtf.s2d.hi
Convert Between Double Precision and Single Precision Floating Point

Mnemonic Syntax Operation Used By
cvtf.d2s.ins


Notes:


next up previous contents
Next: Performance Counters Up: Appendices Previous: Appendices   Contents
Matt T Yourst 2007-09-26