Improve simplec back-end
authorClifford Wolf <clifford@clifford.at>
Tue, 16 May 2017 06:50:23 +0000 (08:50 +0200)
committerClifford Wolf <clifford@clifford.at>
Tue, 16 May 2017 06:50:23 +0000 (08:50 +0200)
backends/simplec/simplec.cc

index 5ea35c56442bab591f50c70067a7247c0a914380..c8a812748973a322231b2541e85092126901bac6 100644 (file)
@@ -235,7 +235,7 @@ struct SimplecWorker
                        util_declarations.push_back(stringf("  else"));
                        util_declarations.push_back(stringf("    sig->%s &= ~(1UL << %d);", value_name.c_str(), word_offset));
                #else
-                       util_declarations.push_back(stringf("    sig->%s = (sig->%s | (uint%d_t)(value & 1) << %d) & ~((uint%d_t)((value & 1) ^ 1) << %d);",
+                       util_declarations.push_back(stringf("    sig->%s = (sig->%s & ~((uint%d_t)1 << %d)) | ((uint%d_t)value << %d);",
                                        value_name.c_str(), value_name.c_str(), max_uintsize, word_offset, max_uintsize, word_offset));
                #endif