fplib.cc (10104:ff709c429b7b) | fplib.cc (10272:336c7d36ac00) |
---|---|
1/* 2* Copyright (c) 2012-2013 ARM Limited 3* All rights reserved 4* 5* The license below extends only to copyright in the software and shall 6* not be construed as granting a license to any other intellectual 7* property including but not limited to intellectual property relating 8* to a hardware implementation of the functionality of the software --- 142 unchanged lines hidden (view full) --- 151{ 152 uint64_t t0 = (uint64_t)(uint32_t)a * b; 153 uint64_t t1 = (t0 >> 32) + (a >> 32) * b; 154 *x0 = t1 << 32 | (uint32_t)t0; 155 *x1 = t1 >> 32; 156} 157 158static inline void | 1/* 2* Copyright (c) 2012-2013 ARM Limited 3* All rights reserved 4* 5* The license below extends only to copyright in the software and shall 6* not be construed as granting a license to any other intellectual 7* property including but not limited to intellectual property relating 8* to a hardware implementation of the functionality of the software --- 142 unchanged lines hidden (view full) --- 151{ 152 uint64_t t0 = (uint64_t)(uint32_t)a * b; 153 uint64_t t1 = (t0 >> 32) + (a >> 32) * b; 154 *x0 = t1 << 32 | (uint32_t)t0; 155 *x1 = t1 >> 32; 156} 157 158static inline void |
159mul64x64(uint64_t *x0, uint64_t *x1, uint64_t a, uint64_t b) 160{ 161 uint64_t a0 = (uint32_t)a; 162 uint64_t a1 = a >> 32; 163 uint64_t b0 = (uint32_t)b; 164 uint64_t b1 = b >> 32; 165 uint64_t t1 = (a0 * b0 >> 32) + a1 * b0; 166 uint64_t t2 = a0 * b1; 167 uint64_t x = ((uint64_t)(uint32_t)t1 + (uint32_t)t2) >> 32; 168 x += t1 >> 32; 169 x += t2 >> 32; 170 x += a1 * b1; 171 *x0 = a * b; 172 *x1 = x; 173} 174 175static inline void | |
176add128(uint64_t *x0, uint64_t *x1, uint64_t a0, uint64_t a1, uint64_t b0, 177 uint64_t b1) 178{ 179 *x0 = a0 + b0; 180 *x1 = a1 + b1 + (*x0 < a0); 181} 182 183static inline void --- 2903 unchanged lines hidden --- | 159add128(uint64_t *x0, uint64_t *x1, uint64_t a0, uint64_t a1, uint64_t b0, 160 uint64_t b1) 161{ 162 *x0 = a0 + b0; 163 *x1 = a1 + b1 + (*x0 < a0); 164} 165 166static inline void --- 2903 unchanged lines hidden --- |