Register classes, value types

I have registers that can hold either integer or floating point values. There are instructions for integer operands, floating operands, and also a “mixed” type operand, ie an operand that is the result of either an integer or floating point operation.

I see that the RegisterClass has a list of ValueTypes, and I conclude that I can define a register class to use for the mixed operands that has both integer and floating point valuetypes. I would like to do:

reg:IntRC = IntegerOp…
~or~
reg:FloatRC = FloatOp …

consumingMI regOp:MixedRC

IntRC = [i32], “reg1,…”, FloatRC = [f32], “reg1, …”, MixedRC = [i32, f32], “reg1, …”.

Does this approach seem fair? What are the consequences in the backend for the different value types for operands?

/Jonas