RE: [Open64-devel] what phase to call library?
Brought to you by:
ributzka,
suneeljain
From: Barak Z. <Barak.Zalstein@ParthusCeva.com> - 2003-06-24 08:41:44
|
Oops, I should have tried that as well. =20 I chose to implement these library calls while lowering: modify lower_intrinsic_op allows you to use different calling convention = when necessary, and since lower_emulation already handled similar cases, I just entered = there. Lowering allowed me to change the WN fields to different mtypes, but I = guess that it can also be done during EXP. =20 Barak. -----Original Message----- From: lai chunrong [mailto:lai...@mp...] Sent: Tuesday, June 24, 2003 11:11 AM To: ope...@li... Subject: [Open64-devel] what phase to call library? =20 hi, colleagues: =20 It seems I am able to call library function in EXP phase via = operations like TN * Expand_Integer_Divide (TN *result, TN *src1, TN *src2, TYPE_ID = mtype, OPS *ops) { PU_IDX pu_idx; PU& pu =3D New_PU (pu_idx); ST *call_st; TN *tgt_tn, *res_tn; BB *newBB; PU_Init (pu, MTYPE_To_TY(mtype), GLOBAL_SYMTAB + 1); call_st =3D New_ST (GLOBAL_SYMTAB); ST_Init (call_st, Save_Str("__divsi3"),CLASS_FUNC, = SCLASS_EXTERN, EXPORT_PREEMPTIBLE, TY_IDX(pu_idx)); tgt_tn =3D Gen_Symbol_TN (call_st, 0, 0); Exp_Call(OPR_CALL, RA_TN, tgt_tn, ops); newBB =3D Add_Label(Gen_Temp_Label()); res_tn =3D = Build_Dedicated_TN(ISA_REGISTER_CLASS_integer,targ_Result_Reg,targ_Reg_Si= ze); Expand_Copy(result,res_tn,mtype,ops); } Should I lower it to the Whirl like below before(instead) the EXP = phase?=20 I4I4LDID 0 <2,1,a> T<4,.predef_I4,4> I4PARM 2 T<4,.predef_I4,4> # by_value I4I4LDID 0 <2,2,b> T<4,.predef_I4,4> I4PARM 2 T<4,.predef_I4,4> # by_value I4CALL 126 <1,20,__divsi3> # flags 0x7e I4I4LDID 0 <1,2,.preg_I4> T<4,.predef_I4,4> I4STID 264 <1,2,.preg_I4> T<4,.predef_I4,4> # __comma =20 thanks and regards, chunrong =20 |