Skip to content

parser: fix asm modifier parse#25072

Merged
spytheman merged 2 commits into
vlang:masterfrom
kbkpbot:fix-asm-modifier-parse
Aug 9, 2025
Merged

parser: fix asm modifier parse#25072
spytheman merged 2 commits into
vlang:masterfrom
kbkpbot:fix-asm-modifier-parse

Conversation

@kbkpbot

@kbkpbot kbkpbot commented Aug 9, 2025

Copy link
Copy Markdown
Contributor

Fix issue #25070

Output constrains: =r, =&r, +r, +&r,=m,=rm,=@ccl, =*r
Input constrains: r, 0, rm, i, %r, *m

@kbkpbot kbkpbot linked an issue Aug 9, 2025 that may be closed by this pull request
@huly-for-github

Copy link
Copy Markdown

Connected to Huly®: V_0.6-23587

mulq y
mov lo, rax
mov hi, rdx
; =*m (lo)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, that does not work with my local tcc 🤔:
./v -cc tcc -no-retry-compilation vlib/v/slow_tests/assembly/asm_test.amd64.v

@spytheman spytheman Aug 9, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

=== C compilation error (from /home/delian/v/thirdparty/tcc/tcc.exe): 
cc: /tmp/v_1000/asm_test.amd64.01K26VFD0GKTC5S097ADB5HCSA.tmp.c:8644: 
  error: unknown constraint '*'
=====================================================================

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you intend to add asm blocks for commonly used modules like math.bits or strconv, please use syntax that tcc can also process, otherwise it will make bootstrapping more difficult, and compilation for many programs a lot slower, due to the retrying and falling back to slower compilers like clang/gcc.

@spytheman spytheman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work.

@spytheman spytheman merged commit 5eebd91 into vlang:master Aug 9, 2025
82 checks passed
@kbkpbot kbkpbot deleted the fix-asm-modifier-parse branch August 9, 2025 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

can't parse some asm constraint in inline assembly

2 participants