It depends on whether the target machine has 16-bit register operands.  
Strictly speaking, I2I2ILOAD means loading a 16-bit data to a 16-bit 
register.  I4I2ILOAD means loading from a 16-bit location and expanding 
the result to make it occupy a 32-bit register, which can be translated 
to one machine instruction for most architectures.  If the target does 
not have 16-bit register, then it is not clear what I2I2ILOAD will 
translate to. (In x86, even though there are the legacy 16-bit 
registers, like ax, bx, we never really use them in the compiler.)

Fred

On 01/12/2011 07:03 AM, Sun Chan wrote:
> unless you have 2byte size load instruction, the whirl will require
> multiple instructions which will affect final code quality, this is my
> understanding. Fred, is this your rationale?
>
> Sun
>
> On Wed, Jan 12, 2011 at 10:37 PM, Jian-Xin Lai<laij...@gmail.com>  wrote:
>> Hi,
>>
>> I was trying to make an I2I2ILOAD but got an assertion about "bad opcode
>> ILOAD, MTYPE_I2, MTYPE_I2". I think I2I2ILOAD should be legal but it looks
>> I'm wrong.
>> In opt/opt_htable.cxx, I saw this kind of code:
>>     4126 #ifdef TARG_SL
>>     4127         if (dtyp == MTYPE_I2&&  dsctyp == MTYPE_I2) {
>>     4128           dtyp = MTYPE_I4;
>>     4129         }
>>     4130 #endif
>>     4131       opc = OPCODE_make_op(opr == OPR_ISTORE ? OPR_ILOAD :
>> OPR_ILDBITS, dtyp, dsctyp);
>>
>> It looks in TARG_SL, they changes the rtype to I4 to avoid generating
>> I2I2ILOAD. Could someone explain why I2I2ILOAD is not allowed? Thank you
>> very much.
>>
>> --
>> Regards,
>> Lai Jian-Xin
>>
>> ------------------------------------------------------------------------------
>> Protect Your Site and Customers from Malware Attacks
>> Learn about various malware tactics and how to avoid them. Understand
>> malware threats, the impact they can have on your business, and how you
>> can protect your company and customers by using code signing.
>> http://p.sf.net/sfu/oracle-sfdevnl
>> _______________________________________________
>> Open64-devel mailing list
>> Open64-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/open64-devel
>>
>>
> ------------------------------------------------------------------------------
> Protect Your Site and Customers from Malware Attacks
> Learn about various malware tactics and how to avoid them. Understand
> malware threats, the impact they can have on your business, and how you
> can protect your company and customers by using code signing.
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> Open64-devel mailing list
> Open64-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/open64-devel


------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to