On Thu, Oct 23, 2014 at 06:52:20PM +0100, Charles Baylis wrote:
> ( tl;dr: How do I handle intrinsic or builtin functions where there
> are restrictions on the arguments which can't be represented in a C
> function prototype? Do other ports have this problem, how do they
> solve it? Language extension for C++98 to provide static_assert?)

In the builtin expand, you can get the operands' predicates from the
insn_data array entry for the RTL pattern generated for that builtin.
If the predicate is false, do a copy_to_mode_reg; if then the predicate
is still false, assume it had to be some constant and error out.

This works well; I stole the method from the tile* ports.  It may need
tweaks for your port.


Segher

Reply via email to