yuvi/gas-preprocessor

Does not work with pixman arm neon code

Opened this issue · 3 comments

I'm trying to get this working with pixman so I can compile it for iPhone. I'm getting errors when trying to compile all 3 of these files:
http://cgit.freedesktop.org/pixman/tree/pixman/pixman-arm-neon-asm.S
http://cgit.freedesktop.org/pixman/tree/pixman/pixman-arm-neon-asm-bilinear.S
http://cgit.freedesktop.org/pixman/tree/pixman/pixman-arm-simd-asm.S

For pixman-arm-neon-asm.S, I get this error: "Too many arguments to macro pixld_a at ./gas-preprocess.pl line 317, line 1128."

For pixman-arm-simd-asm.S I get:
pixman-arm-simd-asm.S:37Unknown pseudo-op: .altmacro
pixman-arm-simd-asm.S:150:FATA:Symbol fname already defined

And finally for pixman-arm-neon-asm-bilinear.S, I get these:
pixman-arm-neon-asm-bilinear.S:61:Unknown pseudo-op: .eabi_attribute
pixman-arm-neon-asm-bilinear.S:61:Rest of line ignored. 1st junk
character valued 49 (1).
pixman-arm-neon-asm-bilinear.S:62:Unknown pseudo-op: .eabi_attribute
pixman-arm-neon-asm-bilinear.S:62:Rest of line ignored. 1st junk
character valued 49 (1).
pixman-arm-neon-asm-bilinear.S:64:Unknown pseudo-op: .altmacro
pixman-arm-neon-asm-bilinear.S:629:Unknown pseudo-op: .error
pixman-arm-neon-asm-bilinear.S:629:Rest of line ignored. 1st junk
character valued 117 (u).
pixman-arm-neon-asm-bilinear.S:673:Can't relocate expression. Absolute
0 assumed.
pixman-arm-neon-asm-bilinear.S:677:bad instruction bilinear_process_last_pixel' pixman-arm-neon-asm-bilinear.S:686:Can't relocate expression. Absolute 0 assumed. pixman-arm-neon-asm-bilinear.S:688:bad instructionbilinear_process_two_pixels'
pixman-arm-neon-asm-bilinear.S:694:bad instruction
bilinear_process_pixblock_head' pixman-arm-neon-asm-bilinear.S:698:bad instruction bilinear_process_pixblock_tail_head'
pixman-arm-neon-asm-bilinear.S:702:bad instruction
bilinear_process_pixblock_tail' pixman-arm-neon-asm-bilinear.S:707:bad instructionbilinear_process_two_pixels'
pixman-arm-neon-asm-bilinear.S:711:bad instruction `bilinear_process_last_pixel'
pixman-arm-neon-asm-bilinear.S:628:FATAL:Symbol fname already defined.

All of these files compile just for using GCC for arm on other platforms (like Android). Could anyone suggest how to fix this tool, or suggest fixes to the source files to make them work with this tool?

Those files use .altmacro which is not supported by the preprocessor. Rewrite them to use the normal mode instead. They do not appear to need any of the features unique to altmacro mode.

ssvb commented

@mansr the altmacro mode is needed to provide the possibility to generate neon register names by evaluating arithmetic expressions. This feature is described in the altmacro section of "info as":

`Expression results as strings'
     You can write `%EXPR' to evaluate the expression EXPR and use the
     result as a string.

But indeed, this is already pushing the macro preprocessor of gas to its limits and just changing this pixman code to use JIT might be a better option.

I vaguely recall adding altmacro support for Libav, but perhaps it's incomplete.