Upcoming changes for RISC-V will have us exceed 255 modes or 8 bits.
This patch increases the limit to 10 bits and adjusts the hashing
function for the gen* and optabs-query lookups accordingly.
Consequently, the number of optabs is limited to 4095.
gcc/ChangeLog:
* genopinit.cc (main): Adjust maximal number of optabs and
machine modes.
* gensupport.cc (find_optab): Shift optab by 20 and mode by
10 bits.
* optabs-query.h (optab_handler): Ditto.
(convert_optab_handler): Ditto.
progname = "genopinit";
- if (NUM_OPTABS > 0xffff
- || MAX_MACHINE_MODE >= ((1 << MACHINE_MODE_BITSIZE) - 1))
+ if (NUM_OPTABS > 0xfff || NUM_MACHINE_MODES > 0x3ff)
fatal ("genopinit range assumptions invalid");
if (!init_rtx_reader_args_cb (argc, argv, handle_arg))
"bool\n"
"swap_optab_enable (optab op, machine_mode m, bool set)\n"
"{\n"
- " unsigned scode = (op << 16) | m;\n"
+ " unsigned scode = (op << 20) | m;\n"
" int i = lookup_handler (scode);\n"
" if (i >= 0)\n"
" {\n"
{
p->name = name;
p->op = optabs[pindex].op;
- p->sort_num = (p->op << 16) | (p->m2 << 8) | p->m1;
+ p->sort_num = (p->op << 20) | (p->m2 << 10) | p->m1;
return true;
}
}
inline enum insn_code
optab_handler (optab op, machine_mode mode)
{
- unsigned scode = (op << 16) | mode;
+ unsigned scode = (op << 20) | mode;
gcc_assert (op > LAST_CONV_OPTAB);
return raw_optab_handler (scode);
}
convert_optab_handler (convert_optab op, machine_mode to_mode,
machine_mode from_mode)
{
- unsigned scode = (op << 16) | (from_mode << 8) | to_mode;
+ unsigned scode = (op << 20) | (from_mode << 10) | to_mode;
gcc_assert (convert_optab_p (op));
return raw_optab_handler (scode);
}