In implementing SIMD support for s390x, I ran into an issue with the MachInst::gen_constant routine that all platforms currently have to define. In a platform that otherwise fully uses ISLE for code generation, having to implement that gen_constant routine is annoying, since to achive full performance, we'd really have to duplicate all the various ways to optimally generate each particular constant. Specifically vector constants, which I've now added, would have required significantly extending the gen_constant routine.
Looking at the sources, it appears gen_constant is now solely used by the common put_value_in_regs routine. I'm wondering if it wouldn't be better to handle constant rematerialization instead on the ISLE side, e.g. in the ISLE put_in_regs constructor? That should hopefully allow backends to re-use the ISLE rules for constant emission they already have ...
FYI @cfallin
In implementing SIMD support for s390x, I ran into an issue with the
MachInst::gen_constantroutine that all platforms currently have to define. In a platform that otherwise fully uses ISLE for code generation, having to implement thatgen_constantroutine is annoying, since to achive full performance, we'd really have to duplicate all the various ways to optimally generate each particular constant. Specifically vector constants, which I've now added, would have required significantly extending thegen_constantroutine.Looking at the sources, it appears
gen_constantis now solely used by the commonput_value_in_regsroutine. I'm wondering if it wouldn't be better to handle constant rematerialization instead on the ISLE side, e.g. in the ISLEput_in_regsconstructor? That should hopefully allow backends to re-use the ISLE rules for constant emission they already have ...FYI @cfallin