flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
sakeniwefu
FASM optimizes for opcode size automagically. The code will always be the smallest possible. In fact, that could cause you problems if you are trying to do alignation using opcode size. Other than that it is all up to you. Of course, if you learn fasm syntax and macros that will help you implement your compiler optimizations more easily.
|
|||
![]() |
|
jorge
thank sakeniwefu, I have another question.FASM have a 'proc' macro. Do you know if FASM do some Interprocedural Optimization or inline procedures.If not, if you know some tecnique,important reference or serious literature please help me with that.In general tell me if you know the theme of Compiler Optimization and how can you help me with that.
|
|||
![]() |
|
sakeniwefu
About macros, you should read the manual and specific macros' code. You can also ask in the macro forum.
About code: TRY THIS(I recently rediscovered it and solved all my doubts about modern CPU optimization). |
|||
![]() |
|
revolution
jorge wrote: thank sakeniwefu, I have another question.FASM have a 'proc' macro. Do you know if FASM do some Interprocedural Optimization or inline procedures.If not, if you know some tecnique,important reference or serious literature please help me with that.In general tell me if you know the theme of Compiler Optimization and how can you help me with that. So what does it optimise: 1) jmp and jcc use the two byte form where possible. 2) immediate values use the signed byte form where possible and the zero byte form for zero values. 3) no spurious generation of nops in the code stream, like some older assemblers would do. 4) optimal PE header size based upon the number of sections. 5) probably a few more things that are generally based upon single instructions or output file shrinking. |
|||
![]() |
|
vid
Quote: The code will always be the smallest possible This is not true, this would require "exhaustive search" of all possibilities. FASM just tends to create small code, but doesn't always produce smallest possible code. |
|||
![]() |
|
sakeniwefu
For a single instruction it generates the shortest equivalent opcode, or have I got it wrong?
|
|||
![]() |
|
vid
Well, for single instruction input it does. But it doesn't always find shortest possible solution for some complex cases
|
|||
![]() |
|
revolution
sakeniwefu wrote: For a single instruction it generates the shortest equivalent opcode, or have I got it wrong? |
|||
![]() |
|
bitRAKE
revolution wrote: So what does it optimise: 1) jmp and jcc use the two byte form where possible. 2) immediate values use the signed byte form where possible and the zero byte form for zero values. 3) no spurious generation of nops in the code stream, like some older assemblers would do. 4) optimal PE header size based upon the number of sections. 5) probably a few more things that are generally based upon single instructions or output file shrinking. |
|||
![]() |
|
jorge
Can any body help me with the theme of Compiler Optimization in the sense of the code that this compiler take as front-end, not only the optimizations of the intruccions that it give as back-end. If any body can tell me any literature that can help me I'm would be very pleasure. sakeniwefu I'm very happy with your help, thank for all.
|
|||
![]() |
|
f0dder
Here's a few:
The Compiler Design Handbook: Optimizations and Machine Code Generation Compilers: Principles, Techniques, and Tools Modern Compiler Design EDIT: sanitized links. |
|||
![]() |
|
bitRAKE
Google Scholar is pretty good.
CiteSeerX (alpha) Modern compilers generate an intermediate code (between front and back end) and then most optimization algorithms are applied to this middle code. Reason being that the front end language becomes more flexible (even multiple languages). |
|||
![]() |
|
f0dder
Oh, and be sure to throw this one into the mix: http://llvm.org/
|
|||
![]() |
|
jorge
Thank for your help(f0dder,bitRAKE) but the my problem is more dificult than download those books or paper, I'm cuban student and if some of you know the situacion of my country you will know that is imposible for me to pay those excellent books, I implement all about parising and chek semantic, also I implement a program generator that generate the fasm code, of any program that is ok with the gramar and semantic of my language, but the most important fase of my thesis is the theme of optimization and I'm a baby with that theme, only I know the basic element. You know my real problem, again if any body can help me, tell me how
|
|||
![]() |
|
bitRAKE
There is a lot of active research in the area of optimization - no need to buy books on the topic. Through Google Scholar I'm often able to find costly IEEE papers availible from the author for free. I've read some about the topic, but do not understand completely.
At the highly abstract level optimizations are transformations to compact a DAG representation of the program. Graph nodes expand with more detail, and contracts through different phases of optimization. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.