<div dir="ltr"><div><br>I'll try to run through the scenario:<br><br><br></div><div>64-bit register type target (all registers have 64 bits).<br><br></div><div>all 32-bits are getting promoted to 64-bit integers<br><br>
Problem:<br><br>MUL on i32 is getting promoted to MUL on i64<br><br></div><div>MUL on i64 is getting expanded to a library call in compiler-rt<br><br><br></div><div>the problem is that MUL32 gets promoted and then converted into a subroutine call because it is now type i64, even though I want the MUL I32 to remain as an operation in the architecture.  MUL i32 would generate a 64-bit results from the lower 32-bit portions of 64-bit source operands.<br>
<br></div><div>In customize for the operations, I am trying to do something like:<br></div><div><br><div><div>case ISD::MUL:</div><div>        {</div><div>         EVT OpVT = Op.getValueType();</div><div>          if (OpVT == MVT::i64) {</div>
<div>            RTLIB::Libcall LC = RTLIB::MUL_I64;</div><div>
            SDValue Dummy;</div><div>            return ExpandLibCall(LC, Op, DAG, false, Dummy, *this);</div><div>          }</div><div>          else if (OpVT == MVT::i32){</div><div>            <br></div><div>            ??? What to do here to not have issues with type i32<br>
</div><div>          }</div><div>        }<br></div><div><br><br></div><div>I've gone a few directions on this. <br><br>Defining the architecture type i32 leads to a lot of changes that I don't think is the most straightforward change.<br>
</div></div><br></div><div>Would think there is a way to promote the MUL i32 types but still be able to "see" that as a MUL i32 somewhere down the lowering process.<br></div><div><br></div><div>Are there suggestions on how to promote the type, but then be able to customize the original i64 to a call and the original mul i32 to an operation?<br>
</div><div><br></div><br></div>