wrong program output when running on different systems

wrong program output when running on different systems

Hi, I was testing code on my laptop a 32bit Duo core system and when i ran the same code on a 64bit system Duo core2
the program runs but it gives me wrong program output.When i trace thru the code i found that when the image im suppose to process hits the block with assembly code in it the processed image becomes blank i verified it with the same code running on my laptop the output is totally different. It works on a duo core system but on the 64bit duo core2 it doesnt work why is this so?

Im compiling my code on a 32 bit duo core system, running on ubuntu 7.10. The C++ code consists of
SIMD, inline assembly and SSE2 instructions.

What i found in intel website
http://www.intel.com/support/performancetools/c/sb/CS-007710.htm
Intel C++ Compiler

Is inline assembly supported?

Inline assembly is only supported by theIA-32
and Intel 64 C++ compilers (icc and icpc). GNU gas* and Microsoft
MASM* formats are available. There is no support for inline assembly on
the IA-64 architecture.

Does this mean code with inline assembly cannot run on 64bit systems?

Anyone has any idea what happened?

theres also this which i found in the documents for duo 2 processors What does the below mean when they talk about TLBS does it affect the way programs work?

Clarification of TRANSLATION LOOKASIDE BUFFERS (TLBS)
Invalidation
Section 10.9 INVALIDATING THE TRANSLATION LOOKASIDE BUFFERS (TLBS) of the
Intel 64 and IA-32 Architecture Software Developers Manual, Volume 3A: System
Programming Guide will be modified to include the presence of page table structure
caches, such as the page directory cache, which Intel processors implement. This
information is needed to aid operating systems in managing page table structure
invalidations properly.
Intel will update the Intel 64 and IA-32 Architecture Software Developers Manual,
Volume 3A: System Programming Guide in the coming months. Until that time, an
application note, TLBs, Paging-Structure Caches, and Their Invalidation
(http://www.intel.com/products/processor/manuals/index.htm) is available which
provides more information on the paging structure caches and TLB invalidation.
In rare instances, improper TLB invalidation may result in unpredictable system
behavior, such as system hangs or incorrect data. Developers of operating systems
should take this documentation into account when designing TLB invalidation
algorithms. For the processors affected, Intel has provided a recommended update to
system and BIOS vendors to incorporate into their BIOS to resolve this issue.

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

The compiler doesn't check inline assembly code, or attempt to correct cases where 32-bit assembly code may be incompatible in a 64-bit build. This is one of the primary reasons for the recommendation to use intrinsics such as those in . You are entitled to install the 32-bit icc along with the 64-bit one, and make a 32-bit build, in case you want to continue using 32-bit in-line assembly code.
The lack of support for inline assembly for Itanium reinforces the idea that inline assembly isn't portable, but doesn't prevent you from using it under the x86-64 OS.
I don't see how your comment about TLB is relevant; no one can support BIOS development on this forum.

Hi Tim thanks for your reply
I would like to clarify that im not commenting about TLB im asking if it would cause a problem that's all.
I didnt write the code im using, someone else did and i have no way of contacting the person and i have no experience in assembly. Do bear with my ignorance i only want to try to make the code work that's all.

I didnt know 32bit and 64bit have differing instructions. Do you know of any site or document that highlights the differences? Thank you for telling me that.

Evenwhere the instructions are the same, you will almost certainly run into issues with 64-bit register names. You might start by comparing 32- and64-bitcompiler generated code. I haven't tried to do this change at inline asm level, except for the rdtsc, so I don't want to try to explain further.

As a general rule, hand optimized inline asm for some past 32-bit CPU doesn't run as well as C code for a current 64-bit CPU, further reinforcing the recommendations about avoiding it.

Leave a Comment

Please sign in to add a comment. Not a member? Join today