Is it possible to add optimized assembly file into *.c file as a inline assembly? -


i generate test.s file using gcc -s -o3 test.c. there quick sort code in test.c. possible add assembly code of quick sort of test.s test.c file again instead of original quick sort c code?

almost certainly. if have compiler capable of using inline assembly (it's not mandated standard, rather it's extension), can inject whatever code wish.

my question "why?". if compiler generates optimised code in first place, let job. in other words, compile code high optimisation.

that way, if things change (better compiler, new architecture, etc), code auto-magically improve next time compile, that's not going happen if tell use specific assembly instructions.

if, reason, don't want all code @ high optimisation, can split sort code in own file , use different flags one. there's still no reason why have assembly.

if want it, should (relatively) simple matter of mapping .s file correct inline assembly format.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -