soaXf2.h (1139B)
1 /* Copyright (C) 2014-2019, 2021, 2023, 2025 Vincent Forest (vaplv@free.fr) 2 * 3 * The RSIMD library is free software: you can redistribute it and/or modify 4 * it under the terms of the GNU General Public License as published 5 * by the Free Software Foundation, either version 3 of the License, or 6 * (at your option) any later version. 7 * 8 * The RSIMD library is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * GNU General Public License for more details. 12 * 13 * You should have received a copy of the GNU General Public License 14 * along with the RSIMD library. If not, see <http://www.gnu.org/licenses/>. */ 15 16 #ifndef RSIMD_WIDTH__ 17 #error "Undefined RSIMD_WIDTH__ macro" 18 #endif 19 20 #define RSIMD_SOA_DIMENSION__ 2 21 #include "soaXfY_begin.h" 22 #include "soaXfY.h" 23 24 static FINLINE RSIMD_vXf_T__ 25 RSIMD_soaXfY__(cross)(const RSIMD_vXf_T__ a[2], const RSIMD_vXf_T__ b[2]) 26 { 27 ASSERT(a && b); 28 return RSIMD_vXf__(sub) 29 (RSIMD_vXf__(mul)(a[0], b[1]), 30 RSIMD_vXf__(mul)(a[1], b[0])); 31 } 32 33 #include "soaXfY_end.h"