Skip to content

fix(frontend): preserve typed expression assembly results in HIR - #1088

Open
hiyouwhatsapp wants to merge 2 commits into
wavefnd:masterfrom
hiyouwhatsapp:fix/typed-expression-asm-results-1081
Open

hiyouwhatsapp wants to merge 2 commits into
wavefnd:masterfrom
hiyouwhatsapp:fix/typed-expression-asm-results-1081

Conversation

@hiyouwhatsapp

Copy link
Copy Markdown
Contributor

Fixes #1081

Expression-form inline assembly previously validated to Unknown even when its single output had a concrete scalar type, allowing incompatible initializers to pass checking and reach missing-conversion errors in LLVM

I now preserve the validated output type in semantic HIR so the existing ordered conversion planner handles implicit widening, integer-to-float conversions, explicit casts, arithmetic and returns without inventing conversions in the backend

Expression assembly with multiple outputs or a non-scalar result is rejected during semantic analysis, and a value context cannot consume an assembly expression with no output

Added frontend and HIR regression tests for signed widening, float conversion, explicit bool casts, arithmetic, return conversions, and incompatible value contexts

Added target-gated x86_64 check, LLVM IR/object, native O0/O2 execution and source-diagnostic regressions

The existing statement assembly path and its output constraints are unchanged

The Rust test suite has not been run locally, so CI still needs to verify this change

Infer the result from the validated single output rather than treating inline assembly as unknown, allowing existing ordered numeric conversions for assignments, returns and casts

Reject unsupported value contexts and add semantic, HIR and codegen regressions

Signed-off-by: hiyouwhatsapp <89997383+hiyouwhatsapp@users.noreply.github.com>
…ame assumptions

Exercise return conversions in a non-entry function and check unoptimized casts while validating optimized assembly call emission

Signed-off-by: hiyouwhatsapp <89997383+hiyouwhatsapp@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

Preserve expression assembly result types when recording HIR conversions

1 participant