Skip to content

Commit

Permalink
Fixed bignum.c and bn_mul.h to support Thumb2 and LLVM compiler
Browse files Browse the repository at this point in the history
(cherry picked from commit 52b845b)
  • Loading branch information
Paul Bakker committed Jun 25, 2013
1 parent 531e294 commit fc4f46f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/polarssl/bn_mul.h
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@

#if defined(__arm__)

#if defined(__thumb__)
#if defined(__thumb__) && !defined(__thumb2__)

#define MULADDC_INIT \
asm( \
Expand Down
12 changes: 10 additions & 2 deletions library/bignum.c
Original file line number Diff line number Diff line change
Expand Up @@ -934,8 +934,16 @@ int mpi_sub_int( mpi *X, const mpi *A, t_sint b )

/*
* Helper for mpi multiplication
*/
static void mpi_mul_hlp( size_t i, t_uint *s, t_uint *d, t_uint b )
*/
static
#if defined(__APPLE__) && defined(__arm__)
/*
* Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn)
* appears to need this to prevent bad ARM code generation at -O3.
*/
__attribute__ ((noinline))
#endif
void mpi_mul_hlp( size_t i, t_uint *s, t_uint *d, t_uint b )
{
t_uint c = 0, t = 0;

Expand Down

0 comments on commit fc4f46f

Please sign in to comment.