Commit 581ed192 authored by Zhou Peng's avatar Zhou Peng Committed by Brad Fitzpatrick

internal/cpu: convert CRLF to LF line ending, and some superfulous space

Change-Id: Ie355f06e9be93d7f7501f697a94ff83d6d0826a2
Reviewed-on: https://go-review.googlesource.com/114556Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent cf901a72
// Copyright 2018 The Go Authors. All rights reserved. // Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include "textflag.h" #include "textflag.h"
// func hasKM() bool // func hasKM() bool
TEXT ·hasKM(SB),NOSPLIT,$16-1 TEXT ·hasKM(SB),NOSPLIT,$16-1
XOR R0, R0 // set function code to 0 (query) XOR R0, R0 // set function code to 0 (query)
LA mask-16(SP), R1 // 16-byte stack variable for mask LA mask-16(SP), R1 // 16-byte stack variable for mask
MOVD $(0x38<<40), R3 // mask for bits 18-20 (big endian) MOVD $(0x38<<40), R3 // mask for bits 18-20 (big endian)
// check for KM AES functions // check for KM AES functions
WORD $0xB92E0024 // cipher message (KM) WORD $0xB92E0024 // cipher message (KM)
MOVD mask-16(SP), R2 MOVD mask-16(SP), R2
AND R3, R2 AND R3, R2
CMPBNE R2, R3, notfound CMPBNE R2, R3, notfound
MOVB $1, ret+0(FP) MOVB $1, ret+0(FP)
RET RET
notfound: notfound:
MOVB $0, ret+0(FP) MOVB $0, ret+0(FP)
RET RET
// func hasKMC() bool // func hasKMC() bool
TEXT ·hasKMC(SB),NOSPLIT,$16-1 TEXT ·hasKMC(SB),NOSPLIT,$16-1
XOR R0, R0 // set function code to 0 (query) XOR R0, R0 // set function code to 0 (query)
LA mask-16(SP), R1 // 16-byte stack variable for mask LA mask-16(SP), R1 // 16-byte stack variable for mask
MOVD $(0x38<<40), R3 // mask for bits 18-20 (big endian) MOVD $(0x38<<40), R3 // mask for bits 18-20 (big endian)
// check for KMC AES functions // check for KMC AES functions
WORD $0xB92F0024 // cipher message with chaining (KMC) WORD $0xB92F0024 // cipher message with chaining (KMC)
MOVD mask-16(SP), R2 MOVD mask-16(SP), R2
AND R3, R2 AND R3, R2
CMPBNE R2, R3, notfound CMPBNE R2, R3, notfound
MOVB $1, ret+0(FP) MOVB $1, ret+0(FP)
RET RET
notfound: notfound:
MOVB $0, ret+0(FP) MOVB $0, ret+0(FP)
RET RET
// func hasKMCTR() bool // func hasKMCTR() bool
TEXT ·hasKMCTR(SB),NOSPLIT,$16-1 TEXT ·hasKMCTR(SB),NOSPLIT,$16-1
XOR R0, R0 // set function code to 0 (query) XOR R0, R0 // set function code to 0 (query)
LA mask-16(SP), R1 // 16-byte stack variable for mask LA mask-16(SP), R1 // 16-byte stack variable for mask
MOVD $(0x38<<40), R3 // mask for bits 18-20 (big endian) MOVD $(0x38<<40), R3 // mask for bits 18-20 (big endian)
// check for KMCTR AES functions // check for KMCTR AES functions
WORD $0xB92D4024 // cipher message with counter (KMCTR) WORD $0xB92D4024 // cipher message with counter (KMCTR)
MOVD mask-16(SP), R2 MOVD mask-16(SP), R2
AND R3, R2 AND R3, R2
CMPBNE R2, R3, notfound CMPBNE R2, R3, notfound
MOVB $1, ret+0(FP) MOVB $1, ret+0(FP)
RET RET
notfound: notfound:
MOVB $0, ret+0(FP) MOVB $0, ret+0(FP)
RET RET
// func hasKMA() bool // func hasKMA() bool
TEXT ·hasKMA(SB),NOSPLIT,$24-1 TEXT ·hasKMA(SB),NOSPLIT,$24-1
MOVD $tmp-24(SP), R1 MOVD $tmp-24(SP), R1
MOVD $2, R0 // store 24-bytes MOVD $2, R0 // store 24-bytes
XC $24, (R1), (R1) XC $24, (R1), (R1)
WORD $0xb2b01000 // STFLE (R1) WORD $0xb2b01000 // STFLE (R1)
MOVWZ 16(R1), R2 MOVWZ 16(R1), R2
ANDW $(1<<13), R2 // test bit 146 (message-security-assist 8) ANDW $(1<<13), R2 // test bit 146 (message-security-assist 8)
BEQ no BEQ no
MOVD $0, R0 // KMA-Query MOVD $0, R0 // KMA-Query
XC $16, (R1), (R1) XC $16, (R1), (R1)
WORD $0xb9296024 // kma %r6,%r2,%r4 WORD $0xb9296024 // kma %r6,%r2,%r4
MOVWZ (R1), R2 MOVWZ (R1), R2
WORD $0xa7213800 // TMLL R2, $0x3800 WORD $0xa7213800 // TMLL R2, $0x3800
BVS yes BVS yes
no: no:
MOVB $0, ret+0(FP) MOVB $0, ret+0(FP)
RET RET
yes: yes:
MOVB $1, ret+0(FP) MOVB $1, ret+0(FP)
RET RET
// func hasKIMD() bool // func hasKIMD() bool
TEXT ·hasKIMD(SB),NOSPLIT,$16-1 TEXT ·hasKIMD(SB),NOSPLIT,$16-1
XOR R0, R0 // set function code to 0 (query) XOR R0, R0 // set function code to 0 (query)
LA mask-16(SP), R1 // 16-byte stack variable for mask LA mask-16(SP), R1 // 16-byte stack variable for mask
MOVD $(0x38<<40), R3 // mask for bits 18-20 (big endian) MOVD $(0x38<<40), R3 // mask for bits 18-20 (big endian)
// check for KIMD GHASH function // check for KIMD GHASH function
WORD $0xB93E0024 // compute intermediate message digest (KIMD) WORD $0xB93E0024 // compute intermediate message digest (KIMD)
MOVD mask-8(SP), R2 // bits 64-127 MOVD mask-8(SP), R2 // bits 64-127
MOVD $(1<<62), R5 MOVD $(1<<62), R5
AND R5, R2 AND R5, R2
CMPBNE R2, R5, notfound CMPBNE R2, R5, notfound
MOVB $1, ret+0(FP) MOVB $1, ret+0(FP)
RET RET
notfound: notfound:
MOVB $0, ret+0(FP) MOVB $0, ret+0(FP)
RET RET
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment