46
1 New instructions in a z/series Who is this: Martin Trübner from: Langen, Germany email: martin@pi- sysprog.de This presentation is available at: pi-sysprog.de/ wavv10 This was prepared and presented first by Dan Greiner for SHARE 2009/08

1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:[email protected] This presentation is available at:pi-sysprog.de/wavv10

Embed Size (px)

Citation preview

Page 1: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

1

New instructions in a z/series

Who is this: Martin Trübner

from: Langen, Germany

email: [email protected]

This presentation is available at: pi-sysprog.de/wavv10

This was prepared and presented first by Dan Greiner for SHARE 2009/08

Page 2: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

2

Topics du Jour:

Facilities Added Since the Introduction of z/Architecture in 2000:► z900 (2064) and z800 (2066):

► z990 (2084) and z890 (2086):

► z9-109 (2094)

Why the new facilities were implemented

Only CPU facilities discussed, not I/O

Page 3: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

3

New Facilities in the Z800 & Z900:

Extended-Translation Facility 2 (October 2000)

HFP Multiply-and-Add / Subtract Facility

(October 2001)

Long-Displacement Facility (May 2002)►Reduced-Performance Version

Page 4: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

4

New Facilities in the Z800 & Z900 -Extended-Translation Facility 2:

Performs operations on double-byte, ASCII, and decimal data.

Provides support for manipulation of Unicode strings.

Includes the following instructions:

Name Mne-monic

Op-code

COMPARE LOGICAL LONG UNICODE CLCLU EB8F

MOVE LONG UNICODE MVCLU EB8E

PACK ASCII PKA E9

PACK UNICODE PKU E1

TEST DECIMAL TP EBC0

TRANSLATE ONE TO ONE TROO B993

TRANSLATE ONE TO TWO TROT B992

TRANSLATE TWO TO ONE TRTO B991

TRANSLATE TWO TO TWO TRTT B990

UNPACK ASCII UNPKA EA

UNPACK UNICODE UNPKU E2

Page 5: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

5

New Facilities in the Z800 & Z900 -HFP Multiply-and-Add / Multiply-and-Subtract Facility:

Provides improved performance for hexadecimal floating-point numbers

May be used in place of MULTIPLY followed by ADD (or SUBTRACT)

Key to many improved mathematics functions

Includes the following instructions:

Name Mne-monic

Op-code

MULTIPLY AND ADD MAD ED3E

MULTIPLY AND ADD MADR B33E

MULTIPLY AND ADD MAE ED2E

MULTIPLY AND ADD MAER B32E

MULTIPLY AND SUBTRACT MSD ED3F

MULTIPLY AND SUBTRACT MSDR B33F

MULTIPLY AND SUBTRACT MSE ED2F

MULTIPLY AND SUBTRACT MSER B32F

Page 6: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

6

New Facilities in Z800 & Z900 -Long-Displacement Facility (1):

Exploits previously-unused byte in RXE-format opcode:

►RXE-format introduced with binary-floating point in ESA/390

►RXE (and RSE) used extensively to implement z/Architecture opcodes (e.g., 64-bit instructions)

►Bits 32-39 of the instruction reserved in the new formats

OpCode R1 X2 B2 D2OpCode

0 8 12 16 20 32 40 47

/ / / / / / / /

Page 7: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

7

New Facilities in Z800 & Z900) -Long-Displacement Facility (2):

Extends 12-bit unsigned displacement to 20-bit signed displacement:

►RSY:

►RXY:

►SIY:

OpCode R1 R3 B2 D2OpCode

0 8 12 16 20 32 40 47

OpCode R1 X2 B2 D2OpCode

0 8 12 16 20 32 40 47

OpCode I2 B1 D1OpCode

0 8 16 20 32 40 47

DH2

DH2

DH1

DL2

DL2

DL1

Page 8: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

8

New Facilities in Z800 & Z900 -Long-Displacement Facility (3):

Operand displacement-low field (DL) concatenated with displacement-high field (DH)

►Forms 20-bit signed displacement

►Bit 32 of the instruction is the sign bit

OpCode R1 R3 B2 DL2 DH2OpCode

0 8 12 16 20 32 40 47

