SSE2 Intrinsic usage with Visual Studio

Hi.
For a project I have to load and store data to/from XMM registers.
Loading and operating on the data works perfectly, but every time I try
to store the data from the register to memory I get a message: "Access
violation reading location 0x0000000000000000."

I think I just made a little mistacke by writting the code, but I really
don't accomplish to fix the problem.

Advertisements

Jonathan Mcdougall schrieb:
> Hipo wrote:
>> Hi.
>> For a project I have to load and store data to/from XMM registers.
>
> This newsgroup deals with the C++ language itself, not all its possible
> uses. See
> http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.9 for some
> newsgroup where you could ask your question (make sure to also read
> their charter!)
>
>
> Jonathan
>

Hipo wrote:
> Hi.
> For a project I have to load and store data to/from XMM registers.
> Loading and operating on the data works perfectly, but every time I try
> to store the data from the register to memory I get a message: "Access
> violation reading location 0x0000000000000000."
>
> I think I just made a little mistacke by writting the code, but I really
> don't accomplish to fix the problem.
>
> Here would be my simplified code:
>
> __m128i xmm0 = _mm_load_si128((__m128i*)input);
> _mm_storeu_si128((__m128i*)input, xmm0);
>
> Can anyone give me an hint where my problem could be located?

Hipo wrote:
> Hi.
> For a project I have to load and store data to/from XMM registers.
> Loading and operating on the data works perfectly, but every time I try
> to store the data from the register to memory I get a message: "Access
> violation reading location 0x0000000000000000."
>
> I think I just made a little mistacke by writting the code, but I really
> don't accomplish to fix the problem.
>
> Here would be my simplified code:
>
> __m128i xmm0 = _mm_load_si128((__m128i*)input);
> _mm_storeu_si128((__m128i*)input, xmm0);
>
> Can anyone give me an hint where my problem could be located?

I implemented a bitset class in my chess engine using sse2. You can
download it at sourceforge called xiangqi-engine and the actual
download itself is junfa. I don't know what your problem is but you
can see how I did it there.

Gianni Mariani schrieb:
> Hipo wrote:
>> Hi.
>> For a project I have to load and store data to/from XMM registers.
>> Loading and operating on the data works perfectly, but every time I
>> try to store the data from the register to memory I get a message:
>> "Access violation reading location 0x0000000000000000."
>>
>> I think I just made a little mistacke by writting the code, but I
>> really don't accomplish to fix the problem.
>>
>> Here would be my simplified code:
>>
>> __m128i xmm0 = _mm_load_si128((__m128i*)input);
>> _mm_storeu_si128((__m128i*)input, xmm0);
>>
>> Can anyone give me an hint where my problem could be located?
>
> This is off-topic for this NG.
>
> The hint for you is memory alignment.

I do not understand how alignment lead to an error at writing the
content of a register to memory. It's just about bit sequenzes, which
are independent to each other, so there is no interpretation of data or
something else.
Or do I suffer from an elemental mistake ?

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!