[CM] S7 scheme running on Android in NDK

Jason Ripley ripley.jason at gmail.com
Fri May 3 15:17:04 PDT 2013


I have just added s7 scheme to a C++ project on Android, and I ran into a
couple of issues that I would like to post in case anyone else runs into

1 - android doesn't seem to support the log2 function.  Easy fix:  fx =

2 - It seems that arm based architectures have issues with aligned access.
I discovered this when calling s7_init to create a second scheme vm.  The
fix for this is to simply add __ANDROID__ to the __bfin__ check.

here is the diff of the changes for s7.c:

< #if (__bfin__)
> #if (__bfin__ || __ANDROID__)
> #if (__ANDROID__)
>           fx = log((double)ix)/log(2.0);
> #else
> #endif

Are there any other spots in s7 where unaligned access may occur?  They are
rather difficult to debug.

Jason Ripley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ccrma-mail.stanford.edu/mailman/private/cmdist/attachments/20130503/12651c85/attachment.html 

More information about the Cmdist mailing list