20-Bit Signed Displacement

Page 9: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

9

New Facilities in Z800 & Z900 -Long-Displacement Facility (4):

All RSE- and RXE-format instructions with primary opcode of E3 and EB changed to RSY and RXY format, respectively

► 69 z/Architecture instructions converted (64-bit operations)

► Floating-point ops not converted

► Decimal ops not converted

► No change to mnemonics

45 New RSY, RXY, and SIY-format instructions

► Most extend ESA/390-compatible 32-bit instructions

► Mnemonic suffixed with “Y” to indicate long displacement

– Example: New operation “LY” is analog to “L”

Page 10: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

10

New Facilities in Z800 & Z900 -Long-Displacement Facility (5):

Advantages of long displacement►Reduce the number of base registers required to

address data

►Allows for non-zero-based structures

– Structures with prefix

– Certain stack models

►Opportunity for significant performance improvement

– Packing chained structured together

– Reduced address-generation interlocks (AGI)

WARNING: Performance of long-displacement facility on Z800 & Z900 is suboptimal!

Page 11: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

11

New Facilities in Z890 / z990:

DAT-Enhancement Facility 1 (June 2003)

High-Performance Long-Displacement Facility

(June 2003)

Message-Security Assist (June 2003)►Five new instructions

►Five query functions

►Two functions for message digest based on secure hash algorithm (SHA-1)

►Data-encryption-algorithm (DEA) facility

►More to follow in future machines

Page 12: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

12

New Facilities in Z890 / z990:DAT-Enhancement Facility 1:

INVALIDATE DAT TABLE ENTRY (IDTE)

► Provides analog to IPTE, but at the region- and segment-table-entry

level.

► Invalidation-and-clearing operation

– Selectively invalidates region- or segment-table entries

– Selectively clears TLBs CRSTEs and PTEs on all CPUs

► Clearing by ASCE operation

– Selectively clears TLB CRSTEs and PTEs on all CPUs

COMPARE AND SWAP AND PURGE (CSPG)

► 64-Bit version of CSP

► If comparison is true, TLBs and/or ALBs on all CPUs are purged

Page 13: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

13

New Facilities in Z890 & Z990 -Message-Security Assist:

Based on industry-standard DEA

Nine functions for ciphering messages, with or without chaining

Generates message-authentication code using 56-, 112-, and 168-bit keys (64, 128, & 192 bits with parity)

Name Mne-monic

Op-code

CIPHER MESSAGE KM B92E

CIPHER MESSAGE WITH CHAINING KMC B92F

COMPUTE INTERMEDIATE MESSAGE DIGEST

KIMD B93E

COMPUTE LAST MESSAGE DIGEST KLMD B93F

COMPUTE MESSAGE AUTHENTICATION CODE

KMAC B91E

Page 14: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

14

New Facilities in z890 & z990 GA3:

Extended-translation facility 3 (May 2004)

►Performs operations on Unicode and Unicode-Transformation-Format (UTF) characters

►Provides right-to-left TRT

ASN-and-LX-reuse facility (May 2004)

►Allows safe reuse of ASN

►Expands PC Number

Name Mne-monic

Op-code

CONVERT UTF-16 TO UTF-32 CU24 B9B1

CONVERT UTF-32 TO UTF-16 CU42 B9B3

CONVERT UTF-32 TO UTF-8 CU41 B9B2

CONVERT UTF-8 TO UTF-32 CU14 B9B0

SEARCH STRING UNICODE SRSTU B9BE

TRANSLATE AND TEST REVERSED TRTR D0

Name Mne-monic

Op-code

EXTRACT PRIMARY ASN & INSTANCE EPAIR B99A

EXTRACE SECONDARY ASN & INSTANCE

ESAIR B99B

PROGRAM TRANSFER W / INSTANCE PTI B99E

SET SECONDARY ASN W / INSTANCE SSAIR B99F

Page 15: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

15

New Facilities in z9-109:

Compare-and-swap-and-store facility

Conditional-SSKE facility

DAT-Enhancement Facility 2 (LPTEA)

Decimal-floating-point facilities

ETF2-enhancement facility

ETF3-enhancement facility

