Skip to content

Fix operand types in aarch64 inline asm#8

Merged
guillerodriguez merged 1 commit intomasterfrom
fix/aarch64-asm-operand-widths-warnings
Feb 9, 2026
Merged

Fix operand types in aarch64 inline asm#8
guillerodriguez merged 1 commit intomasterfrom
fix/aarch64-asm-operand-widths-warnings

Conversation

@guillerodriguez
Copy link
Copy Markdown
Contributor

In some cases, aarch64 inline asm operands used 32-bit types where 64-bit registers were required. While both clang and GCC generate correct code regardless, the operand types should match the register sizes for correctness and to silence clang -Wasm-operand-widths warnings.

  • COMPARE_AND_SWAP_64: change read_val from int to uintptr_t, cast old_val/new_val to uintptr_t (64-bit registers)
  • LOCKWORD_WRITE: cast value to uintptr_t (64-bit register)
  • initialisePlatform (linux/aarch64): change cache_type from unsigned int to unsigned long, as mrs always writes a 64-bit register

In some cases, aarch64 inline asm operands used 32-bit types
where 64-bit registers were required. While both clang and GCC
generate correct code regardless, the operand types should
match the register sizes for correctness and to silence clang
-Wasm-operand-widths warnings.

- COMPARE_AND_SWAP_64: change read_val from int to uintptr_t,
  cast old_val/new_val to uintptr_t (64-bit registers)
- LOCKWORD_WRITE: cast value to uintptr_t (64-bit register)
- initialisePlatform (linux/aarch64): change cache_type from
  unsigned int to unsigned long, as mrs always writes a 64-bit
  register

Signed-off-by: Guillermo Rodríguez <grodriguez@ingelabs.com>
@guillerodriguez guillerodriguez merged commit 69e246b into master Feb 9, 2026
3 checks passed
@guillerodriguez guillerodriguez deleted the fix/aarch64-asm-operand-widths-warnings branch February 9, 2026 09:00
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.

2 participants