Added a rule to replace bitshifts by a constant value to a divide by the corresponding power of two.
GLSL: Handle more math functions correctly

Map intrinsics to correct GLSL functions:
- trigonometric functions (sin, cos, tan, asin, acos, atan, atan2)
- exponential functions (pow, exp, log)
- general functions (floor, ceil, lerp)

Since GLSL doesn't support bit arithmetic, don't use C backend to generate
code for "Mod" and "Div".
Correct implementation of sdiv by casting to float and back to int
Added a check to the simplification to ensure the bitshift is valid.
Simplified the integer overflow checks in the simplification.
Simplify common type casts in GLSL

Since small integer types are represented as floats, a lot of redundant type
casts were generated (e.g., float(uint8(expr)) -> float(float(expr))).

In some cases, this almost halves the number of temporary variables generated.
Correctly map lerp() to mix intrinsic
Fix indentation
Handle wider range of types when mapping filter Params to uniforms.

For example, uint8_t parameters are stored as float uniforms. This patch
fixed the parameter declaration in the special comment preceding
the shader as well as correctly setting the uniforms at runtime.
GLSL: Improve copy_to_dev and copy_to_host

- don't use GL_UNPACK_ROW_LENGTH, which is unavailable in OpenGL ES
- only transfer directly to/from host buffer if memory is contiguous
- honor min[] values of associated buffer
Merge branch 'master' into glsl_codegen
Fixed bitshift simplify to handle negative shifts and avoid 32 bit overflow.
Pass string by const ref instead of by value
GLSL: fix codegen for mod function, add small test for special functions
Merge branch 'master' into glsl_codegen
Workaround for broken llvm trunk section iterator
Fixed if statement in bitshift simplification. Added tests to check correctness of bitshift simplifies.
Redirect open, write, close on windows ...

to use _open, _write, _close
Fix for Condition failed: op->args[0].as<StringImm>() running apps/glsl test #384
Merge pull request #385 from halide/bug384

Fix for Condition failed: op->args[0].as<StringImm>() running apps/glsl ...