00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #ifdef _KEEP_RCS_ID
00041 static const char source_file[] = __FILE__;
00042 static const char rcs_id[] = "$Source: /proj/osprey/CVS/open64/osprey1.0/common/targ_info/access/ti_asm.c,v $ $Revision: 1.1.1.1 $";
00043 #endif
00044
00045 #include <stdio.h>
00046 #include <assert.h>
00047 #include <strings.h>
00048
00049 #include "topcode.h"
00050 #include "targ_isa_operands.h"
00051 #include "targ_isa_print.h"
00052 #include "targ_isa_pack.h"
00053 #include "targ_isa_bundle.h"
00054 #include "targ_isa_decode.h"
00055 #include "targ_isa_pseudo.h"
00056 #include "targ_isa_enums.h"
00057 #include "targ_isa_operands.h"
00058 #include "targ_abi_properties.h"
00059 #include "targ_proc_properties.h"
00060
00061 #include "ti_errors.h"
00062 #include "ti_asm.h"
00063 #include "bstring.h"
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073 INT TI_ASM_Pack_Inst(
00074 TOP topcode,
00075 const INT64 *result,
00076 const INT64 *opnd,
00077 ISA_PACK_INST *pinst)
00078 {
00079 INT comp;
00080 INT words;
00081 INT w;
00082 const ISA_PACK_INFO *pinfo;
00083 const ISA_PACK_ADJ_INFO *ainfo;
00084 INT64 bopnd[ISA_OPERAND_max_operands];
00085 INT64 bresult[ISA_OPERAND_max_results];
00086
00087 BCOPY(opnd, bopnd, sizeof(bopnd));
00088 BCOPY(result, bresult, sizeof(bresult));
00089
00090 topcode = ISA_PSEUDO_Translate(topcode,
00091 bresult,
00092 bopnd,
00093 ISA_PSEUDO_to_machine);
00094
00095 pinfo = ISA_PACK_Info(topcode);
00096 if (!pinfo) {
00097 #pragma mips_frequency_hint NEVER
00098 sprintf(TI_errmsg, "no ISA_PACK_INFO for %s", TOP_Name(topcode));
00099 return TI_RC_ERROR;
00100 }
00101
00102 ainfo = ISA_PACK_Adj_Info(topcode);
00103 if (ainfo) ISA_PACK_Adjust_Operands(ainfo, bopnd, FALSE);
00104
00105 words = ISA_PACK_Inst_Words(topcode);
00106 for (w = 0; w < words; ++w) {
00107 ISA_PACK_INST inst = ISA_PACK_Init_Mask(topcode, w);
00108 do {
00109 UINT64 mask = ISA_PACK_INFO_Mask(pinfo);
00110 UINT opndpos = ISA_PACK_INFO_OpndPos(pinfo);
00111 UINT instpos = ISA_PACK_INFO_InstPos(pinfo);
00112 comp = ISA_PACK_INFO_Comp(pinfo);
00113
00114 switch (comp) {
00115 case ISA_PACK_COMP_opnd:
00116 case ISA_PACK_COMP_opnd+1:
00117 case ISA_PACK_COMP_opnd+2:
00118 case ISA_PACK_COMP_opnd+3:
00119 case ISA_PACK_COMP_opnd+4:
00120 case ISA_PACK_COMP_opnd+5:
00121 {
00122 INT n = comp - ISA_PACK_COMP_opnd;
00123 inst |= ((bopnd[n] >> opndpos) & mask) << instpos;
00124 }
00125 break;
00126
00127 case ISA_PACK_COMP_result:
00128 case ISA_PACK_COMP_result+1:
00129 {
00130 INT n = comp - ISA_PACK_COMP_result;
00131 inst |= ((bresult[n] >> opndpos) & mask) << instpos;
00132 }
00133 break;
00134
00135 case ISA_PACK_COMP_end:
00136 pinst[w] = inst;
00137 break;
00138
00139 default:
00140 #pragma mips_frequency_hint NEVER
00141 sprintf(TI_errmsg, "Unhandled packing component %d for %s",
00142 comp, TOP_Name(topcode));
00143 return TI_RC_ERROR;
00144 }
00145 } while (++pinfo, comp != ISA_PACK_COMP_end);
00146 }
00147
00148 return words;
00149 }
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159 INT TI_ASM_Print_Inst(
00160 TOP topcode,
00161 const char **result,
00162 const char **opnd,
00163 FILE *f)
00164 {
00165 INT i;
00166 INT st;
00167 INT comp;
00168 const char *arg[ISA_PRINT_COMP_MAX];
00169 const ISA_PRINT_INFO *pinfo = ISA_PRINT_Info(topcode);
00170
00171 if (!pinfo) {
00172 #pragma mips_frequency_hint NEVER
00173 sprintf(TI_errmsg, "no ISA_PRINT_INFO for %s", TOP_Name(topcode));
00174 return TI_RC_ERROR;
00175 }
00176
00177 i = 0;
00178 do {
00179 comp = ISA_PRINT_INFO_Comp(pinfo, i);
00180
00181
00182
00183
00184 if (comp == ISA_PRINT_COMP_name) {
00185 arg[i] = ISA_PRINT_AsmName(topcode);
00186 }
00187 else if (comp >= ISA_PRINT_COMP_opnd && comp < ISA_PRINT_COMP_result) {
00188 arg[i] = opnd[comp - ISA_PRINT_COMP_opnd];
00189 }
00190 else if (comp >= ISA_PRINT_COMP_result && comp <= ISA_PRINT_COMP_MAX) {
00191 arg[i] = result[comp - ISA_PRINT_COMP_result];
00192 }
00193 else if (comp == ISA_PRINT_COMP_end) {
00194 ;
00195 }
00196 else {
00197 #pragma mips_frequency_hint NEVER
00198 sprintf(TI_errmsg, "Unhandled listing component %d for %s",
00199 comp, TOP_Name(topcode));
00200 return TI_RC_ERROR;
00201
00202 }
00203 } while (++i, comp != ISA_PRINT_COMP_end);
00204
00205 st = fprintf (f, ISA_PRINT_INFO_Format(pinfo),
00206 arg[0], arg[1], arg[2], arg[3],
00207 arg[4], arg[5], arg[6], arg[7],
00208 arg[8]
00209 #ifdef TARG_SL
00210 , arg[9]
00211 #endif
00212 );
00213 if (st == -1) {
00214 sprintf(TI_errmsg, "fprintf failed: not enough disk space");
00215 return TI_RC_ERROR;
00216 }
00217 else return st;
00218 }
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228 static INT Format_Operand(
00229 char *buf,
00230 INT64 pc,
00231 const ISA_OPERAND_VALTYP *vtype,
00232 ISA_OPERAND_USE use,
00233 INT64 val,
00234 INT flags)
00235 {
00236 if (ISA_OPERAND_VALTYP_Is_Register(vtype)) {
00237 const char *rname;
00238 const char *fmt = (use == OU_predicate) ? ISA_PRINT_PREDICATE : "%s";
00239 ISA_REGISTER_CLASS rc = ISA_OPERAND_VALTYP_Register_Class(vtype);
00240 #ifdef TARG_IA64
00241 if ( !(flags & TI_ASM_DISASM_TRUE_PRED)
00242 && (use == OU_predicate)
00243 && ABI_PROPERTY_Is_true_predicate(rc, val))
00244 {
00245 rname = "";
00246 fmt = "%s";
00247 } else if (flags & TI_ASM_DISASM_ABI_REGS) {
00248 #else
00249 if (flags & TI_ASM_DISASM_ABI_REGS) {
00250 #endif
00251 rname = ABI_PROPERTY_Reg_Name(rc, val);
00252 } else {
00253 const ISA_REGISTER_CLASS_INFO *rcinfo = ISA_REGISTER_CLASS_Info(rc);
00254 rname = ISA_REGISTER_CLASS_INFO_Reg_Name(rcinfo, val);
00255 }
00256 return sprintf(buf, fmt, rname) + 1;
00257 } else if (ISA_OPERAND_VALTYP_Is_Enum(vtype)) {
00258 ISA_ENUM_CLASS_VALUE ecv = (ISA_ENUM_CLASS_VALUE)val;
00259 return sprintf(buf, "%s", ISA_ECV_Name(ecv)) + 1;
00260 }
00261
00262 assert(ISA_OPERAND_VALTYP_Is_Literal(vtype));
00263
00264 if (ISA_OPERAND_VALTYP_Is_PCRel(vtype)) {
00265 val += pc;
00266 if (PROC_has_branch_delay_slot()) val += sizeof(ISA_BUNDLE);
00267 return sprintf(buf, "0x%llx", val) + 1;
00268 } else if (ISA_OPERAND_VALTYP_Is_Signed(vtype)) {
00269 return sprintf(buf, "%lld", val) + 1;
00270 } else {
00271 return sprintf(buf, "%llu", val) + 1;
00272 }
00273 }
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284 INT TI_ASM_DisAsm_Inst(
00285 TOP topcode,
00286 INT64 *result,
00287 INT64 *opnd,
00288 INT64 pc,
00289 INT flags,
00290 char *bufptr)
00291 {
00292 INT comp;
00293 const char *arg[ISA_PRINT_COMP_MAX];
00294 char buf[80];
00295 int i;
00296 INT cursor;
00297 const ISA_PRINT_INFO *pinfo = ISA_PRINT_Info(topcode);
00298 const ISA_OPERAND_INFO *oinfo = ISA_OPERAND_Info(topcode);
00299
00300 cursor = 0;
00301 i = 0;
00302 do {
00303 comp = ISA_PRINT_INFO_Comp(pinfo, i);
00304
00305
00306
00307
00308 if (comp == ISA_PRINT_COMP_name) {
00309 arg[i] = ISA_PRINT_AsmName(topcode);
00310 }
00311 else if (comp >= ISA_PRINT_COMP_opnd && comp < ISA_PRINT_COMP_result) {
00312 INT n = comp - ISA_PRINT_COMP_opnd;
00313 const ISA_OPERAND_VALTYP *vtype = ISA_OPERAND_INFO_Operand(oinfo, n);
00314 ISA_OPERAND_USE use = ISA_OPERAND_INFO_Use(oinfo, n);
00315 arg[i] = buf + cursor;
00316 cursor += Format_Operand(buf + cursor, pc, vtype, use, opnd[n], flags);
00317 }
00318 else if (comp >= ISA_PRINT_COMP_result && comp <= ISA_PRINT_COMP_MAX) {
00319 INT n = comp - ISA_PRINT_COMP_result;
00320 const ISA_OPERAND_VALTYP *vtype = ISA_OPERAND_INFO_Result(oinfo, n);
00321 arg[i] = buf + cursor;
00322 cursor += Format_Operand(buf + cursor, 0, vtype, OU_UNDEFINED,
00323 result[n], flags);
00324 }
00325 else if (comp == ISA_PRINT_COMP_end) {
00326 ;
00327 }
00328 else {
00329 assert(0);
00330
00331 }
00332 } while (++i, comp != ISA_PRINT_COMP_end);
00333
00334 return sprintf(bufptr, ISA_PRINT_INFO_Format(pinfo),
00335 arg[0], arg[1], arg[2], arg[3],
00336 arg[4], arg[5], arg[6], arg[7],
00337 arg[8]);
00338 }
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348 void TI_ASM_Set_Bundle_Comp(
00349 ISA_BUNDLE *bundle,
00350 ISA_BUNDLE_PACK_COMP comp,
00351 UINT64 val
00352 )
00353 {
00354 const ISA_BUNDLE_PACK_INFO *pinfo = ISA_BUNDLE_Pack_Info();
00355 INT i = ISA_BUNDLE_Pack_Info_Index(comp);
00356 for (pinfo = pinfo + i; ISA_BUNDLE_PACK_INFO_Comp(pinfo) == comp; ++pinfo) {
00357 UINT64 mask = ISA_BUNDLE_PACK_INFO_Mask(pinfo);
00358 INT comp_pos = ISA_BUNDLE_PACK_INFO_CompPos(pinfo);
00359 INT bundle_pos = ISA_BUNDLE_PACK_INFO_BundlePos(pinfo);
00360 INT index = ISA_BUNDLE_PACK_INFO_Index(pinfo);
00361 bundle->word[index] = (bundle->word[index] & ~mask)
00362 | (((val >> comp_pos) << bundle_pos) & mask);
00363 }
00364 }
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375 UINT64 TI_ASM_Get_Bundle_Comp(
00376 const ISA_BUNDLE *bundle,
00377 ISA_BUNDLE_PACK_COMP comp
00378 )
00379 {
00380 UINT64 val = 0;
00381 const ISA_BUNDLE_PACK_INFO *pinfo = ISA_BUNDLE_Pack_Info();
00382 INT i = ISA_BUNDLE_Pack_Info_Index(comp);
00383 for (pinfo = pinfo + i; ISA_BUNDLE_PACK_INFO_Comp(pinfo) == comp; ++pinfo) {
00384 UINT64 mask = ISA_BUNDLE_PACK_INFO_Mask(pinfo);
00385 INT comp_pos = ISA_BUNDLE_PACK_INFO_CompPos(pinfo);
00386 INT bundle_pos = ISA_BUNDLE_PACK_INFO_BundlePos(pinfo);
00387 INT index = ISA_BUNDLE_PACK_INFO_Index(pinfo);
00388 val |= ((bundle->word[index] & mask) >> bundle_pos) << comp_pos;
00389 }
00390 return val;
00391 }
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401 void TI_ASM_Set_Bundle_Reloc_Value(
00402 ISA_BUNDLE *bundle,
00403 INT slot,
00404 UINT64 val
00405 )
00406 {
00407 INT opnd;
00408 INT words;
00409 const ISA_PACK_INFO *pinfo;
00410 INT comp;
00411 INT i;
00412 ISA_PACK_INST inst[ISA_MAX_SLOTS];
00413 TOP topcode;
00414 INT template_bits = TI_ASM_Get_Bundle_Comp(bundle,
00415 ISA_BUNDLE_PACK_COMP_template);
00416 ISA_EXEC_UNIT ex_unit = ISA_EXEC_Unit(template_bits, slot);
00417
00418 for (i = 0; i < ISA_MAX_SLOTS; ++i) {
00419 ISA_BUNDLE_PACK_COMP slot_comp =
00420 (ISA_BUNDLE_PACK_COMP)(ISA_BUNDLE_PACK_COMP_slot + i);
00421 inst[i] = TI_ASM_Get_Bundle_Comp(bundle, slot_comp);
00422 }
00423 topcode = ISA_Decode_Inst(inst + slot, ex_unit);
00424
00425
00426
00427 if (topcode == TOP_UNDEFINED) {
00428 fprintf(stderr, "TI_ASM_Set_Bundle_Reloc_Value: couldn't decode instruction\n");
00429 assert(FALSE);
00430 }
00431
00432 opnd = TOP_Relocatable_Operand(topcode, NULL);
00433 if (opnd < 0) {
00434 fprintf(stderr, "TI_ASM_Set_Bundle_Reloc_Value: %s does not have a relocatable field\n",
00435 TOP_Name(topcode));
00436 assert(FALSE);
00437 }
00438
00439 words = ISA_PACK_Inst_Words(topcode);
00440 if (words <= 0) {
00441 fprintf(stderr, "TI_ASM_Set_Bundle_Reloc_Value: bad number of inst words (%d) for %s\n",
00442 words, TOP_Name(topcode));
00443 assert(FALSE);
00444 }
00445
00446 pinfo = ISA_PACK_Info(topcode);
00447 for (;;) {
00448 ISA_BUNDLE_PACK_COMP slot_comp;
00449 do {
00450 comp = ISA_PACK_INFO_Comp(pinfo);
00451 if (comp == ISA_PACK_COMP_opnd + opnd) {
00452 UINT64 mask = ISA_PACK_INFO_Mask(pinfo);
00453 UINT32 opndpos = ISA_PACK_INFO_OpndPos(pinfo);
00454 UINT32 instpos = ISA_PACK_INFO_InstPos(pinfo);
00455 inst[slot] = (inst[slot] & ~(mask << instpos))
00456 | (((val >> opndpos) & mask) << instpos);
00457 }
00458 } while (++pinfo, comp != ISA_PACK_COMP_end);
00459
00460 slot_comp = (ISA_BUNDLE_PACK_COMP)(ISA_BUNDLE_PACK_COMP_slot + slot);
00461 TI_ASM_Set_Bundle_Comp(bundle, slot_comp, inst[slot]);
00462
00463 if (--words == 0) break;
00464
00465 ++slot;
00466 if (slot >= ISA_MAX_SLOTS) {
00467 fprintf(stderr, "TI_ASM_Set_Bundle_Reloc_Value: can't handle cross bundle reloc for %s\n",
00468 TOP_Name(topcode));
00469 assert(FALSE);
00470 }
00471 }
00472 }
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483 UINT64 TI_ASM_Get_Bundle_Reloc_Value(
00484 const ISA_BUNDLE *bundle,
00485 INT slot
00486 )
00487 {
00488 INT opnd;
00489 const ISA_PACK_INFO *pinfo;
00490 INT comp;
00491 UINT64 val;
00492 INT words;
00493 INT i;
00494 const ISA_OPERAND_INFO *oinfo;
00495 const ISA_OPERAND_VALTYP *vtype;
00496 ISA_PACK_INST inst[ISA_MAX_SLOTS];
00497 TOP topcode;
00498 INT template_bits = TI_ASM_Get_Bundle_Comp(bundle,
00499 ISA_BUNDLE_PACK_COMP_template);
00500 ISA_EXEC_UNIT ex_unit = ISA_EXEC_Unit(template_bits, slot);
00501
00502 for (i = 0; i < ISA_MAX_SLOTS; ++i) {
00503 ISA_BUNDLE_PACK_COMP slot_comp =
00504 (ISA_BUNDLE_PACK_COMP)(ISA_BUNDLE_PACK_COMP_slot + i);
00505 inst[i] = TI_ASM_Get_Bundle_Comp(bundle, slot_comp);
00506 }
00507 topcode = ISA_Decode_Inst(inst + slot, ex_unit);
00508
00509
00510
00511 if (topcode == TOP_UNDEFINED) {
00512 fprintf(stderr, "TI_ASM_Get_Bundle_Reloc_Value: couldn't decode instruction\n");
00513 assert(FALSE);
00514 }
00515
00516 opnd = TOP_Relocatable_Operand(topcode, NULL);
00517 if (opnd < 0) {
00518 fprintf(stderr, "TI_ASM_Get_Bundle_Reloc_Value: %s does not have a relocatable field\n",
00519 TOP_Name(topcode));
00520 assert(FALSE);
00521 }
00522
00523 words = ISA_PACK_Inst_Words(topcode);
00524 if (words <= 0) {
00525 fprintf(stderr, "TI_ASM_Get_Bundle_Reloc_Value: bad number of inst words (%d) for %s\n",
00526 words, TOP_Name(topcode));
00527 assert(FALSE);
00528 }
00529
00530 pinfo = ISA_PACK_Info(topcode);
00531 val = 0;
00532 for (;;) {
00533 do {
00534 comp = ISA_PACK_INFO_Comp(pinfo);
00535 if (comp == ISA_PACK_COMP_opnd + opnd) {
00536 UINT64 mask = ISA_PACK_INFO_Mask(pinfo);
00537 UINT32 opndpos = ISA_PACK_INFO_OpndPos(pinfo);
00538 UINT32 instpos = ISA_PACK_INFO_InstPos(pinfo);
00539 val |= ((inst[slot] >> instpos) & mask) << opndpos;
00540 }
00541 } while (++pinfo, comp != ISA_PACK_COMP_end);
00542
00543 if (--words == 0) break;
00544
00545 ++slot;
00546 if (slot >= ISA_MAX_SLOTS) {
00547 fprintf(stderr, "TI_ASM_Get_Bundle_Reloc_Value: can't handle cross bundle reloc for %s\n",
00548 TOP_Name(topcode));
00549 assert(FALSE);
00550 }
00551 }
00552
00553 oinfo = ISA_OPERAND_Info(topcode);
00554 vtype = ISA_OPERAND_INFO_Operand(oinfo, opnd);
00555 if (ISA_OPERAND_VALTYP_Is_Signed(vtype)) {
00556 INT size = ISA_OPERAND_VALTYP_Size(vtype);
00557 INT shift = 64 - size;
00558 val = ((INT64)val << shift) >> shift;
00559 }
00560
00561 return val;
00562 }
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572 TOP TI_ASM_Unpack_Inst(
00573 const ISA_PACK_INST *pinst,
00574 ISA_EXEC_UNIT ex_unit,
00575 INT64 *result,
00576 INT64 *opnd,
00577 BOOL xlate_pseudo)
00578 {
00579 INT comp;
00580 INT i;
00581 INT j;
00582 INT words;
00583 const ISA_PACK_INFO *pinfo;
00584 const ISA_PACK_ADJ_INFO *ainfo;
00585 const ISA_OPERAND_INFO *oinfo;
00586 TOP topcode;
00587
00588
00589
00590 topcode = ISA_Decode_Inst(pinst, ex_unit);
00591 if (topcode == TOP_UNDEFINED) return topcode;
00592
00593
00594
00595 BZERO(result, sizeof(*result) * ISA_OPERAND_max_results);
00596 BZERO(opnd, sizeof(*opnd) * ISA_OPERAND_max_operands);
00597 pinfo = ISA_PACK_Info(topcode);
00598 words = ISA_PACK_Inst_Words(topcode);
00599 for (j = 0; j < words; ++j) {
00600 ISA_PACK_INST inst = pinst[j];
00601 do {
00602 UINT64 mask = ISA_PACK_INFO_Mask(pinfo);
00603 UINT32 opndpos = ISA_PACK_INFO_OpndPos(pinfo);
00604 UINT32 instpos = ISA_PACK_INFO_InstPos(pinfo);
00605 INT64 val = ((inst >> instpos) & mask) << opndpos;
00606
00607 comp = ISA_PACK_INFO_Comp(pinfo);
00608 switch (comp) {
00609 case ISA_PACK_COMP_opnd:
00610 case ISA_PACK_COMP_opnd+1:
00611 case ISA_PACK_COMP_opnd+2:
00612 case ISA_PACK_COMP_opnd+3:
00613 case ISA_PACK_COMP_opnd+4:
00614 case ISA_PACK_COMP_opnd+5:
00615 {
00616 INT n = comp - ISA_PACK_COMP_opnd;
00617 opnd[n] |= val;
00618 }
00619 break;
00620
00621 case ISA_PACK_COMP_result:
00622 case ISA_PACK_COMP_result+1:
00623 {
00624 INT n = comp - ISA_PACK_COMP_result;
00625 result[n] |= val;
00626 }
00627 break;
00628
00629 case ISA_PACK_COMP_end:
00630 break;
00631
00632 default:
00633 assert(0);
00634
00635 }
00636 } while (++pinfo, comp != ISA_PACK_COMP_end);
00637 }
00638
00639
00640
00641
00642 ainfo = ISA_PACK_Adj_Info(topcode);
00643 if (ainfo) ISA_PACK_Adjust_Operands(ainfo, opnd, TRUE);
00644
00645
00646
00647 if (xlate_pseudo) {
00648 topcode = ISA_PSEUDO_Translate(topcode, result, opnd, ISA_PSEUDO_to_pseudo);
00649 }
00650
00651
00652
00653
00654 oinfo = ISA_OPERAND_Info(topcode);
00655 for (i = 0; i < ISA_OPERAND_INFO_Operands(oinfo); ++i) {
00656 const ISA_OPERAND_VALTYP *vtype = ISA_OPERAND_INFO_Operand(oinfo, i);
00657 UINT64 val = opnd[i];
00658
00659 if (ISA_OPERAND_VALTYP_Is_Enum(vtype)) {
00660 ISA_ENUM_CLASS_VALUE e;
00661 ISA_ENUM_CLASS_VALUE ecv = ECV_UNDEFINED;
00662 ISA_ENUM_CLASS ec = ISA_OPERAND_VALTYP_Enum_Class(vtype);
00663
00664 for (e = ISA_EC_First_Value(ec);
00665 e <= ISA_EC_Last_Value(ec);
00666 e = (ISA_ENUM_CLASS_VALUE)(e + 1))
00667 {
00668 if (ISA_ECV_Intval(e) == val) {
00669 ecv = e;
00670 break;
00671 }
00672 }
00673 opnd[i] = ecv;
00674 } else if (ISA_OPERAND_VALTYP_Is_Signed(vtype)) {
00675 INT size = ISA_OPERAND_VALTYP_Size(vtype);
00676 INT shift = 64 - size;
00677 opnd[i] = ((INT64)val << shift) >> shift;
00678 }
00679 }
00680
00681 return topcode;
00682 }