+2016-11-23 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ * opth-gen.awk: Use unsigned shifts for bit masks. Allow all bits
+ to be used. Add brackets around macro argument.
+
2016-11-23 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.md (*<any_or:code>hi_1): Fix operand 2 constraints.
mask_bits[name] = 1
vname = var_name(flags[i])
mask = "MASK_"
- mask_1 = "1"
+ mask_1 = "1U"
if (vname != "") {
mask = "OPTION_MASK_"
if (host_wide_int[vname] == "yes")
- mask_1 = "HOST_WIDE_INT_1"
+ mask_1 = "HOST_WIDE_INT_1U"
} else
extra_mask_bits[name] = 1
print "#define " mask name " (" mask_1 " << " masknum[vname]++ ")"
}
for (i = 0; i < n_extra_masks; i++) {
if (extra_mask_bits[extra_masks[i]] == 0)
- print "#define MASK_" extra_masks[i] " (1 << " masknum[""]++ ")"
+ print "#define MASK_" extra_masks[i] " (1U << " masknum[""]++ ")"
}
for (var in masknum) {
if (var != "" && host_wide_int[var] == "yes") {
- print" #if defined(HOST_BITS_PER_WIDE_INT) && " masknum[var] " >= HOST_BITS_PER_WIDE_INT"
+ print "#if defined(HOST_BITS_PER_WIDE_INT) && " masknum[var] " > HOST_BITS_PER_WIDE_INT"
print "#error too many masks for " var
print "#endif"
}
- else if (masknum[var] > 31) {
+ else if (masknum[var] > 32) {
if (var == "")
print "#error too many target masks"
else
print "#define TARGET_" name \
" ((" vname " & " mask name ") != 0)"
print "#define TARGET_" name "_P(" vname ")" \
- " ((" vname " & " mask name ") != 0)"
+ " (((" vname ") & " mask name ") != 0)"
}
}
for (i = 0; i < n_extra_masks; i++) {