compiler

HLSL Compiler error?

float4x4 matInvViewProj; float4 GetPointPosition(float2 Tex0) { float4 PosImageSpace; PosImageSpace.xy = float2(Tex0*2-1); PosImageSpace.z = tex2D(DepthTextureSampler,Tex0).r; return mul(PosImageSpace,matInvViewProj); } That's a part of my pixelshader. Why is there a compiler error? I'm compiling it in ps_3_0. Without ...

Is this a bug in MS CL's global optimization (/Og)?

Hi guys, Here is a very simplified program which reproduces the issue I faced in the real application: #include "stdlib.h" typedef unsigned short int shft; struct xptr { int layer; void * addr; xptr() : layer(0), addr(NULL) {} xptr(int _layer, void *_addr) : layer(_layer), addr(_addr) {} xptr(const xptr& x) { la...

frame pointer omitting ? Any risk ?

I do always turn on this feature in my compilers, it helps a lot in debugging while reading through the assembly code which is more clean. I think it doesnt have a big impact on speed optimization side, giving CPUs ability to pipelining, but at least it does open a new opportunity for register allocation, as such, gaining a new free regi...

Where did the text segment get its name?

Traditional assembler, and higher level compilers work with several memory segments, according to intended use. Hence, there is a data segment, a stack segment, a bss, and text segment. The text segment is also called the code segment. Text segment? For machine code? I have asked all the old-timers I could find, how something as unr...

How to set Eclipse compiler level to 1.1

Hi I use Eclipse 3.4 Ganymade which uses JRE 1.4/1.5 alternatively. Now I have to use JDK1.1 for one of my application. As far as I know Eclipse uses JRE1.3 as the default level of compiler. Is there any way to work with JRE1.1. I had installed both JDK 1.1 and 1.4 as well. ...

Does the Intel C++ Compiler have a resource compiler?

If so, what's the name of the command line tool to compile resources? Or an example of use... I have access to the Professional suite (both Linux and Windows environment but I'm interested mainly in the Windows one), thanks in advance. ...

Building own C# compiler using ANTLR: Compilation Unit

Hi, // Create a scanner that reads from the input stream passed to us CSLexer lexer = new CSLexer(new ANTLRFileStream(f)); tokens.TokenSource = lexer; // Create a parser that reads from the scanner CSParser parser = new CSParser(tokens); // start parsing at the compilationUnit rule CSParser.compilation_unit_return x = parser.compilat...

Why is this invalid Java? Type of ternary operator output.

Check out this code. // Print object and recurse if iterable private static void deep_print(Object o) { System.out.println(o.getClass().toString() + ", " + o.toString()); boolean iter = false; Iterable<?> i1 = null; Object[] i2 = null; if (o instanceof Iterable<?>) { iter = true; i1 = (Iterable<?>) o; } else if (o ...

The condition field (ARM ISA) and its applicability to managed code JIT

After working with the ARM instruction set for a bit after heavy X86 work in the past, I'm pondering something for the CIL AOT/JIT compiler I'm working on. My intermediate representation is a fixed-width expansion of the CIL byte code with a couple extra opcodes. Here's an example of a situation that arises in the JIT, and two possible s...

Calling constructor overload when both overload have same signature

Consider the following class, class Foo { public Foo(int count) { /* .. */ } public Foo(int count) { /* .. */ } } Above code is invalid and won't compile. Now consider the following code, class Foo<T> { public Foo(int count) { /* .. */ } public Foo(T t) { /...

Can Someone explain the Purpose of the different Build Actions in VS 2008?

At first I was just looking for the difference between Resource and Embedded Resource; then I noticed all these other Build Action types: Compile, Content, Embedded Resource, ApplicationDefinition, Page, Resource, SplashScreen, and EntityDeploy. I understand some of these but some are more vague and a clearcut definition would be helpfu...

Compilers for shell scripts

Do you know if there's any tool for compiling bash scripts? It doesn't matter if that tool is just a translator (for example, something that converts a bash script to a C program), as long as the translated result can be compiled. I'm looking for something like shc (it's just an example -- I know that shc doesn't work as a compiler)....

Difference between code generated using a template function and a normal function

I have a vector containing large number of elements. Now I want to write a small function which counts the number of even or odd elements in the vector. Since performance is a major concern I don't want to put an if statement inside the loop. So I wrote two small functions like: long long countOdd(const std::vector<int>& v) { long l...

How do I port code that contains #pragma optimize( "a" ) from VC++7 to VC++9 ?

I'm moving my C++ codebase from Visual Studio 2k3 to Visual Studio 2k8. Code contains #pragma optimize( "a", on ) MSDN says that it means "assume no aliasing". Later versions of VS refuse to compile this and MSDN doesn't seem to say what to do with code containing this #pragma. What does "assume no aliasing" mean and how to I make a ...

build program and install software under Network File System for different machines

Hi, Although having a little experience, I am still confused with the question of whether it is necessary to install an application and/or build a C++ program or C++ library under Network File System shared by machines, which have different Linux version (e.g. CentOS release 4.7, Ubuntu 8.10), possibly different bit (e.g. 32-bit, 64-bit)...

BUG on boost spirit?

I'm trying to migrate my code from VSC++ 6 to VSC++ 2008 express edition and from Intel compiler to Microsoft compiler. Everything were easy to migrate except that I'm receiving this errors now: 1>------ Build started: Project: Base, Configuration: Debug Win32 ------ 1>Compiling... 1>DefaultScriptReader.cpp 1>Warning: This header is dep...

Intel C++ Compiler for Windows CE ...

Two years ago I used eMbedded Visual Studio for Windows CE based application development. I had about 40% app performance acceleration with Intel C++ Compiler(v1.2 or v2.0) in comparison with default MS compiler (floating point issues, ARM). It was looked really helpful for me. I do remember that downloaded it from official Intel site....

gcc compiler advantage

can anyone tell me what gcc is?? and wts are its advantage over other compiler like turbo c and visual c ...

what is the best programming language to write parsers and compilers ?

please i need some resources to begin (i am a cs student) ...

Is string formation optimized by the compiler?

I was trying to answer another question about the == operator and I created this code: NSString *aString = @"Hello"; NSString *bString = aString; NSString *cString = @"Hello"; if (aString == bString) NSLog(@"CHECK 1"); if (bString == cString) NSLog(@"CHECK 2"); if ([aString isEqual:bString]) NSLog(@"CHECK 3"); if ([aString isEqua...