Commit 69bc6e8a by Tom Anderson

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/8888Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarTom Anderson <thomasanderson@google.com>
parent 3eabac0a
...@@ -75,7 +75,7 @@ private: ...@@ -75,7 +75,7 @@ private:
Diagnostics* mDiagnostics; Diagnostics* mDiagnostics;
const bool mParseDefined; const bool mParseDefined;
std::auto_ptr<Token> mReserveToken; std::unique_ptr<Token> mReserveToken;
std::vector<MacroContext*> mContextStack; std::vector<MacroContext*> mContextStack;
}; };
......
...@@ -5218,7 +5218,7 @@ namespace sw ...@@ -5218,7 +5218,7 @@ namespace sw
else else
{ {
RValue<Int4> greater = CmpNLE(x, y); RValue<Int4> greater = CmpNLE(x, y);
return x & greater | y & ~greater; return (x & greater) | (y & ~greater);
} }
} }
...@@ -5231,7 +5231,7 @@ namespace sw ...@@ -5231,7 +5231,7 @@ namespace sw
else else
{ {
RValue<Int4> less = CmpLT(x, y); RValue<Int4> less = CmpLT(x, y);
return x & less | y & ~less; return (x & less) | (y & ~less);
} }
} }
...@@ -5558,7 +5558,7 @@ namespace sw ...@@ -5558,7 +5558,7 @@ namespace sw
else else
{ {
RValue<UInt4> greater = CmpNLE(x, y); RValue<UInt4> greater = CmpNLE(x, y);
return x & greater | y & ~greater; return (x & greater) | (y & ~greater);
} }
} }
...@@ -5571,7 +5571,7 @@ namespace sw ...@@ -5571,7 +5571,7 @@ namespace sw
else else
{ {
RValue<UInt4> less = CmpLT(x, y); RValue<UInt4> less = CmpLT(x, y);
return x & less | y & ~less; return (x & less) | (y & ~less);
} }
} }
......
...@@ -198,7 +198,7 @@ namespace sw ...@@ -198,7 +198,7 @@ namespace sw
BLEND_CONSTANTALPHA, BLEND_CONSTANTALPHA,
BLEND_INVCONSTANTALPHA, BLEND_INVCONSTANTALPHA,
BLEND_LAST = BLEND_INVCONSTANT BLEND_LAST = BLEND_INVCONSTANTALPHA
}; };
enum BlendOperation ENUM_UNDERLYING_TYPE_UNSIGNED_INT enum BlendOperation ENUM_UNDERLYING_TYPE_UNSIGNED_INT
......
...@@ -3289,7 +3289,7 @@ namespace sw ...@@ -3289,7 +3289,7 @@ namespace sw
unsigned char maskedS = s & mask; unsigned char maskedS = s & mask;
unsigned char invMask = ~mask; unsigned char invMask = ~mask;
unsigned int fill = maskedS; unsigned int fill = maskedS;
fill = fill | (fill << 8) | (fill << 16) + (fill << 24); fill = fill | (fill << 8) | (fill << 16) | (fill << 24);
char *buffer = (char*)lockStencil(0, 0, 0, PUBLIC); char *buffer = (char*)lockStencil(0, 0, 0, PUBLIC);
......
...@@ -705,10 +705,10 @@ namespace sw ...@@ -705,10 +705,10 @@ namespace sw
{ {
Short4 b; Short4 b;
c.x = borderMask & c.x | ~borderMask & (*Pointer<Short4>(texture + OFFSET(Texture,borderColor4[0])) >> (hasUnsignedTextureComponent(0) ? 0 : 1)); c.x = (borderMask & c.x) | (~borderMask & (*Pointer<Short4>(texture + OFFSET(Texture,borderColor4[0])) >> (hasUnsignedTextureComponent(0) ? 0 : 1)));
c.y = borderMask & c.y | ~borderMask & (*Pointer<Short4>(texture + OFFSET(Texture,borderColor4[1])) >> (hasUnsignedTextureComponent(1) ? 0 : 1)); c.y = (borderMask & c.y) | (~borderMask & (*Pointer<Short4>(texture + OFFSET(Texture,borderColor4[1])) >> (hasUnsignedTextureComponent(1) ? 0 : 1)));
c.z = borderMask & c.z | ~borderMask & (*Pointer<Short4>(texture + OFFSET(Texture,borderColor4[2])) >> (hasUnsignedTextureComponent(2) ? 0 : 1)); c.z = (borderMask & c.z) | (~borderMask & (*Pointer<Short4>(texture + OFFSET(Texture,borderColor4[2])) >> (hasUnsignedTextureComponent(2) ? 0 : 1)));
c.w = borderMask & c.w | ~borderMask & (*Pointer<Short4>(texture + OFFSET(Texture,borderColor4[3])) >> (hasUnsignedTextureComponent(3) ? 0 : 1)); c.w = (borderMask & c.w) | (~borderMask & (*Pointer<Short4>(texture + OFFSET(Texture,borderColor4[3])) >> (hasUnsignedTextureComponent(3) ? 0 : 1)));
} }
} }
...@@ -1170,10 +1170,10 @@ namespace sw ...@@ -1170,10 +1170,10 @@ namespace sw
{ {
Int4 b; Int4 b;
c.x = As<Float4>(borderMask & As<Int4>(c.x) | ~borderMask & *Pointer<Int4>(texture + OFFSET(Texture,borderColorF[0]))); c.x = As<Float4>((borderMask & As<Int4>(c.x)) | (~borderMask & *Pointer<Int4>(texture + OFFSET(Texture,borderColorF[0]))));
c.y = As<Float4>(borderMask & As<Int4>(c.y) | ~borderMask & *Pointer<Int4>(texture + OFFSET(Texture,borderColorF[1]))); c.y = As<Float4>((borderMask & As<Int4>(c.y)) | (~borderMask & *Pointer<Int4>(texture + OFFSET(Texture,borderColorF[1]))));
c.z = As<Float4>(borderMask & As<Int4>(c.z) | ~borderMask & *Pointer<Int4>(texture + OFFSET(Texture,borderColorF[2]))); c.z = As<Float4>((borderMask & As<Int4>(c.z)) | (~borderMask & *Pointer<Int4>(texture + OFFSET(Texture,borderColorF[2]))));
c.w = As<Float4>(borderMask & As<Int4>(c.w) | ~borderMask & *Pointer<Int4>(texture + OFFSET(Texture,borderColorF[3]))); c.w = As<Float4>((borderMask & As<Int4>(c.w)) | (~borderMask & *Pointer<Int4>(texture + OFFSET(Texture,borderColorF[3]))));
} }
} }
...@@ -1439,8 +1439,8 @@ namespace sw ...@@ -1439,8 +1439,8 @@ namespace sw
Float4 dvdy = duvdxy.wwww; Float4 dvdy = duvdxy.wwww;
Int4 mask = As<Int4>(CmpNLT(dUV2.x, dUV2.y)); Int4 mask = As<Int4>(CmpNLT(dUV2.x, dUV2.y));
uDelta = As<Float4>(As<Int4>(dudx) & mask | As<Int4>(dudy) & ~mask); uDelta = As<Float4>((As<Int4>(dudx) & mask) | ((As<Int4>(dudy) & ~mask)));
vDelta = As<Float4>(As<Int4>(dvdx) & mask | As<Int4>(dvdy) & ~mask); vDelta = As<Float4>((As<Int4>(dvdx) & mask) | ((As<Int4>(dvdy) & ~mask)));
anisotropy = lod * Rcp_pp(det); anisotropy = lod * Rcp_pp(det);
anisotropy = Min(anisotropy, *Pointer<Float>(texture + OFFSET(Texture,maxAnisotropy))); anisotropy = Min(anisotropy, *Pointer<Float>(texture + OFFSET(Texture,maxAnisotropy)));
......
...@@ -331,7 +331,7 @@ namespace sw ...@@ -331,7 +331,7 @@ namespace sw
Float4 arctan(RValue<Float4> x, bool pp) Float4 arctan(RValue<Float4> x, bool pp)
{ {
Int4 O = CmpNLT(Abs(x), Float4(1.0f)); 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] // Approximation of atan in [-1..1]
Float4 theta = y * (Float4(-0.27f) * Abs(y) + Float4(1.05539816f)); Float4 theta = y * (Float4(-0.27f) * Abs(y) + Float4(1.05539816f));
...@@ -339,7 +339,7 @@ namespace sw ...@@ -339,7 +339,7 @@ namespace sw
// +/-pi/2 depending on sign of x // +/-pi/2 depending on sign of x
Float4 sgnPi_2 = As<Float4>(As<Int4>(Float4(1.57079632e+0f)) ^ (As<Int4>(x) & Int4(0x80000000))); 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; return theta;
} }
...@@ -355,14 +355,14 @@ namespace sw ...@@ -355,14 +355,14 @@ namespace sw
// Rotate to right quadrant when in left quadrant // Rotate to right quadrant when in left quadrant
Int4 Q = CmpLT(x0, Float4(0.0f)); Int4 Q = CmpLT(x0, Float4(0.0f));
theta += As<Float4>(Q & As<Int4>(Float4(1.57079632e+0f))); // pi/2 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 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 y1 = As<Float4>((Q & As<Int4>(-x0)) | (~Q & As<Int4>(y0))); // FIXME: Vector select
// Rotate to first octant when in second octant // Rotate to first octant when in second octant
Int4 O = CmpNLT(y1, x1); Int4 O = CmpNLT(y1, x1);
theta += As<Float4>(O & As<Int4>(Float4(7.85398163e-1f))); // pi/4 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 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 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] // Approximation of atan in [0..1]
Float4 y_x = y2 / x2; Float4 y_x = y2 / x2;
...@@ -1624,7 +1624,7 @@ namespace sw ...@@ -1624,7 +1624,7 @@ namespace sw
void ShaderCore::select(Float4 &dst, RValue<Int4> src0, const Float4 &src1, const Float4 &src2) void ShaderCore::select(Float4 &dst, RValue<Int4> src0, const Float4 &src1, const Float4 &src2)
{ {
// FIXME: LLVM vector select // 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) void ShaderCore::cmp(Vector4f &dst, const Vector4f &src0, const Vector4f &src1, Control control)
......
...@@ -51,21 +51,26 @@ config("swiftshader_llvm_private_config") { ...@@ -51,21 +51,26 @@ config("swiftshader_llvm_private_config") {
if (is_clang) { if (is_clang) {
cflags += [ cflags += [
"-msse2", "-msse2",
"-Wno-unused-local-typedef",
"-Wno-unused-private-field",
"-Wno-null-dereference",
"-Wno-header-hygiene", "-Wno-header-hygiene",
"-Wno-unused-function", "-Wno-null-dereference",
"-Wno-deprecated-declarations", "-Wno-unused-private-field",
"-Wno-unused-variable", "-Wno-unused-local-typedef",
"-Wno-unused-result",
]
defines = [
"__STDC_CONSTANT_MACROS",
"__STDC_LIMIT_MACROS",
] ]
} else {
cflags += [ "-Wno-unused-but-set-variable" ]
} }
cflags += [
"-Wno-attributes",
"-Wno-deprecated-declarations",
"-Wno-enum-compare",
"-Wno-unused-function",
"-Wno-unused-result",
"-Wno-unused-variable",
]
defines = [
"__STDC_CONSTANT_MACROS",
"__STDC_LIMIT_MACROS",
]
} }
source_set("swiftshader_llvm") { source_set("swiftshader_llvm") {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment