decoder.isa (6739:48d10ba361c9) decoder.isa (6804:e8e64ad04260)
1// -*- mode:c++ -*-
2
3// Copyright (c) 2003-2006 The Regents of The University of Michigan
4// All rights reserved.
5//
6// Redistribution and use in source and binary forms, with or without
7// modification, are permitted provided that the following conditions are
8// met: redistributions of source code must retain the above copyright

--- 324 unchanged lines hidden (view full) ---

333 fault = new IntegerOverflowFault;
334 Rc = lo;
335 }}, IntMultOp);
336 }
337
338 0x1c: decode INTFUNC {
339 0x00: decode RA { 31: sextb({{ Rc.sb = Rb_or_imm< 7:0>; }}); }
340 0x01: decode RA { 31: sextw({{ Rc.sw = Rb_or_imm<15:0>; }}); }
1// -*- mode:c++ -*-
2
3// Copyright (c) 2003-2006 The Regents of The University of Michigan
4// All rights reserved.
5//
6// Redistribution and use in source and binary forms, with or without
7// modification, are permitted provided that the following conditions are
8// met: redistributions of source code must retain the above copyright

--- 324 unchanged lines hidden (view full) ---

333 fault = new IntegerOverflowFault;
334 Rc = lo;
335 }}, IntMultOp);
336 }
337
338 0x1c: decode INTFUNC {
339 0x00: decode RA { 31: sextb({{ Rc.sb = Rb_or_imm< 7:0>; }}); }
340 0x01: decode RA { 31: sextw({{ Rc.sw = Rb_or_imm<15:0>; }}); }
341
342 0x30: ctpop({{
343 uint64_t count = 0;
344 for (int i = 0; Rb<63:i>; ++i) {
345 if (Rb<i:i> == 0x1)
346 ++count;
347 }
348 Rc = count;
349 }}, IntAluOp);
350
351 0x31: perr({{
352 uint64_t temp = 0;
353 int hi = 7;
354 int lo = 0;
355 for (int i = 0; i < 8; ++i) {
356 uint8_t ra_ub = Ra.uq<hi:lo>;
357 uint8_t rb_ub = Rb.uq<hi:lo>;
358 temp += (ra_ub >= rb_ub) ?
359 (ra_ub - rb_ub) : (rb_ub - ra_ub);
360 hi += 8;
361 lo += 8;
362 }
363 Rc = temp;
364 }});
365
341 0x32: ctlz({{
342 uint64_t count = 0;
343 uint64_t temp = Rb;
344 if (temp<63:32>) temp >>= 32; else count += 32;
345 if (temp<31:16>) temp >>= 16; else count += 16;
346 if (temp<15:8>) temp >>= 8; else count += 8;
347 if (temp<7:4>) temp >>= 4; else count += 4;
348 if (temp<3:2>) temp >>= 2; else count += 2;

--- 5 unchanged lines hidden (view full) ---

354 0x33: cttz({{
355 uint64_t count = 0;
356 uint64_t temp = Rb;
357 if (!(temp<31:0>)) { temp >>= 32; count += 32; }
358 if (!(temp<15:0>)) { temp >>= 16; count += 16; }
359 if (!(temp<7:0>)) { temp >>= 8; count += 8; }
360 if (!(temp<3:0>)) { temp >>= 4; count += 4; }
361 if (!(temp<1:0>)) { temp >>= 2; count += 2; }
366 0x32: ctlz({{
367 uint64_t count = 0;
368 uint64_t temp = Rb;
369 if (temp<63:32>) temp >>= 32; else count += 32;
370 if (temp<31:16>) temp >>= 16; else count += 16;
371 if (temp<15:8>) temp >>= 8; else count += 8;
372 if (temp<7:4>) temp >>= 4; else count += 4;
373 if (temp<3:2>) temp >>= 2; else count += 2;

--- 5 unchanged lines hidden (view full) ---

379 0x33: cttz({{
380 uint64_t count = 0;
381 uint64_t temp = Rb;
382 if (!(temp<31:0>)) { temp >>= 32; count += 32; }
383 if (!(temp<15:0>)) { temp >>= 16; count += 16; }
384 if (!(temp<7:0>)) { temp >>= 8; count += 8; }
385 if (!(temp<3:0>)) { temp >>= 4; count += 4; }
386 if (!(temp<1:0>)) { temp >>= 2; count += 2; }
387 if (!(temp<0:0> & ULL(0x1))) {
388 temp >>= 1; count += 1;
389 }
362 if (!(temp<0:0> & ULL(0x1))) count += 1;
363 Rc = count;
364 }}, IntAluOp);
365
390 if (!(temp<0:0> & ULL(0x1))) count += 1;
391 Rc = count;
392 }}, IntAluOp);
393
366 format FailUnimpl {
367 0x30: ctpop();
368 0x31: perr();
369 0x34: unpkbw();
370 0x35: unpkbl();
371 0x36: pkwb();
372 0x37: pklb();
373 0x38: minsb8();
374 0x39: minsw4();
375 0x3a: minub8();
376 0x3b: minuw4();
377 0x3c: maxub8();
378 0x3d: maxuw4();
379 0x3e: maxsb8();
380 0x3f: maxsw4();
381 }
382
394
395 0x34: unpkbw({{
396 Rc = (Rb.uq<7:0>
397 | (Rb.uq<15:8> << 16)
398 | (Rb.uq<23:16> << 32)
399 | (Rb.uq<31:24> << 48));
400 }}, IntAluOp);
401
402 0x35: unpkbl({{
403 Rc = (Rb.uq<7:0> | (Rb.uq<15:8> << 32));
404 }}, IntAluOp);
405
406 0x36: pkwb({{
407 Rc = (Rb.uq<7:0>
408 | (Rb.uq<23:16> << 8)
409 | (Rb.uq<39:32> << 16)
410 | (Rb.uq<55:48> << 24));
411 }}, IntAluOp);
412
413 0x37: pklb({{
414 Rc = (Rb.uq<7:0> | (Rb.uq<39:32> << 8));
415 }}, IntAluOp);
416
417 0x38: minsb8({{
418 uint64_t temp = 0;
419 int hi = 63;
420 int lo = 56;
421 for (int i = 7; i >= 0; --i) {
422 int8_t ra_sb = Ra.uq<hi:lo>;
423 int8_t rb_sb = Rb.uq<hi:lo>;
424 temp = ((temp << 8)
425 | ((ra_sb < rb_sb) ? Ra.uq<hi:lo>
426 : Rb.uq<hi:lo>));
427 hi -= 8;
428 lo -= 8;
429 }
430 Rc = temp;
431 }});
432
433 0x39: minsw4({{
434 uint64_t temp = 0;
435 int hi = 63;
436 int lo = 48;
437 for (int i = 3; i >= 0; --i) {
438 int16_t ra_sw = Ra.uq<hi:lo>;
439 int16_t rb_sw = Rb.uq<hi:lo>;
440 temp = ((temp << 16)
441 | ((ra_sw < rb_sw) ? Ra.uq<hi:lo>
442 : Rb.uq<hi:lo>));
443 hi -= 16;
444 lo -= 16;
445 }
446 Rc = temp;
447 }});
448
449 0x3a: minub8({{
450 uint64_t temp = 0;
451 int hi = 63;
452 int lo = 56;
453 for (int i = 7; i >= 0; --i) {
454 uint8_t ra_ub = Ra.uq<hi:lo>;
455 uint8_t rb_ub = Rb.uq<hi:lo>;
456 temp = ((temp << 8)
457 | ((ra_ub < rb_ub) ? Ra.uq<hi:lo>
458 : Rb.uq<hi:lo>));
459 hi -= 8;
460 lo -= 8;
461 }
462 Rc = temp;
463 }});
464
465 0x3b: minuw4({{
466 uint64_t temp = 0;
467 int hi = 63;
468 int lo = 48;
469 for (int i = 3; i >= 0; --i) {
470 uint16_t ra_sw = Ra.uq<hi:lo>;
471 uint16_t rb_sw = Rb.uq<hi:lo>;
472 temp = ((temp << 16)
473 | ((ra_sw < rb_sw) ? Ra.uq<hi:lo>
474 : Rb.uq<hi:lo>));
475 hi -= 16;
476 lo -= 16;
477 }
478 Rc = temp;
479 }});
480
481 0x3c: maxub8({{
482 uint64_t temp = 0;
483 int hi = 63;
484 int lo = 56;
485 for (int i = 7; i >= 0; --i) {
486 uint8_t ra_ub = Ra.uq<hi:lo>;
487 uint8_t rb_ub = Rb.uq<hi:lo>;
488 temp = ((temp << 8)
489 | ((ra_ub > rb_ub) ? Ra.uq<hi:lo>
490 : Rb.uq<hi:lo>));
491 hi -= 8;
492 lo -= 8;
493 }
494 Rc = temp;
495 }});
496
497 0x3d: maxuw4({{
498 uint64_t temp = 0;
499 int hi = 63;
500 int lo = 48;
501 for (int i = 3; i >= 0; --i) {
502 uint16_t ra_uw = Ra.uq<hi:lo>;
503 uint16_t rb_uw = Rb.uq<hi:lo>;
504 temp = ((temp << 16)
505 | ((ra_uw > rb_uw) ? Ra.uq<hi:lo>
506 : Rb.uq<hi:lo>));
507 hi -= 16;
508 lo -= 16;
509 }
510 Rc = temp;
511 }});
512
513 0x3e: maxsb8({{
514 uint64_t temp = 0;
515 int hi = 63;
516 int lo = 56;
517 for (int i = 7; i >= 0; --i) {
518 int8_t ra_sb = Ra.uq<hi:lo>;
519 int8_t rb_sb = Rb.uq<hi:lo>;
520 temp = ((temp << 8)
521 | ((ra_sb > rb_sb) ? Ra.uq<hi:lo>
522 : Rb.uq<hi:lo>));
523 hi -= 8;
524 lo -= 8;
525 }
526 Rc = temp;
527 }});
528
529 0x3f: maxsw4({{
530 uint64_t temp = 0;
531 int hi = 63;
532 int lo = 48;
533 for (int i = 3; i >= 0; --i) {
534 int16_t ra_sw = Ra.uq<hi:lo>;
535 int16_t rb_sw = Rb.uq<hi:lo>;
536 temp = ((temp << 16)
537 | ((ra_sw > rb_sw) ? Ra.uq<hi:lo>
538 : Rb.uq<hi:lo>));
539 hi -= 16;
540 lo -= 16;
541 }
542 Rc = temp;
543 }});
544
383 format BasicOperateWithNopCheck {
384 0x70: decode RB {
385 31: ftoit({{ Rc = Fa.uq; }}, FloatCvtOp);
386 }
387 0x78: decode RB {
388 31: ftois({{ Rc.sl = t_to_s(Fa.uq); }},
389 FloatCvtOp);
390 }

--- 553 unchanged lines hidden ---
545 format BasicOperateWithNopCheck {
546 0x70: decode RB {
547 31: ftoit({{ Rc = Fa.uq; }}, FloatCvtOp);
548 }
549 0x78: decode RB {
550 31: ftois({{ Rc.sl = t_to_s(Fa.uq); }},
551 FloatCvtOp);
552 }

--- 553 unchanged lines hidden ---