How to build ARM assembler code? RRS feed

  • Question

  • Hello!

    I have many files with ARM assembler code which is writed in GNU assembler. Is there any way to convert it to armasm compatible format?

    Code example:

    #define COL_SHIFT 20
    function idct_col4_st16_neon
            mov             ip,  #16
            vshr.s16        q1,  q1,  #COL_SHIFT-16
            vshr.s16        q2,  q2,  #COL_SHIFT-16
            vst1.64         {d2}, [r2,:64], ip
            vshr.s16        q3,  q3,  #COL_SHIFT-16
            vst1.64         {d3}, [r2,:64], ip
            vshr.s16        q4,  q4,  #COL_SHIFT-16
            vst1.64         {d4}, [r2,:64], ip
            vst1.64         {d5}, [r2,:64], ip
            vst1.64         {d6}, [r2,:64], ip
            vst1.64         {d7}, [r2,:64], ip
            vst1.64         {d8}, [r2,:64], ip
            vst1.64         {d9}, [r2,:64], ip
            bx              lr

    Monday, March 24, 2014 12:10 PM


  • The recommendation is to rewrite such functions using C ARM-NEON intrinsics which would allow you to use inlining and be much more robust overall.

    You should be able to get "Thumb-2" ARM assembly written using the 'universal syntax' to build with armasm, which is not the GNU assembler syntax.

    Note: Much like Windows x64 native code, you have to use specific patterns for leaf vs. non-leaf functions to have properly formed ARM assembly for Windows RT with the proper ABI which are required to include full unwinding information recorded as data as part of all generated code. With VS 2012 / Windows 8.0 SDKs, the files needed to build properly formed ARM assembly for Windows RT were not available. With the Windows Driver Kit 8.1, you do have the required files: ksarm.h, kxarm.h, kxarmunw.h

    Monday, March 24, 2014 6:39 PM