Extended-immediate facility

Extract-CPU-time facility

HFP-unnormalized extension

Message-security-assist extension 1

Move-with-optional-specifications facility

Store-clock-fast facility

Store-facility-list-extended facility

TOD-clock-steering facility

Page 16: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

16

New Features in z9-109 GA2 -Compare-and-Swap-and-Store Facility:

Current PERFORM LOCKED OPERATION (PLO) provides compare-and-swap-and-store function

►But it’s incompatible with other compare-and-swap operations

►PLO doesn’t do compare-and-swap as interlocked update

z/OS Development requested CSST function that’s compatible with other compare-and-swaps

►New instruction performs block-concurrent interlocked-update compare-and-swap followed by store

►Single, uninterruptible instruction

Page 17: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

17

New Features in z9-109 GA3 -Conditional-SSKE Facility:

Classic SET STORAGE KEY EXTENDED (SSKE):

►Requires that a new storage key is broadcast to all CPUs in the configuration before instruction completes

- For maintenance of TLB entries

►Broadcast can take hundreds of cycles

►Not required in all cases

Conditional SSKE adds new optional M3 control field

►Allows conditional setting of only change or reference bit (so long as the rest of the key matches)

►Business as usual if M3 field is zero (ensures compatibility)

►Potential for significant performance improvement in systems that reassign page frames frequently

Page 18: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

18

New Features in z9-109 -DAT-Enhancement Facility 2:

LOAD PAGE TABLE ENTRY ADDRESS (LPTEA)

► Given a valid virtual address in R2, return the 64-bit real address of the corresponding page-table entry in R1.

► M4 field controls address-space control used to perform translation:

– Primary,– AR-specified,– Secondary,– Home, or – PSW-specified

► CC indicates whether segment is protected (PTE is not inspected).

► Exceptions similar to those of LOAD REAL ADDRESS

Page 19: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

19

New Features in z9-109 GA2 -Decimal Floating Point (1):

Why decimal floating point?

►Given the normal supply of fingers, most people have a very particular affinity for base-10 arithmetic

►Imprecise binary representation of common decimal fractions (like 1/10)

►Accurate conversions between decimal and hex/binary is tricky

–Rounding even trickier

►Emerging standard, expected to have impact on web applications

What’s needed?

►Intuitive arithmetic

►Exact representation of most decimal numbers

►Better handling of rounding

►Handle integers, fixed point, and floating point

Page 20: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

20

New Features in z9-109 GA2 -Decimal Floating Point (2):

DFP number representation:

► value = (-1)sign x coefficient x 10exponent

Truly bizarre encoding:►Sign (S)

►Combination field (CF)

–Two bits of biased exponent

–Leftmost digit (LMD) of coefficient

–Encoding of Infinity and Not-a-Number (NaN)

–All mashed into 5 bits

►Biased exponent continuation field (BXCF)

–Remainder of biased exponent

–Includes controls for quiet or signaling NaNs

–Size depends on precision

►Coefficient continuation field (CCF)

–Remaining portion of the coefficient

–Size depends on precision

Page 21: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

21

New Features in z9-109 GA2 -Decimal Floating Point (2):

Short Format:

Long Format:

Extended Format:

Coefficient-continuation field encoded with 3 decimal digits in 10 bits

S CF BXCF CCF

0 1 6 14 63

S CF BXCF CCF

0 1 6 12 31

S CF BXCF CCF

0 1 6 18 127

Page 22: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

22

New Features in z9-109 GA2 -Decimal Floating Point (3):

Summary of DFP FormatsProperty Short Long Extended

Format length (bits) 32 64 128

Combination length (bits) 11 13 17

Encoded trailing significand length (bits) 20 50 110

Precision (digits), p 7 16 34

Maximum left-units-view (LUV) exponent (Emax) 96 384 6144

Minimum left-units-view (LUV) exponent (Emin) -95 -383 -6143

Left-units-view (LUV) bias 95 383 6143

Maximum right-units-view (RUV) exponent (Qmax) 90 369 6111

Minimum right-units-view (RUV) exponent (Qmin) -101 -398 -6176

Right-units-view (RUV) bias 101 398 6176

