[patch] Enhance of asm macros

Hello llvm users!

I make patch of asm parser for make it to be closer to gas:

  1. treat space as comma of parameters
  2. support “req” & “vararg” atttributes
  3. macro calls with with explicit named arguments

Path attached. Can anybody review it?

asm-macro-ext.patch (23 KB)

Hello Vladimir,

While this is great for platforms that use the current gas style assembler macros your patch also changes the existing support for darwin that does not use these style of assembler macros. Could you please update your patch that leaves the assembler macros unchanged for darwin. Then we can review the updated patch.

Thanks,
Kev

Hello Kevin,

I thinking about this, but there are some problems:

  1. Differrent interpretation of $[:number:] in macro body:
    source:
    .macro test par1
    movl $0, %eax
    .endm

test %ebx

translated to:
original llvm => movl %ebx, %eax
with patch => movl $0, %ebx

  1. Different parsing of space in macro parameters:
    source:

test2 a + b,c

parsed as:
original llvm => macro test2 with two arguments ‘a+b’,‘c’
with patch => macro test2 with three arguments ‘a’,‘+’,‘b,c’

For compability this problems requiring some compiler switch flag. Can you give me description/example how it’s can be done?

Thanks for response.

2012/2/9 Kevin Enderby <enderby@apple.com>

Hello Vladimir,

While this is great for platforms that use the current gas style assembler macros your patch also changes the existing support for darwin that does not use these style of assembler macros. Could you please update your patch that leaves the assembler macros unchanged for darwin. Then we can review the updated patch.

Thanks,
Kev

Hello llvm users!

I make patch of asm parser for make it to be closer to gas:

  1. treat space as comma of parameters
  2. support “req” & “vararg” atttributes
  3. macro calls with with explicit named arguments

Path attached. Can anybody review it?

<asm-macro-ext.patch>_______________________________________________
LLVM Developers mailing list
LLVMdev@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

For compability this problems requiring some compiler switch flag. Can you
give me description/example how it's can be done?

grep for DwarfRequiresRelocationForSectionOffset. Something like that
might do what you want.

Cheers,
Rafael

Hi llvm users & developers!

Attached patches:

  1. rewrite previous patch, now for darwin platform applied old mechanism
  2. patch added processing .rept directive
  3. patch added processing .irp directive
  4. patch added processing .irpc directive

1.macro-enh.patch (27 KB)

2.rept-directive.patch (3.57 KB)

3.irp-directive.patch (4.83 KB)

4.irpc-directive.patch (4.91 KB)

Sorry I dropped this :frowning:

I just reviewed and committed number 2. I will try to do at least one
more today.

Cheers,
Rafael