将霓虹灯向量寄存器存储到内存

发布于 2025-02-06 19:36:10 字数 404 浏览 2 评论 0原文

这似乎是一个愚蠢的问题,但我无法为生活做出解决。

我有一个像缓冲区一样;

let result_buff: &[u8]

而且我有一些代码,例如

let anded_value: uint8x16_t = unsafe { vandq_u8(sa1, sa2) };

我只想将Vector寄存器的此结果复制到result_buff [x..16],可能是通过内在的?

基本上是16个字节,我需要制定语法将其复制到[u8]/vec< u8>中的特定位置。

This seems like a stupid question, but I can't for the life work out how to do it.

I have a buffer like;

let result_buff: &[u8]

and I have some code like

let anded_value: uint8x16_t = unsafe { vandq_u8(sa1, sa2) };

I just want to copy this result from the vector register to result_buff[x..16], probably via an intrinsic?

basically it's 16 bytes long and I need to work out the syntax to copy it to a particular position in the [u8] / Vec<u8>.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

泛滥成性 2025-02-13 19:36:10

只需使用内在

vst1q_u8(result_buff.as_mut_ptr(), anded_value);

Just use the intrinsic vst1q_u8:

vst1q_u8(result_buff.as_mut_ptr(), anded_value);
是伱的 2025-02-13 19:36:10

您可能会使它比实际更复杂;)

pub unsafe fn convert_to_array(d_in: uint8x16_t) -> [u8; 16]{
    transmute(d_in)
}

https://godbolt.org.org.org.org/z/6m94bh4pf <6m94bh4pf < /a>

You might be making it way more complicated than it actually is ;)

pub unsafe fn convert_to_array(d_in: uint8x16_t) -> [u8; 16]{
    transmute(d_in)
}

https://godbolt.org/z/6M94bh4Pf

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文