Maximum biased exponent 191 767 12,287

Largest (in magnitude) normal number, Nmax (107 – 1) x 1090 (1016 – 1) x 10369 (1034 – 1) x 106111

Smallest (in magnitude) normal number, Nmin 1 x 10-95 1 x 10-383 1 x 10-6143

Smallest (in magnitude) subnormal number, Dmin 1 x 10-101 1 x 10-398 1 x 10-6176

Page 23: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

23

New Features in z9-109 GA2 -Decimal Floating Point (4):

DFP Facility:► 54 problem-state instructions for:

– Adding– Comparing to / from fixed, signed BCD, unsigned BCD– Converting– Dividing– Extracting exponent, significance– Loading and testing, lengthening, rounding– Multiplying– Quantizing– Shifting– Subtracting– Testing data classes– Testing data groups

Page 24: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

24

New Features in z9-109 GA2 -Decimal Floating Point (5):

Control via:►Additional-floating-point (AFP) control (CR0.45)

►Floating-point-control (FPC) register

– New DFP rounding-mode control with 8 options.

z9-109 implementation done in Firmware (with

hardware assists)►Compared to web-based emulations written in C (or

Java), performance is superior.

►All-hardware implementation planned for future systems

Page 25: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

25

New Features in z9-109 GA2 -DFP Support Facilities:

DFP Rounding Facility:► SET DFP ROUNDING MODE instruction (and associated rounding

modes in FPC register).

Floating-Point-Support-Sign-Handling Facility:► COPY SIGN► LOAD COMPLEMENT► LOAD NEGATIVE► LOAD POSITIVE

FPR-GR-Transfer Facility:► LOAD FPR FROM GR► LOAD GR FROM FPR

IEEE-Exception-Simulation Facility:► SET FPC AND SIGNAL► LOAD FPC AND SIGNAL

Page 26: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

26

New Features in z9-109 GA3 -PERFORM FLOATING-POINT OPERATION:

Converts floating point number from/to any of the following►BFP short DFP short HFP short

►BFP long DFP long HFP long

►BFP extended DFP extended HFP extended

(54 possibilities)

Provides exception controls for:►IEEE inexact suppression

►IEEE alternate exception action (overflow & underflow)

►HFP overflow / underflow

►DFP preferred-quantum

Provides rounding controls for:►Round according to current DFP or BFP rounding mode

►Round to nearest with ties to even / zero / away from zero

►Round towards or away from zero

►Round towards + or – infinity

►Round to prepare for shorter precision

Page 27: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

27

New Features in z9-109 -ETF2-Enhancement Facility:

Extended-translation facility 2 added TROO, TROT, TRTO and TRTT instructions.

►For all 4 instructions, a comparison to a test character is performed (e.g., NULL)

►Translation stops if test character is reached.

►For TRTO and TRTT, the translation table must be on a 4K-byte boundary

–Tables are 64K and 128K, respectively.

ETF2-enhancement facility:

►Adds optional M3 field to TRxx instructions (changes format from RRE to RRF)

►Business as usual when M3 is zero (ensures compatibility)

►Allows test-character comparison to be optionally bypassed

►Aligns translation table for all 4 ops on a doubleword (regardless of M3)

Page 28: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

28

New Features in z9-109 -ETF3-Enhancement Facility:

Original Extended-Translation Facility and Extended-Translation Facility 3 (ETF3) provided Unicode conversion instructions.

►Conformed to Unicode Standard 2.0 when designed

►Allowed certain ill-formed characters in favor of performance

►Unicode Standard 4.0 no longer condones ill-formed characters.

ETF3-Enhancement:

►Adds program control to CU12, CU14, CU21, and CU24 to require full well-formedness checking

►Optional M3 operand in the instruction

►Business as usual when M3 is zero (ensures compatibility)

►When the M3 flag is 1, full well-formedness checking performed

–Performance likely to be degraded

Page 29: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

29

New Features in z9-109 -Extended-Immediate Facility (1):

Adds numerous 32-bit immediate-operand instructions► ADD IMMEDIATE (AFI, AGFI)

► ADD LOGICAL IMMEDIATE (ALFI, ALGFI)

