# [cfe-dev] Clang assembler missed features

Roberto E. Vargas Caballero via cfe-dev cfe-dev at lists.llvm.org
Wed Apr 18 01:34:18 PDT 2018

```Hello,

> Although I can't speak for the whole community, my predictions:
> - .func and .endfunc are unlikely as this is documented only to do
> something when the stabs debugging is enabled and clang is unlikely to
> support stabs. See https://sourceforge.net/p/libjpeg-turbo/bugs/72/

Ok, it seems that we actually don't need them. One problem less.

> - Subtraction of relative labels is unlikely in a .if statement. MC
> can produce absolute values for relative labels in some cases but it
> requires a layout. Instruction relaxation, such as turning a 16-bit
> Thumb branch into a 32-bit Thumb 2 branch if the distance requires it,
> means that the distance between 2 labels isn't known until the layout
> finalises. For .if the expression evaluation needs to occur before
> relaxation as the result of the .if could affect relaxation. In theory
> it could be possible to alter the assembler to calculate part of the
> layout inline and handle some expressions, but I don't think that the
> disruption to the implementation would be worth it.

I understand the problem. We use these .if to verify some conditions
related to the size of some parts of the code:

.macro check_vector_size since
.if (. - \since) > (32*4))
error "Vector exceeds 32 instructions"
.endif

I suppose GNU As does some strange thing with .if to avoid the problem
(some delayed evaluation?).

Other thing that I didn't commented in the previous mail is related to
preprocesed assembler files, where consecutive strings are not dealt as
one string, as it is mandatory in C/C++ and GNU as does. This is not a
big problem for us, because we can change the code where we use that.