You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Analyse GCC extended asm and generate errors for an invalid code, also change some .
Motivation
Asm stategment does not allow you to write correct code (in some cases), so you have to resort to tricks
Description
It must be implemented when NIR will more complete.
Code Examples
proctest(a: int64) =asm""" add %[val], %[a] :[a]"=r"(`a`) :[val]"r"((long long)(4/2))"""var a: int64=35test(a)
echo a
# This code compiles (although it shouldn't because it tries to change a parameter)
proctest(a: varint64) =asm""" add %[val], %[a] :[a]"=r"(`a`) :[val]"r"((long long)(4/2))"""var a: int64=35test(a)
echo a
# Code compiles again, but again it doesn't change a (for C through GCC), or when# compiling in C++ through GCC, `a` becomes random number.
It will possible to support via analysis.
Backwards Compatibility
No response
The text was updated successfully, but these errors were encountered:
I think it's less error-prone for users to use a DSL for inline assembly.
Not to say that analysis isn't worthwhile, but it doesn't solve the problem that inline ASM is painful to write even if we're aware of the whole syntax.
GCC and Clang inline assembly even differ for memory operands.
Abstract
Analyse GCC extended asm and generate errors for an invalid code, also change some .
Motivation
Asm stategment does not allow you to write correct code (in some cases), so you have to resort to tricks
Description
It must be implemented when NIR will more complete.
Code Examples
It will possible to support via analysis.
Backwards Compatibility
No response
The text was updated successfully, but these errors were encountered: