| 1 | //cxx . . $ `<file>/arch/x86_64/fpu/div_32.h`/ |
| 2 | // arch/x86_64/fpu/div_32.h |
| 3 | // |
| 4 | // This file is subject to the terms and conditions defined in |
| 5 | // 'LICENSE', which is part of this source code package. |
| 6 | // |
| 7 | |
| 8 | #include "common.h"cxx . . $ `<file>/build/common.h`/ |
| 9 | #include <emmintrin.h> |
| 10 | #include <string.h> |
| 11 | |
| 12 | static inline void fpu_div_32cxx . . $ fpu_div_32(c9369c0e89cfb520).( |
| 13 | const uint32_tcxx . . $ uint32_t# *fs, const uint32_tcxx . . $ uint32_t# *ft, uint32_tcxx . . $ uint32_t# *fd) { |
| 14 | float fs_float, ft_float, fd_float; |
| 15 | __m128cxx . . $ __m128# fs_reg, ft_reg, fd_reg; |
| 16 | |
| 17 | // Prevent aliasing. |
| 18 | memcpycxx . . $ memcpy(cc817cb175f282d).(&fs_float, fs, sizeof(fs_float)); |
| 19 | memcpycxx . . $ memcpy(cc817cb175f282d).(&ft_float, ft, sizeof(ft_float)); |
| 20 | |
| 21 | fs_reg = _mm_set_sscxx . . $ _mm_set_ss(975dd02a9c095bb9).(fs_float); |
| 22 | ft_reg = _mm_set_sscxx . . $ _mm_set_ss(975dd02a9c095bb9).(ft_float); |
| 23 | fd_reg = _mm_div_sscxx . . $ _mm_div_ss(359170f1c294161a).(fs_reg, ft_reg); |
| 24 | fd_float = _mm_cvtss_f32cxx . . $ _mm_cvtss_f32(ed160c24a2b465d1).(fd_reg); |
| 25 | |
| 26 | // Prevent aliasing. |
| 27 | memcpycxx . . $ memcpy(cc817cb175f282d).(fd, &fd_float, sizeof(fd_float)); |
| 28 | } |
| 29 |