Skip to content

VSHA512MSG1

Henk-Jan Lebbink edited this page Jun 4, 2026 · 1 revision

VSHA512MSG1 — Perform an Intermediate Calculation for the Next Four SHA512 Message Qwords

Opcode/ Instruction Op/ En 64/32 bit Mode Support CPUID Feature Flag Description
VEX.256.F2.0F38.W0 CC 11:rrr:bbb VSHA512MSG1 ymm1, xmm2 AV/V AVX SHA512 Performs an intermediate calculation for the next four SHA512 message qwords using previous message qwords from ymm1 and xmm2, storing the result in ymm1.

Instruction Operand Encoding

Op/En Tuple Type Operand 1 Operand 2 Operand 3 Operand 4
A N/A ModRM:reg (r, w) ModRM:r/m (r) N/A N/A

Description

The VSHA512MSG1 instruction is one of the two SHA512 message scheduling instructions. The instruction performs an intermediate calculation for the next four SHA512 message qwords. See https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf for more information on the SHA512 standard.

Operation

define ROR64(qword, n):
    countn % 64
    dest ← (qword >> count) | (qword << (64-count))
    return dest
define SHR64(qword, n):
    return qword >> n
define s0(qword):
    return ROR64(qword,1) ^ ROR64(qword, 8) ^ SHR64(qword, 7)

VSHA512MSG1 SRCDEST, SRC1

W[4] ← SRC1.qword[0]
W[3] ← SRCDEST.qword[3]
W[2] ← SRCDEST.qword[2]
W[1] ← SRCDEST.qword[1]
W[0] ← SRCDEST.qword[0]
SRCDEST.qword[3] ← W[3] + s0(W[4])
SRCDEST.qword[2] ← W[2] + s0(W[3])
SRCDEST.qword[1] ← W[1] + s0(W[2])
SRCDEST.qword[0] ← W[0] + s0(W[1])

Flags Affected

None.

Intel C/C++ Compiler Intrinsic Equivalent

VSHA512MSG1 __m256i _mm256_sha512msg1_epi64 (__m256i __A, __m128i __B);

SIMD Floating-Point Exceptions

None.

Other Exceptions

See Table 2-23, “Type 6 Class Exception Conditions.”


Source: Intel® 64 and IA-32 Architectures Software Developer's Manual, Combined Volumes (Order Number 325462-091US, March 2026)
Generated: 7-6-2026

Clone this wiki locally