op_helper.c (1b3cb7c874bd92d6022f4f99b16531f66148d905) | op_helper.c (3bbb8e4832b56cea29a61eb32cfb4931e00244c1) |
---|---|
1/* 2 * Helpers for HPPA instructions. 3 * 4 * Copyright (c) 2016 Richard Henderson <rth@twiddle.net> 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either --- 441 unchanged lines hidden (view full) --- 450 int fr = f1 - f2; 451 452 fr = MIN(fr, UINT16_MAX); 453 fr = MAX(fr, 0); 454 ret = deposit64(ret, i, 16, fr); 455 } 456 return ret; 457} | 1/* 2 * Helpers for HPPA instructions. 3 * 4 * Copyright (c) 2016 Richard Henderson <rth@twiddle.net> 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either --- 441 unchanged lines hidden (view full) --- 450 int fr = f1 - f2; 451 452 fr = MIN(fr, UINT16_MAX); 453 fr = MAX(fr, 0); 454 ret = deposit64(ret, i, 16, fr); 455 } 456 return ret; 457} |
458 459uint64_t HELPER(hshladd)(uint64_t r1, uint64_t r2, uint32_t sh) 460{ 461 uint64_t ret = 0; 462 463 for (int i = 0; i < 64; i += 16) { 464 int f1 = sextract64(r1, i, 16); 465 int f2 = sextract64(r2, i, 16); 466 int fr = (f1 << sh) + f2; 467 468 fr = MIN(fr, INT16_MAX); 469 fr = MAX(fr, INT16_MIN); 470 ret = deposit64(ret, i, 16, fr); 471 } 472 return ret; 473} 474 475uint64_t HELPER(hshradd)(uint64_t r1, uint64_t r2, uint32_t sh) 476{ 477 uint64_t ret = 0; 478 479 for (int i = 0; i < 64; i += 16) { 480 int f1 = sextract64(r1, i, 16); 481 int f2 = sextract64(r2, i, 16); 482 int fr = (f1 >> sh) + f2; 483 484 fr = MIN(fr, INT16_MAX); 485 fr = MAX(fr, INT16_MIN); 486 ret = deposit64(ret, i, 16, fr); 487 } 488 return ret; 489} |
|