regop.isa (4732:9fdd1a5ab692) | regop.isa (4733:b0785fa2d7b6) |
---|---|
1// Copyright (c) 2007 The Hewlett-Packard Development Company 2// All rights reserved. 3// 4// Redistribution and use of this software in source and binary forms, 5// with or without modification, are permitted provided that the 6// following conditions are met: 7// 8// The software must be used only for Non-Commercial Use which means any --- 485 unchanged lines hidden (view full) --- 494 uint64_t top = SrcReg1 << (dataSize * 8 - shiftAmt); 495 uint64_t bottom = bits(SrcReg1, dataSize * 8, shiftAmt); 496 DestReg = merge(DestReg, top | bottom, dataSize); 497 } 498 else 499 DestReg = DestReg; 500 ''') 501 defineMicroRegOp('Rcr', ''' | 1// Copyright (c) 2007 The Hewlett-Packard Development Company 2// All rights reserved. 3// 4// Redistribution and use of this software in source and binary forms, 5// with or without modification, are permitted provided that the 6// following conditions are met: 7// 8// The software must be used only for Non-Commercial Use which means any --- 485 unchanged lines hidden (view full) --- 494 uint64_t top = SrcReg1 << (dataSize * 8 - shiftAmt); 495 uint64_t bottom = bits(SrcReg1, dataSize * 8, shiftAmt); 496 DestReg = merge(DestReg, top | bottom, dataSize); 497 } 498 else 499 DestReg = DestReg; 500 ''') 501 defineMicroRegOp('Rcr', ''' |
502 uint8_t shiftAmt = 503 (op2 & ((dataSize == 8) ? mask(4) : mask(3))); 504 if(shiftAmt) 505 { 506 CCFlagBits flags = ccFlagBits; 507 uint64_t top = flags.CF << (dataSize * 8 - shiftAmt); 508 if(shiftAmt > 1) 509 top |= SrcReg1 << (dataSize * 8 - shiftAmt - 1); 510 uint64_t bottom = bits(SrcReg1, dataSize * 8, shiftAmt); 511 DestReg = merge(DestReg, top | bottom, dataSize); 512 } 513 else 514 DestReg = DestReg; |
|
502 ''') 503 defineMicroRegOp('Rol', ''' 504 uint8_t shiftAmt = 505 (op2 & ((dataSize == 8) ? mask(4) : mask(3))); 506 if(shiftAmt) 507 { 508 uint64_t top = SrcReg1 << shiftAmt; 509 uint64_t bottom = 510 bits(SrcReg1, dataSize * 8 - 1, dataSize * 8 - shiftAmt); 511 DestReg = merge(DestReg, top | bottom, dataSize); 512 } 513 else 514 DestReg = DestReg; 515 ''') 516 defineMicroRegOp('Rcl', ''' | 515 ''') 516 defineMicroRegOp('Rol', ''' 517 uint8_t shiftAmt = 518 (op2 & ((dataSize == 8) ? mask(4) : mask(3))); 519 if(shiftAmt) 520 { 521 uint64_t top = SrcReg1 << shiftAmt; 522 uint64_t bottom = 523 bits(SrcReg1, dataSize * 8 - 1, dataSize * 8 - shiftAmt); 524 DestReg = merge(DestReg, top | bottom, dataSize); 525 } 526 else 527 DestReg = DestReg; 528 ''') 529 defineMicroRegOp('Rcl', ''' |
530 uint8_t shiftAmt = 531 (op2 & ((dataSize == 8) ? mask(4) : mask(3))); 532 if(shiftAmt) 533 { 534 CCFlagBits flags = ccFlagBits; 535 uint64_t top = SrcReg1 << shiftAmt; 536 uint64_t bottom = flags.CF << (shiftAmt - 1); 537 if(shiftAmt > 1) 538 bottom |= 539 bits(SrcReg1, dataSize * 8 - 1, 540 dataSize * 8 - shiftAmt + 1); 541 DestReg = merge(DestReg, top | bottom, dataSize); 542 } 543 else 544 DestReg = DestReg; |
|
517 ''') 518 519 defineMicroRegOpWr('Wrip', 'RIP = SrcReg1 + op2', elseCode="RIP = RIP;") 520 521 defineMicroRegOpRd('Rdip', 'DestReg = RIP') 522 523 defineMicroRegOpImm('Sext', ''' 524 IntReg val = SrcReg1; 525 int sign_bit = bits(val, imm8-1, imm8-1); 526 val = sign_bit ? (val | ~mask(imm8)) : val; 527 DestReg = merge(DestReg, val, dataSize);''') 528 529 defineMicroRegOpImm('Zext', 'DestReg = bits(SrcReg1, imm8-1, 0);') 530}}; | 545 ''') 546 547 defineMicroRegOpWr('Wrip', 'RIP = SrcReg1 + op2', elseCode="RIP = RIP;") 548 549 defineMicroRegOpRd('Rdip', 'DestReg = RIP') 550 551 defineMicroRegOpImm('Sext', ''' 552 IntReg val = SrcReg1; 553 int sign_bit = bits(val, imm8-1, imm8-1); 554 val = sign_bit ? (val | ~mask(imm8)) : val; 555 DestReg = merge(DestReg, val, dataSize);''') 556 557 defineMicroRegOpImm('Zext', 'DestReg = bits(SrcReg1, imm8-1, 0);') 558}}; |