Debian Codegraph @

lvgl/src/draw/sw/blend/riscv_v/lv_blend_riscv_v_private.h

raw symbols SCIP
1 /**
2 * @file lv_blend_riscv_v_private.h
3 * Common macros and utilities for RISC-V Vector Extension (RVV 1.0) blend operations
4 *
5 * This header provides reusable RVV macros for:
6 * - Segmented load/store operations (RGB888/XRGB8888/RGB565)
7 * - Alpha blending with scalar or vector alpha
8 * - Color format conversions (RGB565 <-> RGB888)
9 * - Effective alpha calculations (alpha, mask, opa combinations)
10 */
11
12 #ifndef LV_BLEND_RISCV_V_PRIVATE_H
13 #define LV_BLEND_RISCV_V_PRIVATE_H
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
19 /*********************
20 * INCLUDES
21 *********************/
22
23 #include "../../../../lv_conf_internal.h"
24 #if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_RISCV_V
25
26 /* Try to use real RVV, fall back to emulation if not available */
27 #ifdef __riscv_v
28 #include <riscv_vector.h>
29 #else
30 /* No real RVV available, use emulation */
31 #include "lv_blend_riscv_vector_emulation.h"
32 #endif
33
34 /*********************
35 * DEFINES
36 *********************/
37
38 /**********************
39 * RVV SEGMENTED LOAD/STORE MACROS
40 *
41 * Emulate segmented load/store using stride operations.
42 * Compatible with compilers that don't support RVV 1.0 tuple types.
43 **********************/
44
45 /* RGB888: 3 channels (B,G,R) with stride=3 */
46 #define LV_RVV_VLSEG3E8_U8M2(base, vl, v_b, v_g, v_r) \
47 do { \
48 (v_b) = __riscv_vlse8_v_u8m2((base) + 0, 3, (vl)); \
49 (v_g) = __riscv_vlse8_v_u8m2((base) + 1, 3, (vl)); \
50 (v_r) = __riscv_vlse8_v_u8m2((base) + 2, 3, (vl)); \
51 } while(0)
52
53 #define LV_RVV_VSSEG3E8_U8M2(base, v_b, v_g, v_r, vl) \
54 do { \
55 __riscv_vsse8_v_u8m2((base) + 0, 3, (v_b), (vl)); \
56 __riscv_vsse8_v_u8m2((base) + 1, 3, (v_g), (vl)); \
57 __riscv_vsse8_v_u8m2((base) + 2, 3, (v_r), (vl)); \
58 } while(0)
59
60 /* XRGB8888/ARGB8888: 4 channels (B,G,R,X) with stride=4 */
61 #define LV_RVV_VLSEG4E8_U8M2(base, vl, v_b, v_g, v_r, v_x) \
62 do { \
63 (v_b) = __riscv_vlse8_v_u8m2((base) + 0, 4, (vl)); \
64 (v_g) = __riscv_vlse8_v_u8m2((base) + 1, 4, (vl)); \
65 (v_r) = __riscv_vlse8_v_u8m2((base) + 2, 4, (vl)); \
66 (v_x) = __riscv_vlse8_v_u8m2((base) + 3, 4, (vl)); \
67 } while(0)
68
69 #define LV_RVV_VSSEG4E8_U8M2(base, v_b, v_g, v_r, v_x, vl) \
70 do { \
71 __riscv_vsse8_v_u8m2((base) + 0, 4, (v_b), (vl)); \
72 __riscv_vsse8_v_u8m2((base) + 1, 4, (v_g), (vl)); \
73 __riscv_vsse8_v_u8m2((base) + 2, 4, (v_r), (vl)); \
74 __riscv_vsse8_v_u8m2((base) + 3, 4, (v_x), (vl)); \
75 } while(0)
76
77 /**********************
78 * RGB565 <-> RGB888 CONVERSION MACROS
79 *
80 * RGB565 format: RRRRRGGGGGGBBBBB (5-6-5 bits)
81 * Conversion formulas:
82 * R8 = (R5 * 2106) >> 8 (2106 ≈ 255/31 * 256)
83 * G8 = (G6 * 1037) >> 8 (1037 ≈ 255/63 * 256)
84 * B8 = (B5 * 2106) >> 8
85 **********************/
86
87 /* Extract and convert RGB565 to separate R8, G8, B8 channels (16-bit width) */
88 #define LV_RVV_RGB565_TO_RGB888_U16M2(v_rgb565, v_r8, v_g8, v_b8, vl) \
89 do { \
90 vuint16m2_t _r5 = __riscv_vand_vx_u16m2(__riscv_vsrl_vx_u16m2((v_rgb565), 11, (vl)), 0x1F, (vl)); \
91 vuint16m2_t _g6 = __riscv_vand_vx_u16m2(__riscv_vsrl_vx_u16m2((v_rgb565), 5, (vl)), 0x3F, (vl)); \
92 vuint16m2_t _b5 = __riscv_vand_vx_u16m2((v_rgb565), 0x1F, (vl)); \
93 (v_r8) = __riscv_vsrl_vx_u16m2(__riscv_vmul_vx_u16m2(_r5, 2106, (vl)), 8, (vl)); \
94 (v_g8) = __riscv_vsrl_vx_u16m2(__riscv_vmul_vx_u16m2(_g6, 1037, (vl)), 8, (vl)); \
95 (v_b8) = __riscv_vsrl_vx_u16m2(__riscv_vmul_vx_u16m2(_b5, 2106, (vl)), 8, (vl)); \
96 } while(0)
97
98 /* Convert R8, G8, B8 to RGB565 (16-bit) */
99 #define LV_RVV_RGB888_TO_RGB565_U16M2(v_r8, v_g8, v_b8, v_rgb565, vl) \
100 do { \
101 vuint16m2_t _r5 = __riscv_vsrl_vx_u16m2((v_r8), 3, (vl)); \
102 vuint16m2_t _g6 = __riscv_vsrl_vx_u16m2((v_g8), 2, (vl)); \
103 vuint16m2_t _b5 = __riscv_vsrl_vx_u16m2((v_b8), 3, (vl)); \
104 (v_rgb565) = __riscv_vor_vv_u16m2(__riscv_vsll_vx_u16m2(_r5, 11, (vl)), \
105 __riscv_vor_vv_u16m2(__riscv_vsll_vx_u16m2(_g6, 5, (vl)), _b5, (vl)), (vl)); \
106 } while(0)
107
108 /**********************
109 * ALPHA BLENDING MACROS
110 *
111 * Standard blend formula: result = (src * alpha + dst * (255 - alpha)) >> 8
112 *
113 * Using vwmaccu (widening multiply-accumulate unsigned):
114 * tmp = dst * (255 - alpha) // Initialize with dst contribution
115 * tmp = tmp + src * alpha // vwmaccu adds src contribution
116 * result = tmp >> 8
117 *
118 * This reduces operations by combining multiply and add.
119 **********************/
120
121 /**
122 * Blend single channel using vwmaccu (8-bit src/dst -> 16-bit intermediate)
123 * LMUL relationship: m1 -> m2, m2 -> m4
124 */
125 #define LV_RVV_BLEND_CHANNEL_U8M1_TO_U16M2(v_src, v_dst, alpha, v_result, vl) \
126 do { \
127 uint8_t _alpha_inv = 255 - (alpha); \
128 vuint16m2_t _tmp = __riscv_vwmulu_vx_u16m2((v_dst), _alpha_inv, (vl)); \
129 _tmp = __riscv_vwmaccu_vx_u16m2(_tmp, (alpha), (v_src), (vl)); \
130 (v_result) = __riscv_vnsrl_wx_u8m1(_tmp, 8, (vl)); \
131 } while(0)
132
133 #define LV_RVV_BLEND_CHANNEL_U8M2_TO_U16M4(v_src, v_dst, alpha, v_result, vl) \
134 do { \
135 uint8_t _alpha_inv = 255 - (alpha); \
136 vuint16m4_t _tmp = __riscv_vwmulu_vx_u16m4((v_dst), _alpha_inv, (vl)); \
137 _tmp = __riscv_vwmaccu_vx_u16m4(_tmp, (alpha), (v_src), (vl)); \
138 (v_result) = __riscv_vnsrl_wx_u8m2(_tmp, 8, (vl)); \
139 } while(0)
140
141 /**
142 * Blend single channel with vector alpha (per-pixel mask)
143 */
144 #define LV_RVV_BLEND_CHANNEL_VMASK_U8M1_TO_U16M2(v_src, v_dst, v_alpha, v_result, vl) \
145 do { \
146 vuint8m1_t _v_alpha_inv = __riscv_vrsub_vx_u8m1((v_alpha), 255, (vl)); \
147 vuint16m2_t _tmp = __riscv_vwmulu_vv_u16m2((v_dst), _v_alpha_inv, (vl)); \
148 _tmp = __riscv_vwmaccu_vv_u16m2(_tmp, (v_alpha), (v_src), (vl)); \
149 (v_result) = __riscv_vnsrl_wx_u8m1(_tmp, 8, (vl)); \
150 } while(0)
151
152 #define LV_RVV_BLEND_CHANNEL_VMASK_U8M2_TO_U16M4(v_src, v_dst, v_alpha, v_result, vl) \
153 do { \
154 vuint8m2_t _v_alpha_inv = __riscv_vrsub_vx_u8m2((v_alpha), 255, (vl)); \
155 vuint16m4_t _tmp = __riscv_vwmulu_vv_u16m4((v_dst), _v_alpha_inv, (vl)); \
156 _tmp = __riscv_vwmaccu_vv_u16m4(_tmp, (v_alpha), (v_src), (vl)); \
157 (v_result) = __riscv_vnsrl_wx_u8m2(_tmp, 8, (vl)); \
158 } while(0)
159
160 /**
161 * Blend RGB channels with scalar alpha (all 3 channels at once)
162 * Uses m1->m2 widening
163 */
164 #define LV_RVV_BLEND_RGB_U8M1(v_src_r, v_src_g, v_src_b, v_dst_r, v_dst_g, v_dst_b, \
165 alpha, v_out_r, v_out_g, v_out_b, vl) \
166 do { \
167 LV_RVV_BLEND_CHANNEL_U8M1_TO_U16M2((v_src_r), (v_dst_r), (alpha), (v_out_r), (vl)); \
168 LV_RVV_BLEND_CHANNEL_U8M1_TO_U16M2((v_src_g), (v_dst_g), (alpha), (v_out_g), (vl)); \
169 LV_RVV_BLEND_CHANNEL_U8M1_TO_U16M2((v_src_b), (v_dst_b), (alpha), (v_out_b), (vl)); \
170 } while(0)
171
172 /**
173 * Blend RGB channels with scalar alpha (all 3 channels at once)
174 * Uses m2->m4 widening
175 */
176 #define LV_RVV_BLEND_RGB_U8M2(v_src_r, v_src_g, v_src_b, v_dst_r, v_dst_g, v_dst_b, \
177 alpha, v_out_r, v_out_g, v_out_b, vl) \
178 do { \
179 LV_RVV_BLEND_CHANNEL_U8M2_TO_U16M4((v_src_r), (v_dst_r), (alpha), (v_out_r), (vl)); \
180 LV_RVV_BLEND_CHANNEL_U8M2_TO_U16M4((v_src_g), (v_dst_g), (alpha), (v_out_g), (vl)); \
181 LV_RVV_BLEND_CHANNEL_U8M2_TO_U16M4((v_src_b), (v_dst_b), (alpha), (v_out_b), (vl)); \
182 } while(0)
183
184 /**
185 * Blend solid color (pre-multiplied) with destination RGB channels
186 * fg_color_opa: pre-computed (color * opa) for each channel
187 * opa_inv: 255 - opa
188 * Formula: result = (dst * opa_inv + fg_color_opa) >> 8
189 * Uses m2->m4 widening
190 */
191 #define LV_RVV_BLEND_SOLID_RGB_U8M2(v_dst_r, v_dst_g, v_dst_b, \
192 fg_r_opa, fg_g_opa, fg_b_opa, opa_inv, \
193 v_out_r, v_out_g, v_out_b, vl) \
194 do { \
195 vuint16m4_t _v_r16 = __riscv_vwmulu_vx_u16m4((v_dst_r), (opa_inv), (vl)); \
196 vuint16m4_t _v_g16 = __riscv_vwmulu_vx_u16m4((v_dst_g), (opa_inv), (vl)); \
197 vuint16m4_t _v_b16 = __riscv_vwmulu_vx_u16m4((v_dst_b), (opa_inv), (vl)); \
198 _v_r16 = __riscv_vadd_vx_u16m4(_v_r16, (fg_r_opa), (vl)); \
199 _v_g16 = __riscv_vadd_vx_u16m4(_v_g16, (fg_g_opa), (vl)); \
200 _v_b16 = __riscv_vadd_vx_u16m4(_v_b16, (fg_b_opa), (vl)); \
201 (v_out_r) = __riscv_vnsrl_wx_u8m2(_v_r16, 8, (vl)); \
202 (v_out_g) = __riscv_vnsrl_wx_u8m2(_v_g16, 8, (vl)); \
203 (v_out_b) = __riscv_vnsrl_wx_u8m2(_v_b16, 8, (vl)); \
204 } while(0)
205
206 /**
207 * Blend solid color (scalar) with destination RGB channels using vector alpha mask
208 * fg_r/g/b: foreground color scalar values
209 * v_alpha: per-pixel alpha values (vuint8m2_t)
210 * Formula: result = (fg * alpha + dst * (255 - alpha)) >> 8
211 * Uses m2->m4 widening with vwmaccu for efficiency
212 */
213 #define LV_RVV_BLEND_SOLID_RGB_VMASK_U8M2(v_dst_r, v_dst_g, v_dst_b, \
214 fg_r, fg_g, fg_b, v_alpha, \
215 v_out_r, v_out_g, v_out_b, vl) \
216 do { \
217 vuint8m2_t _v_alpha_inv = __riscv_vrsub_vx_u8m2((v_alpha), 255, (vl)); \
218 vuint16m4_t _v_r16 = __riscv_vwmulu_vv_u16m4((v_dst_r), _v_alpha_inv, (vl)); \
219 vuint16m4_t _v_g16 = __riscv_vwmulu_vv_u16m4((v_dst_g), _v_alpha_inv, (vl)); \
220 vuint16m4_t _v_b16 = __riscv_vwmulu_vv_u16m4((v_dst_b), _v_alpha_inv, (vl)); \
221 _v_r16 = __riscv_vwmaccu_vx_u16m4(_v_r16, (fg_r), (v_alpha), (vl)); \
222 _v_g16 = __riscv_vwmaccu_vx_u16m4(_v_g16, (fg_g), (v_alpha), (vl)); \
223 _v_b16 = __riscv_vwmaccu_vx_u16m4(_v_b16, (fg_b), (v_alpha), (vl)); \
224 (v_out_r) = __riscv_vnsrl_wx_u8m2(_v_r16, 8, (vl)); \
225 (v_out_g) = __riscv_vnsrl_wx_u8m2(_v_g16, 8, (vl)); \
226 (v_out_b) = __riscv_vnsrl_wx_u8m2(_v_b16, 8, (vl)); \
227 } while(0)
228
229 /**
230 * Blend RGB channels with vector alpha (per-pixel mask)
231 */
232 #define LV_RVV_BLEND_RGB_VMASK_U8M1(v_src_r, v_src_g, v_src_b, v_dst_r, v_dst_g, v_dst_b, \
233 v_alpha, v_out_r, v_out_g, v_out_b, vl) \
234 do { \
235 LV_RVV_BLEND_CHANNEL_VMASK_U8M1_TO_U16M2((v_src_r), (v_dst_r), (v_alpha), (v_out_r), (vl)); \
236 LV_RVV_BLEND_CHANNEL_VMASK_U8M1_TO_U16M2((v_src_g), (v_dst_g), (v_alpha), (v_out_g), (vl)); \
237 LV_RVV_BLEND_CHANNEL_VMASK_U8M1_TO_U16M2((v_src_b), (v_dst_b), (v_alpha), (v_out_b), (vl)); \
238 } while(0)
239
240 /**
241 * Optimize blend results for zero and full mask cases (u8m1)
242 * When mask is 0, use destination; when mask is >= 255, use source
243 */
244 #define LV_RVV_BLEND_OPTIMIZE_MASK_U8M1(v_r, v_g, v_b, v_src_r, v_src_g, v_src_b, \
245 v_dst_r, v_dst_g, v_dst_b, v_mask, vl) \
246 do { \
247 vbool8_t _zero_mask = __riscv_vmseq_vx_u8m1_b8((v_mask), 0, (vl)); \
248 vbool8_t _full_mask = __riscv_vmsgeu_vx_u8m1_b8((v_mask), LV_OPA_MAX, (vl)); \
249 (v_b) = __riscv_vmerge_vvm_u8m1((v_b), (v_dst_b), _zero_mask, (vl)); \
250 (v_g) = __riscv_vmerge_vvm_u8m1((v_g), (v_dst_g), _zero_mask, (vl)); \
251 (v_r) = __riscv_vmerge_vvm_u8m1((v_r), (v_dst_r), _zero_mask, (vl)); \
252 (v_b) = __riscv_vmerge_vvm_u8m1((v_b), (v_src_b), _full_mask, (vl)); \
253 (v_g) = __riscv_vmerge_vvm_u8m1((v_g), (v_src_g), _full_mask, (vl)); \
254 (v_r) = __riscv_vmerge_vvm_u8m1((v_r), (v_src_r), _full_mask, (vl)); \
255 } while(0)
256
257 /**
258 * Optimize blend results for zero and full mask cases (u8m2) with scalar source
259 * When mask is 0, use destination; when mask is >= 255, use scalar source
260 */
261 #define LV_RVV_BLEND_OPTIMIZE_MASK_SCALAR_U8M2(v_r, v_g, v_b, src_r, src_g, src_b, \
262 v_dst_r, v_dst_g, v_dst_b, v_mask, vl) \
263 do { \
264 vbool4_t _zero_mask = __riscv_vmseq_vx_u8m2_b4((v_mask), 0, (vl)); \
265 vbool4_t _full_mask = __riscv_vmsgeu_vx_u8m2_b4((v_mask), LV_OPA_MAX, (vl)); \
266 (v_b) = __riscv_vmerge_vvm_u8m2((v_b), (v_dst_b), _zero_mask, (vl)); \
267 (v_g) = __riscv_vmerge_vvm_u8m2((v_g), (v_dst_g), _zero_mask, (vl)); \
268 (v_r) = __riscv_vmerge_vvm_u8m2((v_r), (v_dst_r), _zero_mask, (vl)); \
269 (v_b) = __riscv_vmerge_vxm_u8m2((v_b), (src_b), _full_mask, (vl)); \
270 (v_g) = __riscv_vmerge_vxm_u8m2((v_g), (src_g), _full_mask, (vl)); \
271 (v_r) = __riscv_vmerge_vxm_u8m2((v_r), (src_r), _full_mask, (vl)); \
272 } while(0)
273
274 /**********************
275 * EFFECTIVE ALPHA CALCULATION MACROS
276 *
277 * These macros compute the effective alpha from combinations of:
278 * - v_alpha: source alpha channel (per-pixel)
279 * - mask: mask value (per-pixel)
280 * - opa: global opacity (scalar)
281 *
282 * Formula: eff_alpha = (alpha * mask * opa) >> 16
283 * Intermediate calculations use 16-bit to prevent overflow.
284 **********************/
285
286 /**
287 * Calculate effective alpha from source alpha and global opa
288 */
289 #define LV_RVV_CALC_EFF_ALPHA_OPA_U8M1(v_src_a, opa, v_eff_a, vl) \
290 do { \
291 vuint16m2_t _v_alpha16 = __riscv_vzext_vf2_u16m2((v_src_a), (vl)); \
292 vuint16m2_t _v_eff16 = __riscv_vsrl_vx_u16m2(__riscv_vmul_vx_u16m2(_v_alpha16, (opa), (vl)), 8, (vl)); \
293 (v_eff_a) = __riscv_vnsrl_wx_u8m1(_v_eff16, 0, (vl)); \
294 } while(0)
295
296 /**
297 * Calculate effective alpha from source alpha and mask
298 */
299 #define LV_RVV_CALC_EFF_ALPHA_MASK_U8M1(v_src_a, v_mask, v_eff_a, vl) \
300 do { \
301 vuint16m2_t _v_alpha16 = __riscv_vzext_vf2_u16m2((v_src_a), (vl)); \
302 vuint16m2_t _v_mask16 = __riscv_vzext_vf2_u16m2((v_mask), (vl)); \
303 vuint16m2_t _v_eff16 = __riscv_vsrl_vx_u16m2(__riscv_vmul_vv_u16m2(_v_alpha16, _v_mask16, (vl)), 8, (vl)); \
304 (v_eff_a) = __riscv_vnsrl_wx_u8m1(_v_eff16, 0, (vl)); \
305 } while(0)
306
307 /**
308 * Calculate effective alpha from source alpha, mask, and global opa
309 * Formula: eff_alpha = (alpha * mask * opa) >> 16
310 * Widen to u32m4 to avoid precision loss from double shift
311 */
312 #define LV_RVV_CALC_EFF_ALPHA_MASK_OPA_U8M1(v_src_a, v_mask, opa, v_eff_a, vl) \
313 do { \
314 vuint16m2_t _v_alpha16 = __riscv_vzext_vf2_u16m2((v_src_a), (vl)); \
315 vuint16m2_t _v_mask16 = __riscv_vzext_vf2_u16m2((v_mask), (vl)); \
316 vuint16m2_t _v_prod16 = __riscv_vmul_vv_u16m2(_v_alpha16, _v_mask16, (vl)); \
317 vuint32m4_t _v_prod32 = __riscv_vwmulu_vx_u32m4(_v_prod16, (opa), (vl)); \
318 vuint16m2_t _v_eff16 = __riscv_vnsrl_wx_u16m2(_v_prod32, 16, (vl)); \
319 (v_eff_a) = __riscv_vnsrl_wx_u8m1(_v_eff16, 0, (vl)); \
320 } while(0)
321
322 /**********************
323 * RGB/ARGB CHANNEL LOAD/STORE MACROS (for ARGB8888/RGB888/XRGB8888)
324 *
325 * Load/Store RGB channels to/from memory in different formats using m1 LMUL.
326 **********************/
327
328 #define LV_RVV_LOAD_ARGB8888_U8M1(ptr, x, v_b, v_g, v_r, v_a, vl) \
329 do { \
330 (v_b) = __riscv_vlse8_v_u8m1((ptr) + (x) * 4 + 0, 4, (vl)); \
331 (v_g) = __riscv_vlse8_v_u8m1((ptr) + (x) * 4 + 1, 4, (vl)); \
332 (v_r) = __riscv_vlse8_v_u8m1((ptr) + (x) * 4 + 2, 4, (vl)); \
333 (v_a) = __riscv_vlse8_v_u8m1((ptr) + (x) * 4 + 3, 4, (vl)); \
334 } while(0)
335
336 #define LV_RVV_LOAD_RGB888_U8M1(ptr, x, v_b, v_g, v_r, vl) \
337 do { \
338 (v_b) = __riscv_vlse8_v_u8m1((ptr) + (x) * 3 + 0, 3, (vl)); \
339 (v_g) = __riscv_vlse8_v_u8m1((ptr) + (x) * 3 + 1, 3, (vl)); \
340 (v_r) = __riscv_vlse8_v_u8m1((ptr) + (x) * 3 + 2, 3, (vl)); \
341 } while(0)
342
343 #define LV_RVV_LOAD_XRGB8888_U8M1(ptr, x, v_b, v_g, v_r, vl) \
344 do { \
345 (v_b) = __riscv_vlse8_v_u8m1((ptr) + (x) * 4 + 0, 4, (vl)); \
346 (v_g) = __riscv_vlse8_v_u8m1((ptr) + (x) * 4 + 1, 4, (vl)); \
347 (v_r) = __riscv_vlse8_v_u8m1((ptr) + (x) * 4 + 2, 4, (vl)); \
348 } while(0)
349
350 #define LV_RVV_STORE_RGB888_U8M1(ptr, x, v_b, v_g, v_r, vl) \
351 do { \
352 __riscv_vsse8_v_u8m1((ptr) + (x) * 3 + 0, 3, (v_b), (vl)); \
353 __riscv_vsse8_v_u8m1((ptr) + (x) * 3 + 1, 3, (v_g), (vl)); \
354 __riscv_vsse8_v_u8m1((ptr) + (x) * 3 + 2, 3, (v_r), (vl)); \
355 } while(0)
356
357 #define LV_RVV_STORE_XRGB8888_U8M1(ptr, x, v_b, v_g, v_r, v_a, vl) \
358 do { \
359 __riscv_vsse8_v_u8m1((ptr) + (x) * 4 + 0, 4, (v_b), (vl)); \
360 __riscv_vsse8_v_u8m1((ptr) + (x) * 4 + 1, 4, (v_g), (vl)); \
361 __riscv_vsse8_v_u8m1((ptr) + (x) * 4 + 2, 4, (v_r), (vl)); \
362 __riscv_vsse8_v_u8m1((ptr) + (x) * 4 + 3, 4, (v_a), (vl)); \
363 } while(0)
364
365 /**********************
366 * MACROS
367 **********************/
368
369 /**********************
370 * TYPEDEFS
371 **********************/
372
373 /**********************
374 * STATIC PROTOTYPES
375 **********************/
376
377 static inline void * LV_ATTRIBUTE_FAST_MEM drawbuf_next_row(const void * buf, uint32_t stride)
378 {
379 return (void *)((uint8_t *)buf + stride);
380 }
381
382 /**********************
383 * GLOBAL PROTOTYPES
384 **********************/
385
386 /**********************
387 * MACROS
388 **********************/
389
390 #endif
391
392 #ifdef __cplusplus
393 } /*extern "C"*/
394 #endif
395
396 #endif /*LV_BLEND_RISCV_V_PRIVATE_H*/