473,395 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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.

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?

bye, Hipo
May 17 '06 #1
6 5158
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-lit...t.html#faq-5.9 for some
newsgroup where you could ask your question (make sure to also read
their charter!)
Jonathan

May 17 '06 #2
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-lit...t.html#faq-5.9 for some
newsgroup where you could ask your question (make sure to also read
their charter!)
Jonathan


Thanks for the immediate reply containing the link.

bye, Hipo.
May 17 '06 #3
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.
May 17 '06 #4

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.

May 17 '06 #5
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 ?

bye, Hipo
May 17 '06 #6
Hipo wrote:
....
Or do I suffer from an elemental mistake ?


yes. It's a requirement of the CPU that addresses be aligned for
certain types of instructions.

Another hint may be that "input" is pointing to a page that is read only.

A compilable chunk-o-code that demonstrates the problem would be good.

G
May 17 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: MLH | last post by:
I make API calls to the sndPlaySound function, something like this... XX% = sndPlaySound(msound, MyParm) Several predefined system constants (or API intrinsic constants) have been recommended...
26
by: Bruno Jouhier [MVP] | last post by:
I'm currently experiencing a strange phenomenon: At my Office, Visual Studio takes a very long time to compile our solution (more than 1 minute for the first project). At home, Visual Studio...
8
by: Greg Merideth | last post by:
I've written a basic windows service to provide some helper xml functions for my web methods and even thou the service is only about 1k lines long with 1 timer, its mem usage is 10m and its vm mem...
4
by: Andrew Ward | last post by:
Hi All, I was wondering if it is possible to use precompiled headers without having to include a <stdafx.h> or whatever in every source file. My problem is that I have a project that makes heavy...
0
by: Yusuf Motiwala | last post by:
Hi, Has anyone evaluated Visual Studio 2003 SSE/SSE2 code generation in terms of performance. As per Microsoft documentation, SSE/SSE2 is only used in VS.Net 2003 for some floating point...
3
by: George M. Garner Jr. | last post by:
Is there an intrinsic to wrap the bswap x86 instruction. I have written a function to do this with inline assembler but I am wondering if an intrinsic wouldn't be a better solution. Regards, ...
0
by: Khouri Giordano | last post by:
I have two problems. Both of them only happen with /O2. First I have some code that uses the _mm_cvtsi32_si128 intrinsic. There are two of them close together. I can see that one translates into:...
1
by: prem | last post by:
Hi , Any one please give me the Usage with example for AutoEventWireUp PageDirective. Regards, Prem.
2
by: CJ Taylor | last post by:
My Visual Studio Memory Usage keeps growing and never seems to go down... I dispose everything properly.. but everytime I run the program I'm writing it grows by like 100 meg... Any ideas? -CJ
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.