1*008a3b16SSong Gao /* SPDX-License-Identifier: GPL-2.0-or-later */ 2*008a3b16SSong Gao /* 3*008a3b16SSong Gao * QEMU LoongArch vector utilitites 4*008a3b16SSong Gao * 5*008a3b16SSong Gao * Copyright (c) 2023 Loongson Technology Corporation Limited 6*008a3b16SSong Gao */ 7*008a3b16SSong Gao 8*008a3b16SSong Gao #ifndef LOONGARCH_VEC_H 9*008a3b16SSong Gao #define LOONGARCH_VEC_H 10*008a3b16SSong Gao 11*008a3b16SSong Gao #if HOST_BIG_ENDIAN 12*008a3b16SSong Gao #define B(x) B[(x) ^ 15] 13*008a3b16SSong Gao #define H(x) H[(x) ^ 7] 14*008a3b16SSong Gao #define W(x) W[(x) ^ 3] 15*008a3b16SSong Gao #define D(x) D[(x) ^ 1] 16*008a3b16SSong Gao #define UB(x) UB[(x) ^ 15] 17*008a3b16SSong Gao #define UH(x) UH[(x) ^ 7] 18*008a3b16SSong Gao #define UW(x) UW[(x) ^ 3] 19*008a3b16SSong Gao #define UD(x) UD[(x) ^ 1] 20*008a3b16SSong Gao #define Q(x) Q[x] 21*008a3b16SSong Gao #else 22*008a3b16SSong Gao #define B(x) B[x] 23*008a3b16SSong Gao #define H(x) H[x] 24*008a3b16SSong Gao #define W(x) W[x] 25*008a3b16SSong Gao #define D(x) D[x] 26*008a3b16SSong Gao #define UB(x) UB[x] 27*008a3b16SSong Gao #define UH(x) UH[x] 28*008a3b16SSong Gao #define UW(x) UW[x] 29*008a3b16SSong Gao #define UD(x) UD[x] 30*008a3b16SSong Gao #define Q(x) Q[x] 31*008a3b16SSong Gao #endif /* HOST_BIG_ENDIAN */ 32*008a3b16SSong Gao 33*008a3b16SSong Gao #endif /* LOONGARCH_VEC_H */ 34