On Aug 25, 2011, at 1:35 PM, Michael Meissner wrote: > The alternative is something like what Kenney and Mike are doing in their > private port, where they have new syntax in the MD file for builtins.
I think the issue is actually largely orthogonal. In our code, we generate which code is used by a description for the built-in, picking a simple one: (define_builtin "port_add" "port_add_<type>" [ (define_outputs [(var_operand:T_ALL_DI 0)]) (define_inputs [(var_operand:T_ALL_DI 1) (var_operand:T_ALL_DI 2) (var_operand:T_ALL_DI 3)]) (define_rtl_pattern "port_add_<m_mode>" [0 1 2 3]) (attributes [pure]) ] ) from this, we generate everything needed. Way under the hood, there is a set of enum values, but, you wouldn't ever see them. There isn't a one-to-one correspondence as we permit overloading. We start as 0 and increase, but, we could just as easily start at LAST_MI_BUILTIN+1. Things like T_ALL_DI as iterators which describe the front-end type to use and how it relates to modes in rtl-land. T_DI might be long, and T_UDI might be unsigned long, the mode for both is DImode.