Fix GCC build
This CL fixes building the 'all' target in a Chromium checkout with the following args.gn:
is_debug = false
is_clang = false
use_sysroot = false
proprietary_codecs = true
ffmpeg_branding = "Chrome"
is_component_build = true
enable_nacl = false
use_goma = true
Bug chromium:697528
Change-Id: Ie725988e8a1cb9ee672eb1e8e20d718ac91004fa
Change-Id: Ie725988e8a1cb9ee672eb1e8e20d718ac91004fa
Reviewed-on: https://swiftshader-review.googlesource.com/8888
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Tom Anderson <thomasanderson@google.com>
diff --git a/src/Shader/ShaderCore.cpp b/src/Shader/ShaderCore.cpp
index 338ea08..424636b 100644
--- a/src/Shader/ShaderCore.cpp
+++ b/src/Shader/ShaderCore.cpp
@@ -331,7 +331,7 @@
Float4 arctan(RValue<Float4> x, bool pp)
{
Int4 O = CmpNLT(Abs(x), Float4(1.0f));
- Float4 y = As<Float4>(O & As<Int4>(Float4(1.0f) / x) | ~O & As<Int4>(x)); // FIXME: Vector select
+ Float4 y = As<Float4>((O & As<Int4>(Float4(1.0f) / x)) | (~O & As<Int4>(x))); // FIXME: Vector select
// Approximation of atan in [-1..1]
Float4 theta = y * (Float4(-0.27f) * Abs(y) + Float4(1.05539816f));
@@ -339,7 +339,7 @@
// +/-pi/2 depending on sign of x
Float4 sgnPi_2 = As<Float4>(As<Int4>(Float4(1.57079632e+0f)) ^ (As<Int4>(x) & Int4(0x80000000)));
- theta = As<Float4>(O & As<Int4>(sgnPi_2 - theta) | ~O & As<Int4>(theta)); // FIXME: Vector select
+ theta = As<Float4>((O & As<Int4>(sgnPi_2 - theta)) | (~O & As<Int4>(theta))); // FIXME: Vector select
return theta;
}
@@ -355,14 +355,14 @@
// Rotate to right quadrant when in left quadrant
Int4 Q = CmpLT(x0, Float4(0.0f));
theta += As<Float4>(Q & As<Int4>(Float4(1.57079632e+0f))); // pi/2
- Float4 x1 = As<Float4>(Q & As<Int4>(y0) | ~Q & As<Int4>(x0)); // FIXME: Vector select
- Float4 y1 = As<Float4>(Q & As<Int4>(-x0) | ~Q & As<Int4>(y0)); // FIXME: Vector select
+ Float4 x1 = As<Float4>((Q & As<Int4>(y0)) | (~Q & As<Int4>(x0))); // FIXME: Vector select
+ Float4 y1 = As<Float4>((Q & As<Int4>(-x0)) | (~Q & As<Int4>(y0))); // FIXME: Vector select
// Rotate to first octant when in second octant
Int4 O = CmpNLT(y1, x1);
theta += As<Float4>(O & As<Int4>(Float4(7.85398163e-1f))); // pi/4
- Float4 x2 = As<Float4>(O & As<Int4>(Float4(7.07106781e-1f) * x1 + Float4(7.07106781e-1f) * y1) | ~O & As<Int4>(x1)); // sqrt(2)/2 // FIXME: Vector select
- Float4 y2 = As<Float4>(O & As<Int4>(Float4(7.07106781e-1f) * y1 - Float4(7.07106781e-1f) * x1) | ~O & As<Int4>(y1)); // FIXME: Vector select
+ Float4 x2 = As<Float4>((O & As<Int4>(Float4(7.07106781e-1f) * x1 + Float4(7.07106781e-1f) * y1)) | (~O & As<Int4>(x1))); // sqrt(2)/2 // FIXME: Vector select
+ Float4 y2 = As<Float4>((O & As<Int4>(Float4(7.07106781e-1f) * y1 - Float4(7.07106781e-1f) * x1)) | (~O & As<Int4>(y1))); // FIXME: Vector select
// Approximation of atan in [0..1]
Float4 y_x = y2 / x2;
@@ -1624,7 +1624,7 @@
void ShaderCore::select(Float4 &dst, RValue<Int4> src0, const Float4 &src1, const Float4 &src2)
{
// FIXME: LLVM vector select
- dst = As<Float4>(src0 & As<Int4>(src1) | ~src0 & As<Int4>(src2));
+ dst = As<Float4>((src0 & As<Int4>(src1)) | (~src0 & As<Int4>(src2)));
}
void ShaderCore::cmp(Vector4f &dst, const Vector4f &src0, const Vector4f &src1, Control control)