Is this what you're looking for?
EDIT:
[REMOVED]
EDIT 2:
Looks like this was already discussed here.
EDIT 3:
Disregard the above. You don't need to implement it yourself, it exists here. You just need to import simd.
simd