Skip to content

Fix vector type lowering - #2428

Closed
zerkawei wants to merge 1 commit into
beefytech:masterfrom
zerkawei:fix-vector-type-lowering
Closed

zerkawei wants to merge 1 commit into
beefytech:masterfrom
zerkawei:fix-vector-type-lowering

Conversation

@zerkawei

@zerkawei zerkawei commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

This PR fixes #2427 by adding lowered types for the vector types defined in Numerics. I don't know if this is the right approach but it seems to work in my testing.

@zerkawei

zerkawei commented Apr 3, 2026

Copy link
Copy Markdown
Contributor Author

I think there may be a bigger or at least different change to SIMD types and intrinsics that is needed. When trying to compute sqrt for a float4 with SIMD, you can either :

  • use SSE.sqrt_ps. Fails with :
undefined reference to 'bf::System::Numerics::X86::SSE::sqrt_ps(bf::System::Numerics::v128)'
  • extend float4 to add the sqrt intrinsic. Fails with :
Call parameter type does not match function signature!
  %mul = alloca <4 x float>, align 4
 <4 x float>  %21 = call <4 x float> @llvm.sqrt.v4f32(ptr %mul), !dbg !51

I'll close this PR as this fixes only part of the problem and does not address it properly.

@zerkawei zerkawei closed this Apr 3, 2026
@bfiete

bfiete commented Apr 3, 2026

Copy link
Copy Markdown
Collaborator

It's probably good to note here that I would probably SIMD support currently as "proof of concept". I believe that auto-vectorization should work about the same as in Clang, however.

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.

[Bug] Vector types incorrectly passed as ptr

2 participants