► AND IMMEDIATE (NIHF, NILF)

► COMPARE IMMEDIATE (CFI, CGFI)

► COMPARE LOGICAL IMMEDIATE (CLFI, CLGFI)

► EXCLUSIVE OR IMMEDIATE (XIHF, XILF)

► INSERT IMMEDIATE (IIHF, IILF)

► LOAD IMMEDIATE (LGFI)

► LOAD LOGICAL IMMEDIATE (LLIHF, LLILF)

► OR IMMEDIATE (OIHF, OILF)

► SUBTRACT LOGICAL IMMEDIATE (SLFI, SLGFI)Minimizes need for DCs or literal pool for constant values.

Page 30: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

30

New Features in z9-109 -Extended-Immediate Facility (2):

Adds numerous miscellaneous instructions► FIND LEFTMOST ONE (FLOGR)

► LOAD AND TEST (LT, LTG)– Adds RXE-format to existing RR- and RRE-formats.

► LOAD BYTE (LBR, LGBR)– Adds RRE format to existing LB and LGB

► LOAD HALFWORD (LHR, LGHR)– Adds RRE format to existing LH and LGH

► LOAD LOGICAL CHARACTER (LLC, LLCR, LLGCR)– Adds 32-bit RXY-format, and 32- and 64-bit RRE-formats

► LOAD LOGICAL HALFWORD (LLH, LLHR, LLGHR)– Adds 32-bit RXY-format, and 32- and 64-bit RRE-formats

Advantages:► Fewer storage references

► Smaller code image

Page 31: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

31

New Features in z9-109 GA2 -Extract-CPU-Time Facility:

Original STORE CPU TIMER (STPT) is a privileged instruction

►z/OS TIMEUSED service routine:

–Extracts CPU timer for problem-state programs

–Takes hundreds of CPU cycles (PC, lock, disable, observe, enable, unlock , PR)

–Significantly skews measurements

EXTRACT CPU TIME (ECTG) instruction:

►Problem-state instruction

►Can provide most data provided by TIMEUSED

►Substantially less overhead

►May facilitate better measurement of module flow, instruction sequences, micro-accounting, &c.

►Requires access to SCP-maintained fields:

–Task-time used

–CPU timer at last dispatch

–Scaling factor for secondary CPUs.

Page 32: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

32

New Features in z9-109 -HFP Unnormalized Extension:

Adds unnormalized

versions of MULTIPLY and

MULTIPLY AND ADD to

hexadecimal floating point

Useful in multi-precision

and crypto applications

All are RRF-format ops.

Name Mne-monic

Op-code

MULTIPLY UNNORMALIZED MYR B33B

MULTIPLY UNNORMALIZED MYHR B33D

MULTIPLY UNNORMALIZED MRLR B339

MULTIPLY UNNORMALIZED MY ED3B

MULTIPLY UNNORMALIZED MYH ED3D

MULTIPLY UNNORMALIZED MYL ED39

MULTIPLY AND ADD UNNORMALIZED MAXWR B33A

MULTIPLY AND ADD UNNORMALIZED MAWR B33C

MULTIPLY AND ADD UNNORMALIZED MAYWR B338

MULTIPLY AND ADD UNNORMALIZED MAXW ED3A

MULTIPLY AND ADD UNNORMALIZED MAW ED3C

MULTIPLY AND ADD UNNORMALIZED MAYW ED38

Page 33: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

33

New Features in z9-109 -Message-Security-Assist Extension 1:

Adds two 256-bit secure-hash-algorithm (SHA) functions:► COMPUTE INTERMEDIATE MESSAGE DIGEST

► COMPUTE FINAL MESSAGE DIGEST

Adds two 128-bit advanced-encryption-standard (AES)

functions:► CIPHER MESSAGE WITH CHAINING

► CIPHER MESSAGE (sans chaining)

Adds 64-bit pseudo-random-number-generation facility► CIPHER MESSAGE WITH CHAINING

All are extensions to message-security assist added in

z990 GA1.

Page 34: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

34

New Features in z9-109 GA2 -Move-with-Optional-Specifications Facility:

MVCOS provides über MOVE CHARACTER

