Skip to content

[WebAssembly] Fix inline assembly with vector types #146574

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions llvm/lib/Target/WebAssembly/WebAssemblyRegisterInfo.td
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ def I32 : WebAssemblyRegClass<[i32], 32, (add FP32, SP32, I32_0)>;
def I64 : WebAssemblyRegClass<[i64], 64, (add FP64, SP64, I64_0)>;
def F32 : WebAssemblyRegClass<[f32], 32, (add F32_0)>;
def F64 : WebAssemblyRegClass<[f64], 64, (add F64_0)>;
def V128 : WebAssemblyRegClass<[v8f16, v4f32, v2f64, v2i64, v4i32, v16i8,
v8i16],
def V128 : WebAssemblyRegClass<[v2i64, v4i32, v16i8, v8i16,
v8f16, v4f32, v2f64],
128, (add V128_0)>;
def FUNCREF : WebAssemblyRegClass<[funcref], 0, (add FUNCREF_0)>;
def EXTERNREF : WebAssemblyRegClass<[externref], 0, (add EXTERNREF_0)>;
Expand Down
11 changes: 11 additions & 0 deletions llvm/test/CodeGen/WebAssembly/inline-asm.ll
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,18 @@ entry:
ret i32 %ret
}

; CHECK-LABEL: v128_load
; CHECK: local.get 0
; CHECK-NEXT: v128.load 0
; CHECK-NEXT: local.set 1
define <4 x i32> @v128_load(ptr %v) #1 {
entry:
%0 = tail call <4 x i32> asm "local.get $1\0Av128.load 0\0Alocal.set $0", "=r,r"(ptr %v)
ret <4 x i32> %0
}

attributes #0 = { nounwind }
attributes #1 = { "target-features"="+simd128" }

!0 = !{i32 47}
!1 = !{i32 145}
Expand Down
Loading