Thumb2 inline ASM: IAR doesn't do register variables#6943
Merged
dgarske merged 1 commit intowolfSSL:masterfrom Nov 7, 2023
Merged
Thumb2 inline ASM: IAR doesn't do register variables#6943dgarske merged 1 commit intowolfSSL:masterfrom
dgarske merged 1 commit intowolfSSL:masterfrom
Conversation
ceaa325 to
7f28df4
Compare
dgarske
reviewed
Nov 3, 2023
Member
dgarske
left a comment
There was a problem hiding this comment.
Thanks Sean for looking into this.
For me this builds fine in IAR now with WOLFSSL_SP_NO_UMAAL.
/* Single Precision Math optimizations */
#define WOLFSSL_HAVE_SP_RSA
#define WOLFSSL_HAVE_SP_DH
#define WOLFSSL_HAVE_SP_ECC
#define WOLFSSL_SP_ARM_CORTEX_M
#define WOLFSSL_SP_ARM_CORTEX_M_ASM
#define WOLFSSL_SP_SMALL
#define WOLFSSL_SP_MATH_ALL
#define WOLFSSL_SP_NO_DYN_STACK
#define WOLFSSL_SP_NO_UMAAL
Customer reports same, but the wolfCrypt test fails ECC test and the performance is degraded compared to v5.6.3.
ecc_test_curve_size 32 failed!
keySize=32, Default
ECC test failed!
error L=26347 code=-3
[fiducial line numbers: 7911 24478 36555 48734]
Only ECC is slower:
v5.6.3:
RSA 2048 public 404 ops took 1.002 sec, avg 2.480 ms, 403.194 ops/sec
RSA 2048 private 12 ops took 1.051 sec, avg 87.583 ms, 11.418 ops/sec
DH 2048 key gen 24 ops took 1.007 sec, avg 41.958 ms, 23.833 ops/sec
DH 2048 agree 24 ops took 1.002 sec, avg 41.750 ms, 23.952 ops/sec
ECC [ SECP256R1] 256 key gen 534 ops took 1.003 sec, avg 1.878 ms, 532.403 ops/sec
ECDHE [ SECP256R1] 256 agree 278 ops took 1.000 sec, avg 3.597 ms, 278.000 ops/sec
ECDSA [ SECP256R1] 256 sign 364 ops took 1.005 sec, avg 2.761 ms, 362.189 ops/sec
ECDSA [ SECP256R1] 256 verify 184 ops took 1.002 sec, avg 5.446 ms, 183.633 ops/sec
v5.6.4:
RSA 2048 public 504 ops took 1.000 sec, avg 1.984 ms, 504.000 ops/sec
RSA 2048 private 14 ops took 1.035 sec, avg 73.929 ms, 13.527 ops/sec
DH 2048 key gen 30 ops took 1.031 sec, avg 34.367 ms, 29.098 ops/sec
DH 2048 agree 30 ops took 1.031 sec, avg 34.367 ms, 29.098 ops/sec
ECC [ SECP256R1] 256 key gen 228 ops took 1.003 sec, avg 4.399 ms, 227.318 ops/sec
ECDHE [ SECP256R1] 256 agree 378 ops took 1.004 sec, avg 2.656 ms, 376.494 ops/sec
ECDSA [ SECP256R1] 256 sign 186 ops took 1.007 sec, avg 5.414 ms, 184.707 ops/sec
ECDSA [ SECP256R1] 256 verify 130 ops took 1.003 sec, avg 7.715 ms, 129.611 ops/sec
7f28df4 to
0729ae7
Compare
IAR doesn't parse register variable declarations with specified registers. IAR doesn't even honor the register keyword. Can use small negative but IAR doesn't like it. Specify the positive value instead. Add a small code size version of mont_reduce_full using umlal and umaal. Make 'asm' usage in variables use keyword '__asm__'. Explicitly don't inline some functions when compiling with IAR.
0729ae7 to
cefe108
Compare
dgarske
approved these changes
Nov 7, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
IAR doesn't parse register variable declarations with specified registers. IAR doesn't even honor the register keyword.
Fixes zd#16936
Testing
Tested armv7m build with SP and asm.
Checklist