File tree Expand file tree Collapse file tree 4 files changed +48
-20
lines changed Expand file tree Collapse file tree 4 files changed +48
-20
lines changed Original file line number Diff line number Diff line change 32
32
33
33
#include <cstdio>
34
34
35
- // ============================================================================
36
- // vmask4 operators and functions
37
- // ============================================================================
38
-
39
- /**
40
- * @brief True if any lanes are enabled, false otherwise.
41
- */
42
- ASTCENC_SIMD_INLINE bool any (vmask4 a )
43
- {
44
- return mask (a ) != 0 ;
45
- }
46
-
47
- /**
48
- * @brief True if all lanes are enabled, false otherwise.
49
- */
50
- ASTCENC_SIMD_INLINE bool all (vmask4 a )
51
- {
52
- return mask (a ) == 0xF ;
53
- }
54
-
55
35
// ============================================================================
56
36
// vint4 operators and functions
57
37
// ============================================================================
Original file line number Diff line number Diff line change @@ -411,6 +411,22 @@ ASTCENC_SIMD_INLINE unsigned int mask(vmask4 a)
411
411
return vaddvq_u32 (vshlq_u32 (tmp, shift));
412
412
}
413
413
414
+ /* *
415
+ * @brief True if any lanes are enabled, false otherwise.
416
+ */
417
+ ASTCENC_SIMD_INLINE bool any (vmask4 a)
418
+ {
419
+ return vmaxvq_u32 (a.m ) != 0 ;
420
+ }
421
+
422
+ /* *
423
+ * @brief True if all lanes are enabled, false otherwise.
424
+ */
425
+ ASTCENC_SIMD_INLINE bool all (vmask4 a)
426
+ {
427
+ return vminvq_u32 (a.m ) != 0 ;
428
+ }
429
+
414
430
// ============================================================================
415
431
// vint4 operators and functions
416
432
// ============================================================================
Original file line number Diff line number Diff line change @@ -418,6 +418,22 @@ ASTCENC_SIMD_INLINE unsigned int mask(vmask4 a)
418
418
((a.m [3 ] >> 28 ) & 0x8 );
419
419
}
420
420
421
+ /* *
422
+ * @brief True if any lanes are enabled, false otherwise.
423
+ */
424
+ ASTCENC_SIMD_INLINE bool any (vmask4 a)
425
+ {
426
+ return mask (a) != 0 ;
427
+ }
428
+
429
+ /* *
430
+ * @brief True if all lanes are enabled, false otherwise.
431
+ */
432
+ ASTCENC_SIMD_INLINE bool all (vmask4 a)
433
+ {
434
+ return mask (a) == 0xF ;
435
+ }
436
+
421
437
// ============================================================================
422
438
// vint4 operators and functions
423
439
// ============================================================================
Original file line number Diff line number Diff line change @@ -428,6 +428,22 @@ ASTCENC_SIMD_INLINE unsigned int mask(vmask4 a)
428
428
return static_cast <unsigned int >(_mm_movemask_ps (a.m ));
429
429
}
430
430
431
+ /* *
432
+ * @brief True if any lanes are enabled, false otherwise.
433
+ */
434
+ ASTCENC_SIMD_INLINE bool any (vmask4 a)
435
+ {
436
+ return mask (a) != 0 ;
437
+ }
438
+
439
+ /* *
440
+ * @brief True if all lanes are enabled, false otherwise.
441
+ */
442
+ ASTCENC_SIMD_INLINE bool all (vmask4 a)
443
+ {
444
+ return mask (a) == 0xF ;
445
+ }
446
+
431
447
// ============================================================================
432
448
// vint4 operators and functions
433
449
// ============================================================================
You can’t perform that action at this time.
0 commit comments