vis_helper.c (9157dccc7e71f7c94581c38f38acbef9a21bbe9a) | vis_helper.c (a859602c746baf4892cc8ca1ce003e92411d1716) |
---|---|
1/* 2 * VIS op helpers 3 * 4 * Copyright (c) 2003-2005 Fabrice Bellard 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 --- 105 unchanged lines hidden (view full) --- 114 PMUL(1); 115 PMUL(2); 116 PMUL(3); 117#undef PMUL 118 119 return d.ll; 120} 121 | 1/* 2 * VIS op helpers 3 * 4 * Copyright (c) 2003-2005 Fabrice Bellard 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 --- 105 unchanged lines hidden (view full) --- 114 PMUL(1); 115 PMUL(2); 116 PMUL(3); 117#undef PMUL 118 119 return d.ll; 120} 121 |
122uint64_t helper_fmul8x16al(uint64_t src1, uint64_t src2) | 122uint64_t helper_fmul8x16a(uint32_t src1, int32_t src2) |
123{ | 123{ |
124 VIS64 s, d; | 124 VIS32 s; 125 VIS64 d; |
125 uint32_t tmp; 126 | 126 uint32_t tmp; 127 |
127 s.ll = src1; 128 d.ll = src2; | 128 s.l = src1; 129 d.ll = 0; |
129 | 130 |
130#define PMUL(r) \ 131 tmp = (int32_t)d.VIS_SW64(1) * (int32_t)s.VIS_B64(r); \ 132 if ((tmp & 0xff) > 0x7f) { \ 133 tmp += 0x100; \ 134 } \ 135 d.VIS_W64(r) = tmp >> 8; | 131#define PMUL(r) \ 132 do { \ 133 tmp = src2 * (int32_t)s.VIS_B32(r); \ 134 if ((tmp & 0xff) > 0x7f) { \ 135 tmp += 0x100; \ 136 } \ 137 d.VIS_W64(r) = tmp >> 8; \ 138 } while (0) |
136 137 PMUL(0); 138 PMUL(1); 139 PMUL(2); 140 PMUL(3); 141#undef PMUL 142 143 return d.ll; 144} 145 | 139 140 PMUL(0); 141 PMUL(1); 142 PMUL(2); 143 PMUL(3); 144#undef PMUL 145 146 return d.ll; 147} 148 |
146uint64_t helper_fmul8x16au(uint64_t src1, uint64_t src2) 147{ 148 VIS64 s, d; 149 uint32_t tmp; 150 151 s.ll = src1; 152 d.ll = src2; 153 154#define PMUL(r) \ 155 tmp = (int32_t)d.VIS_SW64(0) * (int32_t)s.VIS_B64(r); \ 156 if ((tmp & 0xff) > 0x7f) { \ 157 tmp += 0x100; \ 158 } \ 159 d.VIS_W64(r) = tmp >> 8; 160 161 PMUL(0); 162 PMUL(1); 163 PMUL(2); 164 PMUL(3); 165#undef PMUL 166 167 return d.ll; 168} 169 | |
170uint64_t helper_fmul8sux16(uint64_t src1, uint64_t src2) 171{ 172 VIS64 s, d; 173 uint32_t tmp; 174 175 s.ll = src1; 176 d.ll = src2; 177 --- 255 unchanged lines hidden --- | 149uint64_t helper_fmul8sux16(uint64_t src1, uint64_t src2) 150{ 151 VIS64 s, d; 152 uint32_t tmp; 153 154 s.ll = src1; 155 d.ll = src2; 156 --- 255 unchanged lines hidden --- |