Crystal: Multiple output values in asm

Created on 30 Jan 2018  路  1Comment  路  Source: crystal-lang/crystal

rdtsc instruction output eax, and edx, but seems like current asm.cr only support one output value.
Is there any way to fix that or workaround to output multiple values in asm?

help-wanted feature compiler

Most helpful comment

It seems LLVM and Rust now support multiple operands, so this is a valid feature request.

This affects:

  • The parser (it will need to parse more than one output operand)
  • The semantic phase (in MainVisitor)
  • The codegen
  • The formatter
  • Asm#to_s in ToSVisitor

I don't think it's hard to implement, one just has to see how that part is currently done and allow for multiple outputs instead of just one.

If someone wants to tackle this, let us know and I can assign them.

>All comments

It seems LLVM and Rust now support multiple operands, so this is a valid feature request.

This affects:

  • The parser (it will need to parse more than one output operand)
  • The semantic phase (in MainVisitor)
  • The codegen
  • The formatter
  • Asm#to_s in ToSVisitor

I don't think it's hard to implement, one just has to see how that part is currently done and allow for multiple outputs instead of just one.

If someone wants to tackle this, let us know and I can assign them.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

asterite picture asterite  路  71Comments

asterite picture asterite  路  70Comments

malte-v picture malte-v  路  77Comments

asterite picture asterite  路  139Comments

stugol picture stugol  路  70Comments