// The three-operand SHL/SHR forms, which go tool asm encodes as SHLD/SHRD: // immediate and CL (or its CX spelling) counts at the Q and W widths, next // to the two-operand CX-count spelling GOROOT's bignum kernels use. Every // result is folded back so no instruction is dead. #include "textflag.h" // func dblshift(x, y uint64) uint64 TEXT ·dblshift(SB), NOSPLIT, $0-24 MOVQ x+0(FP), SI MOVQ y+8(FP), DI MOVQ $12, CX SHLQ $13, SI, DI SHRQ $7, DI, SI SHLQ CX, SI, DI SHRQ CX, DI, SI SHLQ CX, SI SHLQ $9, DI SHLW $1, SI, DI SHRW $3, DI, SI XORQ DI, SI MOVQ SI, ret+16(FP) RET // func dblshift32(a, b uint32) uint32 TEXT ·dblshift32(SB), NOSPLIT, $0-12 MOVL a+0(FP), SI MOVL b+4(FP), DI SHLL $5, SI, DI SHRL $2, DI, SI XORL SI, DI MOVL DI, ret+8(FP) RET