__m128i的理解[轉]

來源:互聯網
上載者:User

標籤:des   blog   http   io   ar   sp   div   on   art   

__m128i被稱為128bits的整數,當我們對其賦值時,調用

__m128i _mm_set1_epi32(int i)

Sets the four signed 32-bit integer values to i.

R0

R1

R2

R3

i

i

i

i


則會有上面的效果,__m128i類型的值會被分為4部分,且這裡這四部分都是相同的值,為什麼是四部分呢?
由   epi32  =="every partion‘s bits is 32"可以得到,   128/32=4;
 

這裡可以將它視為一個奇葩的整數,看起來像數組,可是卻不能像數組那樣調用,直接定義

__m128i nums;

這裡的nums需要把它看成一個整數,不能直接調用,只有重新定義一個

int32_t  *p = (int *) &nums;
cout<<p[0]<<endl;

這樣子就可以拿出裡面的值了。呼呼~~

 

reference:

http://caidongrong.blog.163.com/blog/static/21424025220133282132973/

 

__m128i的理解[轉]

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.