►True length specified in a register (no need for EXECUTE)

►Moves up to 4K in one execution

►Moves from any address-space control (ASC) to any other

►Moves from any key to any other

►Key and ASC for source and destination may be explicitly program-specified or use current-PSW values

►May be faster than MOVE LONG for 4K-byte moves, but …

►Will likely be slower than executed MVC for < 256-byte move.

Equivalent to MVCP, MVCS, MVCDK, MVCSK, MVCK

►Except the above are limited to 256 bytes; MVCOS is not.

►Available to problem-state code (subject to PSW key mask)

Page 35: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

35

New Features in z9-109 -Store-Clock-Fast Facility (1):

Current architecture for STORE CLOCK requires:► Unique, monotonically-advancing 64-bit TOD value stored by each

CPU.

► Same value may not be stored twice

► Uniqueness guaranteed by placing CPU number in rightmost bits

In prior machines, cycle time was slow enough that rightmost “ticking” bit of clock did not collide with CPU number.

► In future CPUs, ticking bit of clock will collide with CPU number

– Currently (z9-109) TOD bit 57 is the ticker

– Future CPU numbers may require > 6 bits!

► To guarantee monotonic advancement, the result of STORE CLOCK (STCK) must be delayed (potentially > 100 cycles)

– Partly due to uniqueness issue

– Partly due to inter-processor signaling in MP environment

Page 36: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

36

New Features in z9-109 -Store-Clock-Fast Facility (2):

STORE CLOCK FAST allows storing of full-resolution 64-bit clock

►Same clock value may be seen by the same or other CPUs multiple times.

►Should be used only by applications that can tolerate it

–Duplicate time stamps means exact sequence cannot be determined in an MP environment!

►STCKF (B27C hex) can replace STCK (B205 hex)

TRACE instruction can also use STCKF format

►Subject to control register 0, bit 32.

Facility is not required if program switches to STORE CLOCK EXTENDED and TRACE (TRACG)

Page 37: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

37

New Features in z9-109 -Store-Facility-List-Extended Facility:

Original z/Architecture STORE FACILITY LIST (STFL):

►Stores a list of facility bits at real location 200 (C8 hex)

►Privileged operation (supervisor state)

►Inaccessible unless SCP maps real 0 to virtual 0

– Z/OS does

–z/VSE does

– Linux doesn’t

►Limited to 32 facilities (one word – potentially extendable)

STORE FACILITY LIST EXTENDED (STFLE)

►General instruction (problem state)

►Stores the results in a program-specified location and length

►Up to 16,384 facilities may be indicated

►Maps the first 32 facilities the same as STFL

Page 38: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

38

New Features in z9-109 -TOD-Clock-Steering Facility:

Semi-privileged facility provides support for the Server

Time Protocol (STP)

PERFORM TIMING FACILITY FUNCTION (PTFF) instruction

Multiple functions based on code in GR0:► Query available functions

► Query TOD offset

► Query steering information

► Adjust TOD offset

► Set TOD offset

► Set fine steering rate

► Set gross steering rate

Page 39: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

39

Exploitation of New Facilities (1):

How do I know if a facility is installed?

►Facility indications stored by STFLE or STFL

Bit Meaning

0 “N3” instructions installed

1 v z/Architecture installed

2 v z/Architecture active

3 DAT-enhancement installed

4 IDTE selective segment clearing

5 IDTE selective region clearing

6 ASN-and-LX-reuse installed

7 STFLE installed

8 v Enhanced DAT installed

9 Sense-running-status installed

10 Conditional-SSKE installed

16 Extended-translation 2 installed

17 Message-security assist inst.

18 Long displacement installed

19 Long displacement high perf.

20 HFP Mult-and-Add/Sub installed

Bit Meaning

21 Extended-immediate installed

22 Extended-translation 3 installed

23 HFP-unnormalized-ext. inst.

24 ETF2-enhancement installed

25 STCKF installed

27 MVCOS installed

28 TOD-clock steering installed

30 ETF3-enhancement installed

31 ECTG installed

32* CSST installed

41* FP-support-enhancements inst.

42* DFP installed

43* DFP high performance

44* PFPO installed

