Renaming functions named after operator names
Windows clang has no option to do anything similar to
"-fno-operator-names", so it generates errors without
any way to silence them. Renaming these functions is
easy enough, so it was done here. Also removed the
now useless flag from the code blocks project files.
Change-Id: I9e25e25a72bf24567e3be928e07b187df87398bc
Reviewed-on: https://swiftshader-review.googlesource.com/7051
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
diff --git a/src/OpenGL/libGLES_CM/libGLES_CM.cbp b/src/OpenGL/libGLES_CM/libGLES_CM.cbp
index a35b6f8..e5028ba 100644
--- a/src/OpenGL/libGLES_CM/libGLES_CM.cbp
+++ b/src/OpenGL/libGLES_CM/libGLES_CM.cbp
@@ -113,7 +113,6 @@
<Add option="-Wall" />
<Add option="-std=c++11" />
<Add option="-fexceptions" />
- <Add option="-fno-operator-names" />
<Add option="-msse2" />
<Add option="-fvisibility=protected" />
<Add option="-D__STDC_LIMIT_MACROS" />
diff --git a/src/OpenGL/libGLESv2/libGLESv2.cbp b/src/OpenGL/libGLESv2/libGLESv2.cbp
index e4ea4a4..abd8fe8 100644
--- a/src/OpenGL/libGLESv2/libGLESv2.cbp
+++ b/src/OpenGL/libGLESv2/libGLESv2.cbp
@@ -113,7 +113,6 @@
<Add option="-Wall" />
<Add option="-std=c++11" />
<Add option="-fexceptions" />
- <Add option="-fno-operator-names" />
<Add option="-msse2" />
<Add option="-fvisibility=protected" />
<Add option="-D__STDC_LIMIT_MACROS" />
diff --git a/src/Shader/PixelProgram.cpp b/src/Shader/PixelProgram.cpp
index 1f50547..0f7d0ed 100644
--- a/src/Shader/PixelProgram.cpp
+++ b/src/Shader/PixelProgram.cpp
@@ -320,10 +320,10 @@
case Shader::OPCODE_CMP: cmp(d, s0, s1, control); break;
case Shader::OPCODE_ALL: all(d.x, s0); break;
case Shader::OPCODE_ANY: any(d.x, s0); break;
- case Shader::OPCODE_NOT: not(d, s0); break;
- case Shader::OPCODE_OR: or(d, s0, s1); break;
- case Shader::OPCODE_XOR: xor(d, s0, s1); break;
- case Shader::OPCODE_AND: and(d, s0, s1); break;
+ case Shader::OPCODE_NOT: bitwise_not(d, s0); break;
+ case Shader::OPCODE_OR: bitwise_or(d, s0, s1); break;
+ case Shader::OPCODE_XOR: bitwise_xor(d, s0, s1); break;
+ case Shader::OPCODE_AND: bitwise_and(d, s0, s1); break;
case Shader::OPCODE_EQ: equal(d, s0, s1); break;
case Shader::OPCODE_NE: notEqual(d, s0, s1); break;
case Shader::OPCODE_END: break;
diff --git a/src/Shader/ShaderCore.cpp b/src/Shader/ShaderCore.cpp
index 55fe0d8..727ea71 100644
--- a/src/Shader/ShaderCore.cpp
+++ b/src/Shader/ShaderCore.cpp
@@ -1777,7 +1777,7 @@
dst = As<Float4>(As<Int4>(src.x) | As<Int4>(src.y) | As<Int4>(src.z) | As<Int4>(src.w));
}
- void ShaderCore::not(Vector4f &dst, const Vector4f &src)
+ void ShaderCore::bitwise_not(Vector4f &dst, const Vector4f &src)
{
dst.x = As<Float4>(As<Int4>(src.x) ^ Int4(0xFFFFFFFF));
dst.y = As<Float4>(As<Int4>(src.y) ^ Int4(0xFFFFFFFF));
@@ -1785,7 +1785,7 @@
dst.w = As<Float4>(As<Int4>(src.w) ^ Int4(0xFFFFFFFF));
}
- void ShaderCore::or(Vector4f &dst, const Vector4f &src0, const Vector4f &src1)
+ void ShaderCore::bitwise_or(Vector4f &dst, const Vector4f &src0, const Vector4f &src1)
{
dst.x = As<Float4>(As<Int4>(src0.x) | As<Int4>(src1.x));
dst.y = As<Float4>(As<Int4>(src0.y) | As<Int4>(src1.y));
@@ -1793,7 +1793,7 @@
dst.w = As<Float4>(As<Int4>(src0.w) | As<Int4>(src1.w));
}
- void ShaderCore::xor(Vector4f &dst, const Vector4f &src0, const Vector4f &src1)
+ void ShaderCore::bitwise_xor(Vector4f &dst, const Vector4f &src0, const Vector4f &src1)
{
dst.x = As<Float4>(As<Int4>(src0.x) ^ As<Int4>(src1.x));
dst.y = As<Float4>(As<Int4>(src0.y) ^ As<Int4>(src1.y));
@@ -1801,7 +1801,7 @@
dst.w = As<Float4>(As<Int4>(src0.w) ^ As<Int4>(src1.w));
}
- void ShaderCore::and(Vector4f &dst, const Vector4f &src0, const Vector4f &src1)
+ void ShaderCore::bitwise_and(Vector4f &dst, const Vector4f &src0, const Vector4f &src1)
{
dst.x = As<Float4>(As<Int4>(src0.x) & As<Int4>(src1.x));
dst.y = As<Float4>(As<Int4>(src0.y) & As<Int4>(src1.y));
diff --git a/src/Shader/ShaderCore.hpp b/src/Shader/ShaderCore.hpp
index 0e69f30..edf442c 100644
--- a/src/Shader/ShaderCore.hpp
+++ b/src/Shader/ShaderCore.hpp
@@ -343,10 +343,10 @@
void insert(Vector4f &dst, const Vector4f &src, const Float4 &element, const Float4 &index);
void all(Float4 &dst, const Vector4f &src);
void any(Float4 &dst, const Vector4f &src);
- void not(Vector4f &dst, const Vector4f &src);
- void or(Vector4f &dst, const Vector4f &src0, const Vector4f &src1);
- void xor(Vector4f &dst, const Vector4f &src0, const Vector4f &src1);
- void and(Vector4f &dst, const Vector4f &src0, const Vector4f &src1);
+ void bitwise_not(Vector4f &dst, const Vector4f &src);
+ void bitwise_or(Vector4f &dst, const Vector4f &src0, const Vector4f &src1);
+ void bitwise_xor(Vector4f &dst, const Vector4f &src0, const Vector4f &src1);
+ void bitwise_and(Vector4f &dst, const Vector4f &src0, const Vector4f &src1);
void equal(Vector4f &dst, const Vector4f &src0, const Vector4f &src1);
void notEqual(Vector4f &dst, const Vector4f &src0, const Vector4f &src1);
diff --git a/src/Shader/VertexProgram.cpp b/src/Shader/VertexProgram.cpp
index 20caa49..b855933 100644
--- a/src/Shader/VertexProgram.cpp
+++ b/src/Shader/VertexProgram.cpp
@@ -314,10 +314,10 @@
case Shader::OPCODE_INSERT: insert(d, s0, s1.x, s2.x); break;
case Shader::OPCODE_ALL: all(d.x, s0); break;
case Shader::OPCODE_ANY: any(d.x, s0); break;
- case Shader::OPCODE_NOT: not(d, s0); break;
- case Shader::OPCODE_OR: or(d, s0, s1); break;
- case Shader::OPCODE_XOR: xor(d, s0, s1); break;
- case Shader::OPCODE_AND: and(d, s0, s1); break;
+ case Shader::OPCODE_NOT: bitwise_not(d, s0); break;
+ case Shader::OPCODE_OR: bitwise_or(d, s0, s1); break;
+ case Shader::OPCODE_XOR: bitwise_xor(d, s0, s1); break;
+ case Shader::OPCODE_AND: bitwise_and(d, s0, s1); break;
case Shader::OPCODE_EQ: equal(d, s0, s1); break;
case Shader::OPCODE_NE: notEqual(d, s0, s1); break;
case Shader::OPCODE_TEXLDL: TEXLDL(d, s0, src1); break;
diff --git a/third_party/LLVM/LLVM.cbp b/third_party/LLVM/LLVM.cbp
index b64d88d..62b2b05 100644
--- a/third_party/LLVM/LLVM.cbp
+++ b/third_party/LLVM/LLVM.cbp
@@ -89,7 +89,6 @@
<Add option="-Wall" />
<Add option="-std=c++11" />
<Add option="-fexceptions" />
- <Add option="-fno-operator-names" />
<Add option="-msse2" />
<Add option="-D__STDC_LIMIT_MACROS" />
<Add option="-D__STDC_CONSTANT_MACROS" />