# @Vector abuse?

**URL:** <https://ziggit.dev/t/vector-abuse/17854>\
**Category:** Help\
**Tags:** language\
**Created:** [October 5, 2026, 3:39pm UTC](https://ziggit.dev/t/vector-abuse/17854 "2026-10-05T15:39:33Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Plebosaur](https://ziggit.dev/user_avatar/ziggit.dev/plebosaur/32/6857_2.png) [@Plebosaur](https://ziggit.dev/u/Plebosaur)\
**Post date:** [October 5, 2026, 4:04pm UTC](https://ziggit.dev/t/vector-abuse/17854/3 "2026-10-05T16:04:17Z")

</div>

I had a similiar issue, but after learning about vector - array coercion I think it makes more sense the way they have it than what I did originally, here’s a migration guide, just store [N]T instead of @Vector(N, T) and use coercion when you want to do anything with SIMD.

```zig
// Before
fn foo(vec: [*]@Vector(8, u32)) void {
     const v: @Vector(8, u32) = vec[42];
     doSomething(v);
}

// After
fn foo(vec: [*][8]u32) void {
     const v: @Vector(8, u32) = vec[42];
     doSomething(v);
}

```

I checked the assembly in my project, the only difference is that LLVM will use  
vmovdqu instead of vmovdqa, which is basically the same command but with different layout assumptions. AFAIK that’s the same performance.  
If you want to force the vmovdqa then you can just use `[*]align(vectorAlignment)[8]u32`  
[Compiler explorer example](https://godbolt.org/#g:!((g:!((g:!((h:codeEditor,i:(filename:'1',fontScale:14,fontUsePx:'0',j:1,lang:zig,selection:(endColumn:2,endLineNumber:10,positionColumn:2,positionLineNumber:10,selectionStartColumn:2,selectionStartLineNumber:10,startColumn:2,startLineNumber:10),source:'//+Type+your+code+here,+or+load+an+example.%0Aexport+fn+foo(vecs:+%5B*%5D@Vector(8,+u32))+void+%7B%0A++++const+v:+@Vector(8,+u32)+%3D+vecs%5B42%5D%3B%0A++++vecs%5B42%5D+%3D+v+*+@as(@Vector(8,+u32),+@splat(2))%3B%0A%7D%0A%0Aexport+fn+foo2(vecs:+%5B*%5D%5B8%5Du32)+void+%7B%0A++++const+v:+@Vector(8,+u32)+%3D+vecs%5B42%5D%3B%0A++++vecs%5B42%5D+%3D+v+*+@as(@Vector(8,+u32),+@splat(2))%3B%0A%7D%0A%0Aconst+vecalign+%3D+@alignOf(@Vector(8,+u32))%3B%0A%0Aexport+fn+foo3(vecs:+%5B*%5Dalign+(vecalign)+%5B8%5Du32+)+void+%7B%0A++++const+v:+@Vector(8,+u32)+%3D+vecs%5B42%5D%3B%0A++++vecs%5B42%5D+%3D+v+*+@as(@Vector(8,+u32),+@splat(2))%3B%0A%7D'),l:'5',n:'0',o:'Zig+source+%231',t:'0')),k:51.626124324740985,l:'4',m:100,n:'0',o:'',s:0,t:'0'),(g:!((h:compiler,i:(compiler:z0160,filters:(b:'1',binary:'1',binaryObject:'1',commentOnly:'0',debugCalls:'1',demangle:'0',directives:'0',execute:'1',intel:'0',libraryCode:'0',trim:'1',verboseDemangling:'0'),flagsViewOpen:'1',fontScale:14,fontUsePx:'0',j:1,lang:zig,libs:!(),options:'-O+ReleaseFast+-fno-strip',overrides:!(),selection:(endColumn:1,endLineNumber:1,positionColumn:1,positionLineNumber:1,selectionStartColumn:1,selectionStartLineNumber:1,startColumn:1,startLineNumber:1),source:1),l:'5',n:'0',o:'+zig+0.16.0+(Editor+%231)',t:'0')),header:(),k:48.373875675259015,l:'4',m:100,n:'0',o:'',s:0,t:'0')),l:'2',n:'0',o:'',t:'0')),version:4)

Edit: TLDR - store your data in arrays instead of vectors and pretend they are vectors using coercion.

---

_[View the full topic](https://ziggit.dev/t/vector-abuse/17854)._
