mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-11-12 09:24:15 +08:00
Merge cfcda0a095b8e2a17077a82110b4e6d47c437d4d into 4fdb917aae2fb5876e04f88621630712a906a067
This commit is contained in:
commit
01b1abbd37
8
ChangeLog.d/fix-tricore-muladdc-clobber.txt
Normal file
8
ChangeLog.d/fix-tricore-muladdc-clobber.txt
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
Bugfix
|
||||||
|
* Fix the TriCore MULADDC inline assembly in library/bn_mul.h which was
|
||||||
|
missing register d5 (the high half of the e4 carry-in pair) from its
|
||||||
|
clobber list. On TriCore 1.8 (AURIX TC4xx) the compiler could allocate
|
||||||
|
a live value in d5 across the asm block, which the asm then overwrote,
|
||||||
|
corrupting the carry chain. This produced wrong results in
|
||||||
|
mbedtls_mpi_core_mla, making mbedtls_mpi_mod_mpi loop forever. Declare
|
||||||
|
all data registers the asm writes so the compiler does not reuse them.
|
||||||
@ -653,7 +653,8 @@
|
|||||||
"st.a %2, %%a2 \n\t" \
|
"st.a %2, %%a2 \n\t" \
|
||||||
: "=m" (c), "=m" (d), "=m" (s) \
|
: "=m" (c), "=m" (d), "=m" (s) \
|
||||||
: "m" (s), "m" (d), "m" (c), "m" (b) \
|
: "m" (s), "m" (d), "m" (c), "m" (b) \
|
||||||
: "d0", "d1", "e2", "d4", "a2", "a3" \
|
: "d0", "d1", "d2", "d3", "d4", "d5", \
|
||||||
|
"a2", "a3" \
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif /* TriCore */
|
#endif /* TriCore */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user