termux-packages/root-packages/aircrack-ng/clang.patch
2022-04-18 14:31:42 +05:30

218 lines
5.2 KiB
Diff

--- ../pseudo_intrinsics.h.orig 2021-01-05 10:30:02.709991310 +0000
+++ ./include/aircrack-ng/ce-wpa/pseudo_intrinsics.h 2021-01-05 10:32:59.940558340 +0000
@@ -93,9 +93,211 @@
#define VLOADU_EMULATED 1
#define vor vorrq_u32
#define vorn vornq_u32
-#define vroti_epi32(x, i) \
- (i > 0 ? vsliq_n_u32(vshrq_n_u32(x, 32 - (i)), x, i) \
- : vsriq_n_u32(vshlq_n_u32(x, 32 + (i)), x, -(i)))
+
+static uint32x4_t vroti_epi32(uint32x4_t x, int i)
+{
+
+ uint32x4_t out;
+
+ switch (i) {
+ case -32:
+ out = vsriq_n_u32(vshlq_n_u32(x, 0), x, 32);
+ break;
+ case -31:
+ out = vsriq_n_u32(vshlq_n_u32(x, 1), x, 31);
+ break;
+ case -30:
+ out = vsriq_n_u32(vshlq_n_u32(x, 2), x, 30);
+ break;
+ case -29:
+ out = vsriq_n_u32(vshlq_n_u32(x, 3), x, 29);
+ break;
+ case -28:
+ out = vsriq_n_u32(vshlq_n_u32(x, 4), x, 28);
+ break;
+ case -27:
+ out = vsriq_n_u32(vshlq_n_u32(x, 5), x, 27);
+ break;
+ case -26:
+ out = vsriq_n_u32(vshlq_n_u32(x, 6), x, 26);
+ break;
+ case -25:
+ out = vsriq_n_u32(vshlq_n_u32(x, 7), x, 25);
+ break;
+ case -24:
+ out = vsriq_n_u32(vshlq_n_u32(x, 8), x, 24);
+ break;
+ case -23:
+ out = vsriq_n_u32(vshlq_n_u32(x, 9), x, 23);
+ break;
+ case -22:
+ out = vsriq_n_u32(vshlq_n_u32(x, 10), x, 22);
+ break;
+ case -21:
+ out = vsriq_n_u32(vshlq_n_u32(x, 11), x, 21);
+ break;
+ case -20:
+ out = vsriq_n_u32(vshlq_n_u32(x, 12), x, 20);
+ break;
+ case -19:
+ out = vsriq_n_u32(vshlq_n_u32(x, 13), x, 19);
+ break;
+ case -18:
+ out = vsriq_n_u32(vshlq_n_u32(x, 14), x, 18);
+ break;
+ case -17:
+ out = vsriq_n_u32(vshlq_n_u32(x, 15), x, 17);
+ break;
+ case -16:
+ out = vsriq_n_u32(vshlq_n_u32(x, 16), x, 16);
+ break;
+ case -15:
+ out = vsriq_n_u32(vshlq_n_u32(x, 17), x, 15);
+ break;
+ case -14:
+ out = vsriq_n_u32(vshlq_n_u32(x, 18), x, 14);
+ break;
+ case -13:
+ out = vsriq_n_u32(vshlq_n_u32(x, 19), x, 13);
+ break;
+ case -12:
+ out = vsriq_n_u32(vshlq_n_u32(x, 20), x, 12);
+ break;
+ case -11:
+ out = vsriq_n_u32(vshlq_n_u32(x, 21), x, 11);
+ break;
+ case -10:
+ out = vsriq_n_u32(vshlq_n_u32(x, 22), x, 10);
+ break;
+ case -9:
+ out = vsriq_n_u32(vshlq_n_u32(x, 23), x, 9);
+ break;
+ case -8:
+ out = vsriq_n_u32(vshlq_n_u32(x, 24), x, 8);
+ break;
+ case -7:
+ out = vsriq_n_u32(vshlq_n_u32(x, 25), x, 7);
+ break;
+ case -6:
+ out = vsriq_n_u32(vshlq_n_u32(x, 26), x, 6);
+ break;
+ case -5:
+ out = vsriq_n_u32(vshlq_n_u32(x, 27), x, 5);
+ break;
+ case -4:
+ out = vsriq_n_u32(vshlq_n_u32(x, 28), x, 4);
+ break;
+ case -3:
+ out = vsriq_n_u32(vshlq_n_u32(x, 29), x, 3);
+ break;
+ case -2:
+ out = vsriq_n_u32(vshlq_n_u32(x, 30), x, 2);
+ break;
+ case -1:
+ out = vsriq_n_u32(vshlq_n_u32(x, 31), x, 1);
+ break;
+ case 0:
+ out = vsliq_n_u32(vshrq_n_u32(x, 32), x, 0);
+ break;
+ case 1:
+ out = vsliq_n_u32(vshrq_n_u32(x, 31), x, 1);
+ break;
+ case 2:
+ out = vsliq_n_u32(vshrq_n_u32(x, 30), x, 2);
+ break;
+ case 3:
+ out = vsliq_n_u32(vshrq_n_u32(x, 29), x, 3);
+ break;
+ case 4:
+ out = vsliq_n_u32(vshrq_n_u32(x, 28), x, 4);
+ break;
+ case 5:
+ out = vsliq_n_u32(vshrq_n_u32(x, 27), x, 5);
+ break;
+ case 6:
+ out = vsliq_n_u32(vshrq_n_u32(x, 26), x, 6);
+ break;
+ case 7:
+ out = vsliq_n_u32(vshrq_n_u32(x, 25), x, 7);
+ break;
+ case 8:
+ out = vsliq_n_u32(vshrq_n_u32(x, 24), x, 8);
+ break;
+ case 9:
+ out = vsliq_n_u32(vshrq_n_u32(x, 23), x, 9);
+ break;
+ case 10:
+ out = vsliq_n_u32(vshrq_n_u32(x, 22), x, 10);
+ break;
+ case 11:
+ out = vsliq_n_u32(vshrq_n_u32(x, 21), x, 11);
+ break;
+ case 12:
+ out = vsliq_n_u32(vshrq_n_u32(x, 20), x, 12);
+ break;
+ case 13:
+ out = vsliq_n_u32(vshrq_n_u32(x, 19), x, 13);
+ break;
+ case 14:
+ out = vsliq_n_u32(vshrq_n_u32(x, 18), x, 14);
+ break;
+ case 15:
+ out = vsliq_n_u32(vshrq_n_u32(x, 17), x, 15);
+ break;
+ case 16:
+ out = vsliq_n_u32(vshrq_n_u32(x, 16), x, 16);
+ break;
+ case 17:
+ out = vsliq_n_u32(vshrq_n_u32(x, 15), x, 17);
+ break;
+ case 18:
+ out = vsliq_n_u32(vshrq_n_u32(x, 14), x, 18);
+ break;
+ case 19:
+ out = vsliq_n_u32(vshrq_n_u32(x, 13), x, 19);
+ break;
+ case 20:
+ out = vsliq_n_u32(vshrq_n_u32(x, 12), x, 20);
+ break;
+ case 21:
+ out = vsliq_n_u32(vshrq_n_u32(x, 11), x, 21);
+ break;
+ case 22:
+ out = vsliq_n_u32(vshrq_n_u32(x, 10), x, 22);
+ break;
+ case 23:
+ out = vsliq_n_u32(vshrq_n_u32(x, 9), x, 23);
+ break;
+ case 24:
+ out = vsliq_n_u32(vshrq_n_u32(x, 8), x, 24);
+ break;
+ case 25:
+ out = vsliq_n_u32(vshrq_n_u32(x, 7), x, 25);
+ break;
+ case 26:
+ out = vsliq_n_u32(vshrq_n_u32(x, 6), x, 26);
+ break;
+ case 27:
+ out = vsliq_n_u32(vshrq_n_u32(x, 5), x, 27);
+ break;
+ case 28:
+ out = vsliq_n_u32(vshrq_n_u32(x, 4), x, 28);
+ break;
+ case 29:
+ out = vsliq_n_u32(vshrq_n_u32(x, 3), x, 29);
+ break;
+ case 30:
+ out = vsliq_n_u32(vshrq_n_u32(x, 2), x, 30);
+ break;
+ case 31:
+ out = vsliq_n_u32(vshrq_n_u32(x, 1), x, 31);
+ break;
+ default:
+ out = vdupq_n_u32(0);
+ break;
+ }
+ return out;
+}
#define vroti_epi64(x, i) \
(i > 0 ? (vtype) vsliq_n_u64( \
vshrq_n_u64((vtype64)(x), 64 - (i)), (vtype64)(x), i) \