mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 03:34:39 +02:00
ARMv8 : handle aggressive optimizers
This commit is contained in:
@@ -527,8 +527,8 @@ int wc_InitAes_h(Aes* aes, void* h)
|
||||
"#store current counter value at the end \n"
|
||||
"ST1 {v0.2d}, %[regOut] \n"
|
||||
|
||||
:[out] "=r" (out), [regOut] "=m" (aes->reg)
|
||||
:"0" (out), [Key] "m" (aes->key), [input] "r" (in),
|
||||
:[out] "=r" (out), [regOut] "=m" (aes->reg), "=r" (in)
|
||||
:"0" (out), [Key] "m" (aes->key), [input] "2" (in),
|
||||
[blocks] "r" (numBlocks), [reg] "m" (aes->reg)
|
||||
: "cc", "memory", "w11", "v0", "v1", "v2", "v3", "v4", "v5",
|
||||
"v6", "v7", "v8", "v9", "v10", "v11", "v12", "v13"
|
||||
@@ -584,8 +584,8 @@ int wc_InitAes_h(Aes* aes, void* h)
|
||||
"ST1 {v0.2d}, %[regOut] \n"
|
||||
|
||||
|
||||
:[out] "=r" (out), [regOut] "=m" (aes->reg)
|
||||
:"0" (out), [Key] "m" (aes->key), [input] "r" (in),
|
||||
:[out] "=r" (out), [regOut] "=m" (aes->reg), "=r" (in)
|
||||
:"0" (out), [Key] "m" (aes->key), [input] "2" (in),
|
||||
[blocks] "r" (numBlocks), [reg] "m" (aes->reg)
|
||||
: "cc", "memory", "w11", "v0", "v1", "v2", "v3", "v4", "v5",
|
||||
"v6", "v7", "v8", "v9", "v10", "v11", "v12", "v13", "v14"
|
||||
@@ -646,8 +646,8 @@ int wc_InitAes_h(Aes* aes, void* h)
|
||||
"ST1 {v0.2d}, %[regOut] \n"
|
||||
|
||||
|
||||
:[out] "=r" (out), [regOut] "=m" (aes->reg)
|
||||
:"0" (out), [Key] "m" (aes->key), [input] "r" (in),
|
||||
:[out] "=r" (out), [regOut] "=m" (aes->reg), "=r" (in)
|
||||
:"0" (out), [Key] "m" (aes->key), [input] "2" (in),
|
||||
[blocks] "r" (numBlocks), [reg] "m" (aes->reg)
|
||||
: "cc", "memory", "w11", "v0", "v1", "v2", "v3", "v4", "v5",
|
||||
"v6", "v7", "v8", "v9", "v10", "v11", "v12", "v13", "v14","v15",
|
||||
@@ -720,8 +720,8 @@ int wc_InitAes_h(Aes* aes, void* h)
|
||||
"#store current counter value at the end \n"
|
||||
"ST1 {v13.2d}, %[regOut] \n"
|
||||
|
||||
:[out] "=r" (out), [regOut] "=m" (aes->reg)
|
||||
:"0" (out), [Key] "m" (aes->key), [input] "r" (in),
|
||||
:[out] "=r" (out), [regOut] "=m" (aes->reg), "=r" (in)
|
||||
:"0" (out), [Key] "m" (aes->key), [input] "2" (in),
|
||||
[blocks] "r" (numBlocks), [reg] "m" (aes->reg)
|
||||
: "cc", "memory", "w11", "v0", "v1", "v2", "v3", "v4", "v5",
|
||||
"v6", "v7", "v8", "v9", "v10", "v11", "v12", "v13"
|
||||
@@ -778,8 +778,8 @@ int wc_InitAes_h(Aes* aes, void* h)
|
||||
"#store current counter value at the end \n"
|
||||
"ST1 {v15.2d}, %[regOut] \n"
|
||||
|
||||
:[out] "=r" (out), [regOut] "=m" (aes->reg)
|
||||
:"0" (out), [Key] "m" (aes->key), [input] "r" (in),
|
||||
:[out] "=r" (out), [regOut] "=m" (aes->reg), "=r" (in)
|
||||
:"0" (out), [Key] "m" (aes->key), [input] "2" (in),
|
||||
[blocks] "r" (numBlocks), [reg] "m" (aes->reg)
|
||||
: "cc", "memory", "w11", "v0", "v1", "v2", "v3", "v4", "v5",
|
||||
"v6", "v7", "v8", "v9", "v10", "v11", "v12", "v13", "v14", "v15"
|
||||
@@ -840,8 +840,8 @@ int wc_InitAes_h(Aes* aes, void* h)
|
||||
"#store current counter value at the end \n"
|
||||
"ST1 {v17.2d}, %[regOut] \n"
|
||||
|
||||
:[out] "=r" (out), [regOut] "=m" (aes->reg)
|
||||
:"0" (out), [Key] "m" (aes->key), [input] "r" (in),
|
||||
:[out] "=r" (out), [regOut] "=m" (aes->reg), "=r" (in)
|
||||
:"0" (out), [Key] "m" (aes->key), [input] "2" (in),
|
||||
[blocks] "r" (numBlocks), [reg] "m" (aes->reg)
|
||||
: "cc", "memory", "w11", "v0", "v1", "v2", "v3", "v4", "v5",
|
||||
"v6", "v7", "v8", "v9", "v10", "v11", "v12", "v13", "v14","v15",
|
||||
@@ -2039,7 +2039,8 @@ static int Aes192GcmEncrypt(Aes* aes, byte* out, const byte* in, word32 sz,
|
||||
,[inX] "4" (xPt), [inY] "m" (aes->H)
|
||||
: "cc", "w11", "v0", "v1", "v2", "v3", "v4", "v5",
|
||||
"v6", "v7", "v8", "v9", "v10", "v11", "v12", "v13", "v14"
|
||||
,"v15", "v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23", "v24"
|
||||
,"v15", "v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23",
|
||||
"v24","v25","v26","v27","v28","v29","v30","v31"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2473,7 +2474,8 @@ static int Aes256GcmEncrypt(Aes* aes, byte* out, const byte* in, word32 sz,
|
||||
[ctr] "2" (iCtr) , [h] "m" (aes->H)
|
||||
: "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5",
|
||||
"v6", "v7", "v8", "v9", "v10","v11","v12","v13","v14",
|
||||
"v15", "v16", "v17","v18", "v19", "v20","v21","v22","v23","v24"
|
||||
"v15", "v16", "v17","v18", "v19", "v20","v21","v22","v23",
|
||||
"v24","v25","v26","v27","v28","v29","v30","v31"
|
||||
);
|
||||
|
||||
|
||||
@@ -4061,7 +4063,8 @@ static void GMULT(byte* X, byte* Y)
|
||||
|
||||
: [xOut] "=r" (X), [yOut] "=r" (Y)
|
||||
: [x] "0" (X), [y] "1" (Y)
|
||||
:
|
||||
: "cc", "memory", "q0", "q1", "q2", "q3", "q4", "q5", "q6" ,"q7", "q8",
|
||||
"q9", "q10", "q11" ,"q12", "q13", "q14", "q15"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4597,7 +4600,7 @@ int wc_AesGcmSetKey(Aes* aes, const byte* key, word32 len)
|
||||
"ST1 {v0.16b}, [%[out]] \n"
|
||||
: [out] "=r" (pt)
|
||||
: [h] "0" (pt)
|
||||
: "cc", "memory"
|
||||
: "cc", "memory", "v0"
|
||||
);
|
||||
}
|
||||
#else
|
||||
@@ -4610,7 +4613,7 @@ int wc_AesGcmSetKey(Aes* aes, const byte* key, word32 len)
|
||||
"VST1.32 {q0}, [%[out]] \n"
|
||||
: [out] "=r" (pt)
|
||||
: [h] "0" (pt)
|
||||
: "cc", "memory"
|
||||
: "cc", "memory", "q0"
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
@@ -305,7 +305,9 @@ int wc_Sha256Update(Sha256* sha256, const byte* data, word32 len)
|
||||
[blocks] "2" (numBlocks), [dataIn] "3" (data)
|
||||
: "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7",
|
||||
"v8", "v9", "v10", "v11", "v12", "v13", "v14",
|
||||
"v15", "w8"
|
||||
"v15", "v16", "v17", "v18", "v19", "v20", "v21",
|
||||
"v22", "v23", "v24", "v25", "v26", "v27", "v28",
|
||||
"v29", "v30", "v31", "w8"
|
||||
);
|
||||
|
||||
AddLength(sha256, SHA256_BLOCK_SIZE * numBlocks);
|
||||
@@ -488,6 +490,7 @@ int wc_Sha256Final(Sha256* sha256, byte* hash)
|
||||
[buffer] "m" (sha256->buffer)
|
||||
: "cc", "memory", "v0", "v1", "v2", "v3", "v8", "v9", "v10", "v11"
|
||||
, "v12", "v13", "v14", "v15", "v16", "v17", "v18"
|
||||
, "v19", "v20", "v21", "v22", "v23", "v24", "v25"
|
||||
);
|
||||
|
||||
sha256->buffLen = 0;
|
||||
@@ -510,7 +513,7 @@ int wc_Sha256Final(Sha256* sha256, byte* hash)
|
||||
"ST1 {v0.2d-v3.2d}, %[out] \n"
|
||||
: [out] "=m" (sha256->buffer)
|
||||
: [in] "m" (sha256->buffer)
|
||||
: "cc", "memory"
|
||||
: "cc", "memory", "v0", "v1", "v2", "v3"
|
||||
);
|
||||
#endif
|
||||
/* ! length ordering dependent on digest endian type ! */
|
||||
@@ -666,7 +669,8 @@ int wc_Sha256Final(Sha256* sha256, byte* hash)
|
||||
"0" (hash)
|
||||
: "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7",
|
||||
"v8", "v9", "v10", "v11", "v12", "v13", "v14",
|
||||
"v15", "v16", "v17", "v18"
|
||||
"v15", "v16", "v17", "v18", "v19", "v20", "v21",
|
||||
"v22", "v23", "v24", "v25"
|
||||
);
|
||||
|
||||
return wc_InitSha256(sha256); /* reset state */
|
||||
@@ -1119,7 +1123,7 @@ int wc_Sha256Final(Sha256* sha256, byte* hash)
|
||||
"VST1.32 {q3}, [%[out]] \n"
|
||||
: [out] "=r" (bufPt)
|
||||
: [in] "0" (bufPt)
|
||||
: "cc", "memory"
|
||||
: "cc", "memory", "q0", "q1", "q2", "q3"
|
||||
);
|
||||
#endif
|
||||
/* ! length ordering dependent on digest endian type ! */
|
||||
|
Reference in New Issue
Block a user