diff options
author | Benjamin Segovia <benjamin.segovia@intel.com> | 2012-11-05 22:32:13 -0800 |
---|---|---|
committer | Benjamin Segovia <benjamin.segovia@intel.com> | 2012-11-05 22:32:13 -0800 |
commit | f170ff61100affbdef99e070907c2e2142bcc784 (patch) | |
tree | 85861aa2edd076e97de383da27783548ea5421a5 | |
parent | 1c6751b2bcaef90f0f1f5b43f5053a96ecb0b1f5 (diff) | |
download | beignet-f170ff61100affbdef99e070907c2e2142bcc784.tar.gz |
Fixed a potential bug with cvar
Fixed MAD related cvar initialization in c++ pre-main
-rw-r--r-- | backend/src/backend/gen_insn_selection.cpp | 6 | ||||
-rw-r--r-- | backend/src/sys/cvar.hpp | 2 | ||||
-rw-r--r-- | utests/compiler_shader_toy.cpp | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/backend/src/backend/gen_insn_selection.cpp b/backend/src/backend/gen_insn_selection.cpp index f0ac4d63..673bdc69 100644 --- a/backend/src/backend/gen_insn_selection.cpp +++ b/backend/src/backend/gen_insn_selection.cpp @@ -1097,9 +1097,6 @@ namespace gbe } }; - /*! Force MAD pattern */ - BVAR(OCL_FORCE_MAD_PATTERN, false); - /*! MAD pattern */ class MulAddInstructionPattern : public SelectionPattern { @@ -1816,6 +1813,9 @@ namespace gbe } SelectionLibrary::SelectionLibrary(void) { + /*! Force MAD pattern */ + BVAR(OCL_FORCE_MAD_PATTERN, false); + this->insert<UnaryInstructionPattern>(); this->insert<BinaryInstructionPattern>(); this->insert<TernaryInstructionPattern>(); diff --git a/backend/src/sys/cvar.hpp b/backend/src/sys/cvar.hpp index b2181932..7350a3ef 100644 --- a/backend/src/sys/cvar.hpp +++ b/backend/src/sys/cvar.hpp @@ -74,7 +74,7 @@ namespace gbe static gbe::CVarInit __CVAR##NAME##__LINE__##__(#NAME, &NAME, STR); /*! Declare a Boolean variable (just an integer in {0,1}) */ -#define BVAR(NAME, CURR) IVAR(NAME, 0, CURR, 1) +#define BVAR(NAME, CURR) IVAR(NAME, 0, CURR ? 1 : 0, 1) #endif /* __GBE_CVAR_HPP__ */ diff --git a/utests/compiler_shader_toy.cpp b/utests/compiler_shader_toy.cpp index 16e9f768..49f82543 100644 --- a/utests/compiler_shader_toy.cpp +++ b/utests/compiler_shader_toy.cpp @@ -22,7 +22,7 @@ * http://www.iquilezles.org/apps/shadertoy/index.html * * They are pretty cool and rather complex kernels. Just the right thing to have - * something a bit more complicated and interesting than unit test. + * something a bit more complicated and interesting than unit tests. * * The code here is just to wrap the common code used by all the kernels (to run * the code and assert its correctness) |