* Note, STFL cannot store beyond bit 31

v=have names in z/VSE

Page 40: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

40

Loc Object Code Addr1 Addr2 Stmt Source Statement

000000 00000 00038 28 TESTCASE CSECT

R:0 00000 30 USING PSA,0

000000 E310 0048 0004 00048 31 LG 1,FLCCVT2-4

000006 9110 00CA 000CA 32 TM FLCFACL2,FLCFLDHP

00000A A7E4 0006 00016 33 JNO OLD_SCHOOL

R:1 00100 34 USING CVTMAP,1

00000E E3F0 1FD8 FF04 000D8 35 LG 15,CVTPRODN

000014 07FE 36 BR 14

37 DROP 1

000016 38 OLD_SCHOOL DS 0H

000016 A71B FF00 FFFF00 39 AGHI 1,-256

R:1 00000 40 USING CVTFIX,1

00001A E3F0 10D8 0004 000D8 41 LG 15,CVTPRODN

000020 07FE 42 BR 14

Exploitation of New Facilities (2) –Long-Displacement - Prefixed Structures (z/OS):

Old wayNew wayExtra

Page 41: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

41

Exploitation of New Facilities (3) –Long-Displacement – Restructuring Linked Blocks:

Base Reg

Block 1

@Block2

Block3

STUFF

Block2

@Block3@Block3

STUFF

Blocks 1-3

@Block2

Base Reg12-Bit Dispacement

LG 1,@Block1USING Block1,1LG 2,@Block2USING Block2,2LG 3,@Block3USING Block3,3LG 4,STUFF

20-Bit Displacement

LG 1,@Block1USING Block1,1LG 4,STUFF

Page 42: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

42

Exploitation of New Facilities (4) –Extended-Immediate Facility:

Without Extended Immediate With Extended Immediate

SG R2,=FD’12345678’ AGFI R2,-12345678

LG R5,678(R9,R10) LTGR R5,R5

LTG R5,678(R9,R10)

SLLG R1,R1,48 SRAG R1,R1,48

LGHR R1,R1

XG R5,=X'00000000000000FF' LLGCR R5,R5

LG R0,=X’8000000000000000’ LGHI R2,R0LOOP LTGR R1,R0 JZ DONE NGR R1,R4 JNZ DONE SRLG R0,R0,1 AGHI R2,1 J LOOPDONE LGR R3,R4 XGR R3,R1

FLOGR R2,R4

Page 43: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

43

Exploitation of New Facilities (5) –Timing-Related Functions:

STORE CLOCK FAST (STCKF)► If you do not require monotonically-advancing TOD-clock

value, replace STCK with STCKF– Reassemble– Zap– Conditionally alter STCKs

EXTRACT CPU TIME (ECTG)► z/OS TIMEUSED macro can branch-enter service routine that

will execute ECTG.– Either conditionally, depending on availability, or– Always issue ECTG.

► Where TIMEUSED is not available, or where branch-entry to z/OS TIMEUSED service is still too expensive, ECTG may be coded inline

– Requires intimate knowledge of O/S task-timing structures.

Page 44: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

44

Summary:

Numerous facilities have been added to z/Architecture since its

introduction in 2000:► DAT enhancements (1 & 2)

► Decimal Floating Point (and support facilities)

► Extended Immediate

► HFP Multiply-and-Add (normalized / unnormalized)

► Long Displacement

► Message Security Assist

► Timing facilities (ECTG, PTFF, STCKF)

► &c (CSST, C-SSKE, STFLE, MVCOS)

Exploitation of these facilities requires modest to substantial program

development.

Significant performance benefits may be realized from careful

implementation of these facilities.

Page 45: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

45

Questions?

Page 46: 1 New instructions in a z/series Who is this:Martin Trübner from:Langen, Germany email:martin@pi-sysprog.de This presentation is available at:pi-sysprog.de/wavv10

46

New instructions in a z/series

Who is this: Martin Trübner

from: Langen, Germany

email: [email protected]

This presentation is available at: pi-sysprog.de/wavv10

This was prepared and presented first by Dan Greiner for SHARE 2009/08

Original Name in SHARE: S1290........and there is S1291