From d078e8a62bccd1195110f0d9bd22897cf3297d46 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Thu, 21 May 2026 20:54:44 +0200 Subject: [PATCH] make style --- armsrc/frozen.c | 2 +- client/deps/reveng/bmpbit.c | 12 +- client/deps/reveng/preset.c | 458 +++++++++--------- client/deps/vec/vec/private/gcc.h | 149 +++--- client/deps/vec/vec/private/generic.h | 480 +++++++++---------- client/deps/vec/vec/private/neon_asm.h | 112 +++-- client/deps/vec/vec/private/neon_intrin.h | 264 +++++----- client/deps/vec/vec/private/sse2.h | 260 +++++----- client/deps/vec/vec/private/sse41.h | 9 +- client/deps/vec/vec/vec.h | 150 +++--- client/src/cmdflashmemspiffs.c | 2 +- client/src/cmdhf14a.c | 4 +- client/src/cmdhfcalypso.c | 4 +- client/src/cmdhffelica.c | 36 +- client/src/cmdhfgallagher.c | 18 +- client/src/cmdhflegic.c | 6 +- client/src/cmdhfmf.c | 2 +- client/src/cmdhfmfdes.c | 2 +- client/src/cmdhfmfsen.c | 44 +- client/src/cmdhfntag424.c | 4 +- client/src/cmdhfsecc.c | 10 +- client/src/cmdlf.c | 8 +- client/src/cmdlft55xx.c | 6 +- client/src/cmdtrace.c | 2 +- client/src/flash.c | 2 +- client/src/mifare/gallaghercore.c | 8 +- client/src/mifare/mifarehost.c | 8 +- client/src/pm3_luawrap.c | 6 +- client/src/pm3line_vocabulary.h | 2 + client/src/proxmark3.c | 2 +- common/bruteforce.h | 4 +- common/iso15693tools.h | 24 +- common/mbedtls/aesni.c | 26 +- common/mbedtls/camellia.c | 16 +- common/mbedtls/ctr_drbg.c | 2 +- common/mbedtls/memory_buffer_alloc.c | 16 +- common/mbedtls/ssl.h | 4 +- common/mbedtls/ssl_cli.c | 2 +- common/mbedtls/ssl_msg.c | 2 +- common/mbedtls/x509_crt.c | 2 +- doc/commands.json | 111 ++++- doc/commands.md | 4 + include/pm3_cmd.h | 2 +- tools/deprecated-hid-flasher/flasher/flash.c | 2 +- 44 files changed, 1127 insertions(+), 1162 deletions(-) diff --git a/armsrc/frozen.c b/armsrc/frozen.c index b4f57aa74..1062e3ff9 100644 --- a/armsrc/frozen.c +++ b/armsrc/frozen.c @@ -541,7 +541,7 @@ static int b64dec(const char *src, int n, char *dst) { int len = 0; while (src + 3 < end) { int a = b64rev(src[0]), b = b64rev(src[1]), c = b64rev(src[2]), - d = b64rev(src[3]); + d = b64rev(src[3]); dst[len++] = (a << 2) | (b >> 4); if (src[2] != '=') { dst[len++] = (b << 4) | (c >> 2); diff --git a/client/deps/reveng/bmpbit.c b/client/deps/reveng/bmpbit.c index 522d71ecc..5c4464b41 100644 --- a/client/deps/reveng/bmpbit.c +++ b/client/deps/reveng/bmpbit.c @@ -73,10 +73,10 @@ main(int argc, char *argv[]) { setbmp(); if (BMP_BIT != bmpbit || BMP_SUB != bmpsub) { fprintf(stderr, "reveng: configuration fault. Update " - "reveng/config.h with these definitions and " - "recompile:\n" - "\t#define BMP_BIT %d\n" - "\t#define BMP_SUB %d\n", + "reveng/config.h with these definitions and " + "recompile:\n" + "\t#define BMP_BIT %d\n" + "\t#define BMP_SUB %d\n", bmpbit, bmpsub); exit(EXIT_FAILURE); } @@ -84,8 +84,8 @@ main(int argc, char *argv[]) { /* check the bitmap constant macro */ if (~(bmp_t) 0 != ~BMP_C(0)) { fprintf(stderr, "reveng: configuration fault. Edit " - "the definition of BMP_C() in config.h to " - "match BMP_T and recompile.\n"); + "the definition of BMP_C() in config.h to " + "match BMP_T and recompile.\n"); exit(EXIT_FAILURE); } exit(EXIT_SUCCESS); diff --git a/client/deps/reveng/preset.c b/client/deps/reveng/preset.c index 6f41ac9f5..1897ebcee 100644 --- a/client/deps/reveng/preset.c +++ b/client/deps/reveng/preset.c @@ -137,19 +137,19 @@ static const bmp_t b40c[] = { # else /* BMP_BIT */ static const bmp_t b40[] = { BMP_C(0x00048200) << (BMP_BIT - 32) | BMP_C(0x04) >> (39 - BMP_BIT), - BMP_C(0x09) << (BMP_BIT * 2 - 40), + BMP_C(0x09) << (BMP_BIT * 2 - 40), }; static const bmp_t b40a[] = { BMP_C(0xffffffff) << (BMP_BIT - 32) | BMP_C(0x7f) >> (39 - BMP_BIT), - BMP_C(0xff) << (BMP_BIT * 2 - 40), + BMP_C(0xff) << (BMP_BIT * 2 - 40), }; static const bmp_t b40b[] = { BMP_C(0xd4164fc6) << (BMP_BIT - 32) | BMP_C(0x23) >> (39 - BMP_BIT), - BMP_C(0x46) << (BMP_BIT * 2 - 40), + BMP_C(0x46) << (BMP_BIT * 2 - 40), }; static const bmp_t b40c[] = { BMP_C(0xc4ff8071) << (BMP_BIT - 32) | BMP_C(0x7f) >> (39 - BMP_BIT), - BMP_C(0xff) << (BMP_BIT * 2 - 40), + BMP_C(0xff) << (BMP_BIT * 2 - 40), }; # endif /* BMP_BIT */ @@ -187,43 +187,43 @@ static const bmp_t b64i[] = { # else /* BMP_BIT */ static const bmp_t b64[] = { BMP_C(0x00000000) << (BMP_BIT - 32) | BMP_C(0x0000000d) >> (63 - BMP_BIT), - BMP_C(0x0000001b) << (BMP_BIT * 2 - 64), + BMP_C(0x0000001b) << (BMP_BIT * 2 - 64), }; static const bmp_t b64a[] = { BMP_C(0xffffffff) << (BMP_BIT - 32) | BMP_C(0x7fffffff) >> (63 - BMP_BIT), - BMP_C(0xffffffff) << (BMP_BIT * 2 - 64), + BMP_C(0xffffffff) << (BMP_BIT * 2 - 64), }; static const bmp_t b64b[] = { BMP_C(0xb90956c7) << (BMP_BIT - 32) | BMP_C(0x3ad20800) >> (63 - BMP_BIT), - BMP_C(0x75a41001) << (BMP_BIT * 2 - 64), + BMP_C(0x75a41001) << (BMP_BIT * 2 - 64), }; static const bmp_t b64c[] = { BMP_C(0x53000000) << (BMP_BIT - 32) | BMP_C(0x00000000) >> (63 - BMP_BIT), - BMP_C(0x00000000) << (BMP_BIT * 2 - 64), + BMP_C(0x00000000) << (BMP_BIT * 2 - 64), }; static const bmp_t b64d[] = { BMP_C(0x42f0e1eb) << (BMP_BIT - 32) | BMP_C(0x54f51b49) >> (63 - BMP_BIT), - BMP_C(0xa9ea3693) << (BMP_BIT * 2 - 64), + BMP_C(0xa9ea3693) << (BMP_BIT * 2 - 64), }; static const bmp_t b64e[] = { BMP_C(0x6c40df5f) << (BMP_BIT - 32) | BMP_C(0x05a4b9a3) >> (63 - BMP_BIT), - BMP_C(0x0b497347) << (BMP_BIT * 2 - 64), + BMP_C(0x0b497347) << (BMP_BIT * 2 - 64), }; static const bmp_t b64f[] = { BMP_C(0x62ec59e3) << (BMP_BIT - 32) | BMP_C(0x78d27805) >> (63 - BMP_BIT), - BMP_C(0xf1a4f00a) << (BMP_BIT * 2 - 64), + BMP_C(0xf1a4f00a) << (BMP_BIT * 2 - 64), }; static const bmp_t b64g[] = { BMP_C(0xfcacbebd) << (BMP_BIT - 32) | BMP_C(0x2c98d4c9) >> (63 - BMP_BIT), - BMP_C(0x5931a992) << (BMP_BIT * 2 - 64), + BMP_C(0x5931a992) << (BMP_BIT * 2 - 64), }; static const bmp_t b64h[] = { BMP_C(0x995dc9bb) << (BMP_BIT - 32) | BMP_C(0x6f8c9cfd) >> (63 - BMP_BIT), - BMP_C(0xdf1939fa) << (BMP_BIT * 2 - 64), + BMP_C(0xdf1939fa) << (BMP_BIT * 2 - 64), }; static const bmp_t b64i[] = { BMP_C(0x49958c9a) << (BMP_BIT - 32) | BMP_C(0x5ebe9a9f) >> (63 - BMP_BIT), - BMP_C(0xbd7d353f) << (BMP_BIT * 2 - 64), + BMP_C(0xbd7d353f) << (BMP_BIT * 2 - 64), }; # endif /* BMP_BIT */ @@ -237,22 +237,22 @@ static const bmp_t b82a[] = { # elif BMP_BIT >= 41 static const bmp_t b82[] = { BMP_C(0x01846008880) << (BMP_BIT - 41) | BMP_C(0x08a00a20208) >> (81 - BMP_BIT), - BMP_C(0x11401440411) << (BMP_BIT * 2 - 82), + BMP_C(0x11401440411) << (BMP_BIT * 2 - 82), }; static const bmp_t b82a[] = { BMP_C(0x04f541fb128) << (BMP_BIT - 41) | BMP_C(0x011c00feb09) >> (81 - BMP_BIT), - BMP_C(0x023801fd612) << (BMP_BIT * 2 - 82), + BMP_C(0x023801fd612) << (BMP_BIT * 2 - 82), }; # else /* BMP_BIT */ static const bmp_t b82[] = { BMP_C(0x0c230044) << (BMP_BIT - 32) | BMP_C(0x040) >> (40 - BMP_BIT), - BMP_C(0x40450051) << (BMP_BIT * 2 - 64) | BMP_C(0x00104) >> (80 - BMP_BIT * 2), - BMP_C(0x00411) << (BMP_BIT * 3 - 82), + BMP_C(0x40450051) << (BMP_BIT * 2 - 64) | BMP_C(0x00104) >> (80 - BMP_BIT * 2), + BMP_C(0x00411) << (BMP_BIT * 3 - 82), }; static const bmp_t b82a[] = { BMP_C(0x27aa0fd8) << (BMP_BIT - 32) | BMP_C(0x094) >> (40 - BMP_BIT), - BMP_C(0x9408e007) << (BMP_BIT * 2 - 64) | BMP_C(0x0f584) >> (80 - BMP_BIT * 2), - BMP_C(0x3d612) << (BMP_BIT * 3 - 82), + BMP_C(0x9408e007) << (BMP_BIT * 2 - 64) | BMP_C(0x0f584) >> (80 - BMP_BIT * 2), + BMP_C(0x3d612) << (BMP_BIT * 3 - 82), }; # endif /* BMP_BIT */ @@ -262,215 +262,215 @@ static const bmp_t b82a[] = { /* Array of the polynomial bitmaps used in the model table. */ static const bmp_t b32[] = { BMP_C(0x000000af) << (BMP_BIT - 32), /* 0 -- 32,000000af */ - BMP_C(0x00010000) << (BMP_BIT - 32), /* 1 -- 16, 0001 */ - BMP_C(0x00020000) << (BMP_BIT - 32), /* 2 -- 15, 0001 */ - BMP_C(0x00065b00) << (BMP_BIT - 32), /* 3 -- 24, 00065b */ - BMP_C(0x007e0000) << (BMP_BIT - 32), /* 4 -- 16, 007e */ - BMP_C(0x007f0000) << (BMP_BIT - 32), /* 5 -- 16, 007f */ - BMP_C(0x03400000) << (BMP_BIT - 32), /* 6 -- 11, 01a */ - BMP_C(0x0376e6e7) << (BMP_BIT - 32), /* 7 -- 32,0376e6e7 */ - BMP_C(0x04c11db7) << (BMP_BIT - 32), /* 8 -- 32,04c11db7 */ - BMP_C(0x05890000) << (BMP_BIT - 32), /* 9 -- 16, 0589 */ - BMP_C(0x07000000) << (BMP_BIT - 32), /* 10 -- 8, 07 */ - BMP_C(0x080b0000) << (BMP_BIT - 32), /* 11 -- 16, 080b */ - BMP_C(0x09823b6e) << (BMP_BIT - 32), /* 12 -- 31,04c11db7 */ - BMP_C(0x0b3c0000) << (BMP_BIT - 32), /* 13 -- 15, 059e */ - BMP_C(0x0c000000) << (BMP_BIT - 32), /* 14 -- 6, 03 */ - BMP_C(0x0c200000) << (BMP_BIT - 32), /* 15 -- 11, 061 */ - BMP_C(0x0c780000) << (BMP_BIT - 32), /* 16 -- 14, 031e */ - BMP_C(0x0fb30000) << (BMP_BIT - 32), /* 17 -- 16, 0fb3 */ - BMP_C(0x10210000) << (BMP_BIT - 32), /* 18 -- 16, 1021 */ - BMP_C(0x12000000) << (BMP_BIT - 32), /* 19 -- 7, 09 */ - BMP_C(0x130d2afc) << (BMP_BIT - 32), /* 20 -- 30,04c34abf */ - BMP_C(0x144e6300) << (BMP_BIT - 32), /* 21 -- 24, 144e63 */ - BMP_C(0x15000000) << (BMP_BIT - 32), /* 22 -- 8, 15 */ - BMP_C(0x1697d06a) << (BMP_BIT - 32), /* 23 -- 32,1697d06a */ - BMP_C(0x17800000) << (BMP_BIT - 32), /* 24 -- 12, 178 */ - BMP_C(0x18000000) << (BMP_BIT - 32), /* 25 -- 6, 06 */ - BMP_C(0x19d3c8d8) << (BMP_BIT - 32), /* 26 -- 31,0ce9e46c */ - BMP_C(0x1c000000) << (BMP_BIT - 32), /* 27 -- 6, 07 */ - BMP_C(0x1d000000) << (BMP_BIT - 32), /* 28 -- 8, 1d */ - BMP_C(0x1d0f0000) << (BMP_BIT - 32), /* 29 -- 16, 1d0f */ - BMP_C(0x1dcf0000) << (BMP_BIT - 32), /* 30 -- 16, 1dcf */ - BMP_C(0x1edc6f41) << (BMP_BIT - 32), /* 31 -- 32,1edc6f41 */ - BMP_C(0x1f23b800) << (BMP_BIT - 32), /* 32 -- 24, 1f23b8 */ - BMP_C(0x20000000) << (BMP_BIT - 32), /* 33 -- 4, 2 */ - BMP_C(0x200fa500) << (BMP_BIT - 32), /* 34 -- 24, 200fa5 */ - BMP_C(0x20140000) << (BMP_BIT - 32), /* 35 -- 14, 0805 */ - BMP_C(0x20b40000) << (BMP_BIT - 32), /* 36 -- 14, 082d */ - BMP_C(0x20fe0000) << (BMP_BIT - 32), /* 37 -- 16, 20fe */ - BMP_C(0x21890000) << (BMP_BIT - 32), /* 38 -- 16, 2189 */ - BMP_C(0x21cf0200) << (BMP_BIT - 32), /* 39 -- 24, 21cf02 */ - BMP_C(0x23ef5200) << (BMP_BIT - 32), /* 40 -- 24, 23ef52 */ - BMP_C(0x25000000) << (BMP_BIT - 32), /* 41 -- 8, 25 */ - BMP_C(0x26000000) << (BMP_BIT - 32), /* 42 -- 8, 26 */ - BMP_C(0x26b10000) << (BMP_BIT - 32), /* 43 -- 16, 26b1 */ - BMP_C(0x27818000) << (BMP_BIT - 32), /* 44 -- 17, 04f03 */ - BMP_C(0x27d00000) << (BMP_BIT - 32), /* 45 -- 13, 04fa */ - BMP_C(0x28000000) << (BMP_BIT - 32), /* 46 -- 5, 05 */ - BMP_C(0x29b10000) << (BMP_BIT - 32), /* 47 -- 16, 29b1 */ - BMP_C(0x2f000000) << (BMP_BIT - 32), /* 48 -- 8, 2f */ - BMP_C(0x30000000) << (BMP_BIT - 32), /* 49 -- 4, 3/ 5, 6 */ - BMP_C(0x3010bf7f) << (BMP_BIT - 32), /* 50 -- 32,3010bf7f */ - BMP_C(0x31000000) << (BMP_BIT - 32), /* 51 -- 8, 31 */ - BMP_C(0x31800000) << (BMP_BIT - 32), /* 52 -- 10, 0c6 */ - BMP_C(0x31c30000) << (BMP_BIT - 32), /* 53 -- 16, 31c3 */ - BMP_C(0x328b6300) << (BMP_BIT - 32), /* 54 -- 24, 328b63 */ - BMP_C(0x34000000) << (BMP_BIT - 32), /* 55 -- 6, 0d */ - BMP_C(0x340bc6d9) << (BMP_BIT - 32), /* 56 -- 32,340bc6d9 */ - BMP_C(0x37000000) << (BMP_BIT - 32), /* 57 -- 8, 37 */ - BMP_C(0x38000000) << (BMP_BIT - 32), /* 58 -- 5, 07 */ - BMP_C(0x39000000) << (BMP_BIT - 32), /* 59 -- 8, 39 */ - BMP_C(0x3d650000) << (BMP_BIT - 32), /* 60 -- 16, 3d65 */ - BMP_C(0x3e000000) << (BMP_BIT - 32), /* 61 -- 8, 3e */ - BMP_C(0x40000000) << (BMP_BIT - 32), /* 62 -- 3, 2 */ - BMP_C(0x42000000) << (BMP_BIT - 32), /* 63 -- 8, 42 */ - BMP_C(0x44c20000) << (BMP_BIT - 32), /* 64 -- 16, 44c2 */ - BMP_C(0x45270551) << (BMP_BIT - 32), /* 65 -- 32,45270551 */ - BMP_C(0x48000000) << (BMP_BIT - 32), /* 66 -- 5, 09 */ - BMP_C(0x49000000) << (BMP_BIT - 32), /* 67 -- 8, 49 */ - BMP_C(0x4a800000) << (BMP_BIT - 32), /* 68 -- 10, 12a */ - BMP_C(0x4acc0000) << (BMP_BIT - 32), /* 69 -- 15, 2566 */ - BMP_C(0x4b000000) << (BMP_BIT - 32), /* 70 -- 8, 4b */ - BMP_C(0x4b370000) << (BMP_BIT - 32), /* 71 -- 16, 4b37 */ - BMP_C(0x4c000000) << (BMP_BIT - 32), /* 72 -- 6, 13 */ - BMP_C(0x4c060000) << (BMP_BIT - 32), /* 73 -- 16, 4c06 */ - BMP_C(0x53000000) << (BMP_BIT - 32), /* 74 -- 8, 53 */ - BMP_C(0x55000000) << (BMP_BIT - 32), /* 75 -- 8, 55 */ - BMP_C(0x55555500) << (BMP_BIT - 32), /* 76 -- 24, 555555 */ - BMP_C(0x59350000) << (BMP_BIT - 32), /* 77 -- 16, 5935 */ - BMP_C(0x5d380000) << (BMP_BIT - 32), /* 78 -- 16, 5d38 */ - BMP_C(0x5d400000) << (BMP_BIT - 32), /* 79 -- 10, 175 */ - BMP_C(0x5d6dcb00) << (BMP_BIT - 32), /* 80 -- 24, 5d6dcb */ - BMP_C(0x60000000) << (BMP_BIT - 32), /* 81 -- 3, 3 */ - BMP_C(0x60e00000) << (BMP_BIT - 32), /* 82 -- 11, 307 */ - BMP_C(0x63d00000) << (BMP_BIT - 32), /* 83 -- 16, 63d0 */ - BMP_C(0x64000000) << (BMP_BIT - 32), /* 84 -- 6, 19 */ - BMP_C(0x66400000) << (BMP_BIT - 32), /* 85 -- 10, 199 */ - BMP_C(0x66c50000) << (BMP_BIT - 32), /* 86 -- 16, 66c5 */ - BMP_C(0x6f630000) << (BMP_BIT - 32), /* 87 -- 16, 6f63 */ - BMP_C(0x6f910000) << (BMP_BIT - 32), /* 88 -- 16, 6f91 */ - BMP_C(0x70000000) << (BMP_BIT - 32), /* 89 -- 4, 7 */ - BMP_C(0x70a00000) << (BMP_BIT - 32), /* 90 -- 11, 385 */ - BMP_C(0x755b0000) << (BMP_BIT - 32), /* 91 -- 16, 755b */ - BMP_C(0x765e7680) << (BMP_BIT - 32), /* 92 -- 32,765e7680 */ - BMP_C(0x76c20800) << (BMP_BIT - 32), /* 93 -- 32, 0ed841 */ - BMP_C(0x7979bd00) << (BMP_BIT - 32), /* 94 -- 24, 7979bd */ - BMP_C(0x7e000000) << (BMP_BIT - 32), /* 95 -- 8, 7e */ - BMP_C(0x80000000) << (BMP_BIT - 32), /* 96 -- 3, 4 */ - BMP_C(0x80006300) << (BMP_BIT - 32), /* 97 -- 24, 800063 */ - BMP_C(0x80050000) << (BMP_BIT - 32), /* 98 -- 16, 8005 */ - BMP_C(0x800d0000) << (BMP_BIT - 32), /* 99 -- 16, 800d */ - BMP_C(0x800fe300) << (BMP_BIT - 32), /* 100 -- 24, 800fe3 */ - BMP_C(0x80b40000) << (BMP_BIT - 32), /* 101 -- 14, 202d */ - BMP_C(0x80c2e71c) << (BMP_BIT - 32), /* 102 -- 30,2030b9c7 */ - BMP_C(0x80f00000) << (BMP_BIT - 32), /* 103 -- 12, 80f */ - BMP_C(0x814141ab) << (BMP_BIT - 32), /* 104 -- 32,814141ab */ - BMP_C(0x8144c800) << (BMP_BIT - 32), /* 105 -- 21, 102899 */ - BMP_C(0x864cfb00) << (BMP_BIT - 32), /* 106 -- 24, 864cfb */ - BMP_C(0x87315576) << (BMP_BIT - 32), /* 107 -- 32,87315576 */ - BMP_C(0x89ec0000) << (BMP_BIT - 32), /* 108 -- 16, 89ec */ - BMP_C(0x8a000000) << (BMP_BIT - 32), /* 109 -- 7, 45 */ - BMP_C(0x8b320000) << (BMP_BIT - 32), /* 110 -- 15, 4599 */ - BMP_C(0x8bb70000) << (BMP_BIT - 32), /* 111 -- 16, 8bb7 */ - BMP_C(0x8cc00000) << (BMP_BIT - 32), /* 112 -- 10, 233 */ - BMP_C(0x904cddbf) << (BMP_BIT - 32), /* 113 -- 32,904cddbf */ - BMP_C(0x906e0000) << (BMP_BIT - 32), /* 114 -- 16, 906e */ - BMP_C(0x94000000) << (BMP_BIT - 32), /* 115 -- 8, 94 */ - BMP_C(0x97000000) << (BMP_BIT - 32), /* 116 -- 8, 97 */ - BMP_C(0x98000000) << (BMP_BIT - 32), /* 117 -- 6, 26 */ - BMP_C(0x99000000) << (BMP_BIT - 32), /* 118 -- 8, 99 */ - BMP_C(0x9b000000) << (BMP_BIT - 32), /* 119 -- 8, 9b */ - BMP_C(0x9c000000) << (BMP_BIT - 32), /* 120 -- 6, 27 */ - BMP_C(0x9d5e4de2) << (BMP_BIT - 32), /* 121 -- 31,4eaf26f1 */ - BMP_C(0x9e000000) << (BMP_BIT - 32), /* 122 -- 7, 4f */ - BMP_C(0x9ecf0000) << (BMP_BIT - 32), /* 123 -- 16, 9ecf */ - BMP_C(0xa0660000) << (BMP_BIT - 32), /* 124 -- 16, a066 */ - BMP_C(0xa0970000) << (BMP_BIT - 32), /* 125 -- 16, a097 */ - BMP_C(0xa1000000) << (BMP_BIT - 32), /* 126 -- 8, a1 */ - BMP_C(0xa3660000) << (BMP_BIT - 32), /* 127 -- 16, a366 */ - BMP_C(0xa6000000) << (BMP_BIT - 32), /* 128 -- 7, 53 */ - BMP_C(0xa7000000) << (BMP_BIT - 32), /* 129 -- 8, a7 */ - BMP_C(0xa8000000) << (BMP_BIT - 32), /* 130 -- 5, 15 */ - BMP_C(0xa8190000) << (BMP_BIT - 32), /* 131 -- 16, a819 */ - BMP_C(0xa833982b) << (BMP_BIT - 32), /* 132 -- 32,a833982b */ - BMP_C(0xabcdef00) << (BMP_BIT - 32), /* 133 -- 24, abcdef */ - BMP_C(0xac000000) << (BMP_BIT - 32), /* 134 -- 8, ac */ - BMP_C(0xaee70000) << (BMP_BIT - 32), /* 135 -- 16, aee7 */ - BMP_C(0xb0000000) << (BMP_BIT - 32), /* 136 -- 4, b */ - BMP_C(0xb0010000) << (BMP_BIT - 32), /* 137 -- 16, b001 */ - BMP_C(0xb2aa0000) << (BMP_BIT - 32), /* 138 -- 16, b2aa */ - BMP_C(0xb3400000) << (BMP_BIT - 32), /* 139 -- 12, b34 */ - BMP_C(0xb42d8000) << (BMP_BIT - 32), /* 140 -- 17, 1685b */ - BMP_C(0xb4600000) << (BMP_BIT - 32), /* 141 -- 11, 5a3 */ - BMP_C(0xb4c80000) << (BMP_BIT - 32), /* 142 -- 16, b4c8 */ - BMP_C(0xb4f3e600) << (BMP_BIT - 32), /* 143 -- 24, b4f3e6 */ - BMP_C(0xb704ce00) << (BMP_BIT - 32), /* 144 -- 24, b704ce */ - BMP_C(0xb798b438) << (BMP_BIT - 32), /* 145 -- 32,b798b438 */ - BMP_C(0xbb3d0000) << (BMP_BIT - 32), /* 146 -- 16, bb3d */ - BMP_C(0xbc000000) << (BMP_BIT - 32), /* 147 -- 6,2f/ 8,bc */ - BMP_C(0xbd0be338) << (BMP_BIT - 32), /* 148 -- 32,bd0be338 */ - BMP_C(0xbdf40000) << (BMP_BIT - 32), /* 149 -- 16, bdf4 */ - BMP_C(0xbf050000) << (BMP_BIT - 32), /* 150 -- 16, bf05 */ - BMP_C(0xc0000000) << (BMP_BIT - 32), /* 151 -- 3, 6 */ - BMP_C(0xc2000000) << (BMP_BIT - 32), /* 152 -- 7, 61 */ - BMP_C(0xc25a5600) << (BMP_BIT - 32), /* 153 -- 24, c25a56 */ - BMP_C(0xc2b70000) << (BMP_BIT - 32), /* 154 -- 16, c2b7 */ - BMP_C(0xc2b80000) << (BMP_BIT - 32), /* 155 -- 14, 30ae */ - BMP_C(0xc4000000) << (BMP_BIT - 32), /* 156 -- 8, c4 */ - BMP_C(0xc6c60000) << (BMP_BIT - 32), /* 157 -- 16, c6c6 */ - BMP_C(0xc7000000) << (BMP_BIT - 32), /* 158 -- 8, c7 */ - BMP_C(0xc704dd7b) << (BMP_BIT - 32), /* 159 -- 32,c704dd7b */ - BMP_C(0xc8000000) << (BMP_BIT - 32), /* 160 -- 5, 19 */ - BMP_C(0xc8670000) << (BMP_BIT - 32), /* 161 -- 16, c867 */ - BMP_C(0xcbf43926) << (BMP_BIT - 32), /* 162 -- 32,cbf43926 */ - BMP_C(0xcde70300) << (BMP_BIT - 32), /* 163 -- 24, cde703 */ - BMP_C(0xce3c0000) << (BMP_BIT - 32), /* 164 -- 16, ce3c */ - BMP_C(0xd0000000) << (BMP_BIT - 32), /* 165 -- 8, d0 */ - BMP_C(0xd02a0000) << (BMP_BIT - 32), /* 166 -- 15, 6815 */ - BMP_C(0xd0db0000) << (BMP_BIT - 32), /* 167 -- 16, d0db */ - BMP_C(0xd3100000) << (BMP_BIT - 32), /* 168 -- 12, d31 */ - BMP_C(0xd3be9568) << (BMP_BIT - 32), /* 169 -- 30,34efa55a */ - BMP_C(0xd4d00000) << (BMP_BIT - 32), /* 170 -- 12, d4d */ - BMP_C(0xd5000000) << (BMP_BIT - 32), /* 171 -- 8, d5 */ - BMP_C(0xd64e0000) << (BMP_BIT - 32), /* 172 -- 16, d64e */ - BMP_C(0xda000000) << (BMP_BIT - 32), /* 173 -- 8, da */ - BMP_C(0xdaf00000) << (BMP_BIT - 32), /* 174 -- 12, daf */ - BMP_C(0xdebb20e3) << (BMP_BIT - 32), /* 175 -- 32,debb20e3 */ - BMP_C(0xdf000000) << (BMP_BIT - 32), /* 176 -- 8, df */ - BMP_C(0xe0000000) << (BMP_BIT - 32), /* 177 -- 3, 7 */ - BMP_C(0xe3069283) << (BMP_BIT - 32), /* 178 -- 32,e3069283 */ - BMP_C(0xe3940000) << (BMP_BIT - 32), /* 179 -- 16, e394 */ - BMP_C(0xe5cc0000) << (BMP_BIT - 32), /* 180 -- 16, e5cc */ - BMP_C(0xe7a80000) << (BMP_BIT - 32), /* 181 -- 13, 1cf5 */ - BMP_C(0xe8000000) << (BMP_BIT - 32), /* 182 -- 6, 3a */ - BMP_C(0xea000000) << (BMP_BIT - 32), /* 183 -- 7, 75 */ - BMP_C(0xea820000) << (BMP_BIT - 32), /* 184 -- 16, ea82 */ - BMP_C(0xec000000) << (BMP_BIT - 32), /* 185 -- 6, 3b */ - BMP_C(0xf0000000) << (BMP_BIT - 32), /* 186 -- 4, f */ - BMP_C(0xf0b80000) << (BMP_BIT - 32), /* 187 -- 16, f0b8 */ - BMP_C(0xf1300000) << (BMP_BIT - 32), /* 188 -- 12, f13 */ - BMP_C(0xf4000000) << (BMP_BIT - 32), /* 189 -- 8, f4 */ - BMP_C(0xf4acfb13) << (BMP_BIT - 32), /* 190 -- 32,f4acfb13 */ - BMP_C(0xf5b00000) << (BMP_BIT - 32), /* 191 -- 12, f5b */ - BMP_C(0xf6400000) << (BMP_BIT - 32), /* 192 -- 10, 3d9 */ - BMP_C(0xf7000000) << (BMP_BIT - 32), /* 193 -- 8, f7 */ - BMP_C(0xf8000000) << (BMP_BIT - 32), /* 194 -- 5, 1f */ - BMP_C(0xfc000000) << (BMP_BIT - 32), /* 195 -- 6, 3f */ - BMP_C(0xfc891918) << (BMP_BIT - 32), /* 196 -- 32,fc891918 */ - BMP_C(0xfd000000) << (BMP_BIT - 32), /* 197 -- 8, fd */ - BMP_C(0xfe000000) << (BMP_BIT - 32), /* 198 -- 7, 7f */ - BMP_C(0xfedcba00) << (BMP_BIT - 32), /* 199 -- 24, fedcba */ - BMP_C(0xfee80000) << (BMP_BIT - 32), /* 200 -- 16, fee8 */ - BMP_C(0xff000000) << (BMP_BIT - 32), /* 201 -- 8, ff */ - BMP_C(0xffc00000) << (BMP_BIT - 32), /* 202 -- 10, 3ff */ - BMP_C(0xfff00000) << (BMP_BIT - 32), /* 203 -- 12, fff */ - BMP_C(0xfffc0000) << (BMP_BIT - 32), /* 204 -- 14, 3fff */ - BMP_C(0xffff0000) << (BMP_BIT - 32), /* 205 -- 16, ffff */ - BMP_C(0xffffff00) << (BMP_BIT - 32), /* 206 -- 24, ffffff */ - BMP_C(0xfffffffc) << (BMP_BIT - 32), /* 207 -- 30,3fffffff */ - BMP_C(0xfffffffe) << (BMP_BIT - 32), /* 208 -- 31,7fffffff */ - BMP_C(0xffffffff) << (BMP_BIT - 32), /* 209 -- 32,ffffffff */ + BMP_C(0x00010000) << (BMP_BIT - 32), /* 1 -- 16, 0001 */ + BMP_C(0x00020000) << (BMP_BIT - 32), /* 2 -- 15, 0001 */ + BMP_C(0x00065b00) << (BMP_BIT - 32), /* 3 -- 24, 00065b */ + BMP_C(0x007e0000) << (BMP_BIT - 32), /* 4 -- 16, 007e */ + BMP_C(0x007f0000) << (BMP_BIT - 32), /* 5 -- 16, 007f */ + BMP_C(0x03400000) << (BMP_BIT - 32), /* 6 -- 11, 01a */ + BMP_C(0x0376e6e7) << (BMP_BIT - 32), /* 7 -- 32,0376e6e7 */ + BMP_C(0x04c11db7) << (BMP_BIT - 32), /* 8 -- 32,04c11db7 */ + BMP_C(0x05890000) << (BMP_BIT - 32), /* 9 -- 16, 0589 */ + BMP_C(0x07000000) << (BMP_BIT - 32), /* 10 -- 8, 07 */ + BMP_C(0x080b0000) << (BMP_BIT - 32), /* 11 -- 16, 080b */ + BMP_C(0x09823b6e) << (BMP_BIT - 32), /* 12 -- 31,04c11db7 */ + BMP_C(0x0b3c0000) << (BMP_BIT - 32), /* 13 -- 15, 059e */ + BMP_C(0x0c000000) << (BMP_BIT - 32), /* 14 -- 6, 03 */ + BMP_C(0x0c200000) << (BMP_BIT - 32), /* 15 -- 11, 061 */ + BMP_C(0x0c780000) << (BMP_BIT - 32), /* 16 -- 14, 031e */ + BMP_C(0x0fb30000) << (BMP_BIT - 32), /* 17 -- 16, 0fb3 */ + BMP_C(0x10210000) << (BMP_BIT - 32), /* 18 -- 16, 1021 */ + BMP_C(0x12000000) << (BMP_BIT - 32), /* 19 -- 7, 09 */ + BMP_C(0x130d2afc) << (BMP_BIT - 32), /* 20 -- 30,04c34abf */ + BMP_C(0x144e6300) << (BMP_BIT - 32), /* 21 -- 24, 144e63 */ + BMP_C(0x15000000) << (BMP_BIT - 32), /* 22 -- 8, 15 */ + BMP_C(0x1697d06a) << (BMP_BIT - 32), /* 23 -- 32,1697d06a */ + BMP_C(0x17800000) << (BMP_BIT - 32), /* 24 -- 12, 178 */ + BMP_C(0x18000000) << (BMP_BIT - 32), /* 25 -- 6, 06 */ + BMP_C(0x19d3c8d8) << (BMP_BIT - 32), /* 26 -- 31,0ce9e46c */ + BMP_C(0x1c000000) << (BMP_BIT - 32), /* 27 -- 6, 07 */ + BMP_C(0x1d000000) << (BMP_BIT - 32), /* 28 -- 8, 1d */ + BMP_C(0x1d0f0000) << (BMP_BIT - 32), /* 29 -- 16, 1d0f */ + BMP_C(0x1dcf0000) << (BMP_BIT - 32), /* 30 -- 16, 1dcf */ + BMP_C(0x1edc6f41) << (BMP_BIT - 32), /* 31 -- 32,1edc6f41 */ + BMP_C(0x1f23b800) << (BMP_BIT - 32), /* 32 -- 24, 1f23b8 */ + BMP_C(0x20000000) << (BMP_BIT - 32), /* 33 -- 4, 2 */ + BMP_C(0x200fa500) << (BMP_BIT - 32), /* 34 -- 24, 200fa5 */ + BMP_C(0x20140000) << (BMP_BIT - 32), /* 35 -- 14, 0805 */ + BMP_C(0x20b40000) << (BMP_BIT - 32), /* 36 -- 14, 082d */ + BMP_C(0x20fe0000) << (BMP_BIT - 32), /* 37 -- 16, 20fe */ + BMP_C(0x21890000) << (BMP_BIT - 32), /* 38 -- 16, 2189 */ + BMP_C(0x21cf0200) << (BMP_BIT - 32), /* 39 -- 24, 21cf02 */ + BMP_C(0x23ef5200) << (BMP_BIT - 32), /* 40 -- 24, 23ef52 */ + BMP_C(0x25000000) << (BMP_BIT - 32), /* 41 -- 8, 25 */ + BMP_C(0x26000000) << (BMP_BIT - 32), /* 42 -- 8, 26 */ + BMP_C(0x26b10000) << (BMP_BIT - 32), /* 43 -- 16, 26b1 */ + BMP_C(0x27818000) << (BMP_BIT - 32), /* 44 -- 17, 04f03 */ + BMP_C(0x27d00000) << (BMP_BIT - 32), /* 45 -- 13, 04fa */ + BMP_C(0x28000000) << (BMP_BIT - 32), /* 46 -- 5, 05 */ + BMP_C(0x29b10000) << (BMP_BIT - 32), /* 47 -- 16, 29b1 */ + BMP_C(0x2f000000) << (BMP_BIT - 32), /* 48 -- 8, 2f */ + BMP_C(0x30000000) << (BMP_BIT - 32), /* 49 -- 4, 3/ 5, 6 */ + BMP_C(0x3010bf7f) << (BMP_BIT - 32), /* 50 -- 32,3010bf7f */ + BMP_C(0x31000000) << (BMP_BIT - 32), /* 51 -- 8, 31 */ + BMP_C(0x31800000) << (BMP_BIT - 32), /* 52 -- 10, 0c6 */ + BMP_C(0x31c30000) << (BMP_BIT - 32), /* 53 -- 16, 31c3 */ + BMP_C(0x328b6300) << (BMP_BIT - 32), /* 54 -- 24, 328b63 */ + BMP_C(0x34000000) << (BMP_BIT - 32), /* 55 -- 6, 0d */ + BMP_C(0x340bc6d9) << (BMP_BIT - 32), /* 56 -- 32,340bc6d9 */ + BMP_C(0x37000000) << (BMP_BIT - 32), /* 57 -- 8, 37 */ + BMP_C(0x38000000) << (BMP_BIT - 32), /* 58 -- 5, 07 */ + BMP_C(0x39000000) << (BMP_BIT - 32), /* 59 -- 8, 39 */ + BMP_C(0x3d650000) << (BMP_BIT - 32), /* 60 -- 16, 3d65 */ + BMP_C(0x3e000000) << (BMP_BIT - 32), /* 61 -- 8, 3e */ + BMP_C(0x40000000) << (BMP_BIT - 32), /* 62 -- 3, 2 */ + BMP_C(0x42000000) << (BMP_BIT - 32), /* 63 -- 8, 42 */ + BMP_C(0x44c20000) << (BMP_BIT - 32), /* 64 -- 16, 44c2 */ + BMP_C(0x45270551) << (BMP_BIT - 32), /* 65 -- 32,45270551 */ + BMP_C(0x48000000) << (BMP_BIT - 32), /* 66 -- 5, 09 */ + BMP_C(0x49000000) << (BMP_BIT - 32), /* 67 -- 8, 49 */ + BMP_C(0x4a800000) << (BMP_BIT - 32), /* 68 -- 10, 12a */ + BMP_C(0x4acc0000) << (BMP_BIT - 32), /* 69 -- 15, 2566 */ + BMP_C(0x4b000000) << (BMP_BIT - 32), /* 70 -- 8, 4b */ + BMP_C(0x4b370000) << (BMP_BIT - 32), /* 71 -- 16, 4b37 */ + BMP_C(0x4c000000) << (BMP_BIT - 32), /* 72 -- 6, 13 */ + BMP_C(0x4c060000) << (BMP_BIT - 32), /* 73 -- 16, 4c06 */ + BMP_C(0x53000000) << (BMP_BIT - 32), /* 74 -- 8, 53 */ + BMP_C(0x55000000) << (BMP_BIT - 32), /* 75 -- 8, 55 */ + BMP_C(0x55555500) << (BMP_BIT - 32), /* 76 -- 24, 555555 */ + BMP_C(0x59350000) << (BMP_BIT - 32), /* 77 -- 16, 5935 */ + BMP_C(0x5d380000) << (BMP_BIT - 32), /* 78 -- 16, 5d38 */ + BMP_C(0x5d400000) << (BMP_BIT - 32), /* 79 -- 10, 175 */ + BMP_C(0x5d6dcb00) << (BMP_BIT - 32), /* 80 -- 24, 5d6dcb */ + BMP_C(0x60000000) << (BMP_BIT - 32), /* 81 -- 3, 3 */ + BMP_C(0x60e00000) << (BMP_BIT - 32), /* 82 -- 11, 307 */ + BMP_C(0x63d00000) << (BMP_BIT - 32), /* 83 -- 16, 63d0 */ + BMP_C(0x64000000) << (BMP_BIT - 32), /* 84 -- 6, 19 */ + BMP_C(0x66400000) << (BMP_BIT - 32), /* 85 -- 10, 199 */ + BMP_C(0x66c50000) << (BMP_BIT - 32), /* 86 -- 16, 66c5 */ + BMP_C(0x6f630000) << (BMP_BIT - 32), /* 87 -- 16, 6f63 */ + BMP_C(0x6f910000) << (BMP_BIT - 32), /* 88 -- 16, 6f91 */ + BMP_C(0x70000000) << (BMP_BIT - 32), /* 89 -- 4, 7 */ + BMP_C(0x70a00000) << (BMP_BIT - 32), /* 90 -- 11, 385 */ + BMP_C(0x755b0000) << (BMP_BIT - 32), /* 91 -- 16, 755b */ + BMP_C(0x765e7680) << (BMP_BIT - 32), /* 92 -- 32,765e7680 */ + BMP_C(0x76c20800) << (BMP_BIT - 32), /* 93 -- 32, 0ed841 */ + BMP_C(0x7979bd00) << (BMP_BIT - 32), /* 94 -- 24, 7979bd */ + BMP_C(0x7e000000) << (BMP_BIT - 32), /* 95 -- 8, 7e */ + BMP_C(0x80000000) << (BMP_BIT - 32), /* 96 -- 3, 4 */ + BMP_C(0x80006300) << (BMP_BIT - 32), /* 97 -- 24, 800063 */ + BMP_C(0x80050000) << (BMP_BIT - 32), /* 98 -- 16, 8005 */ + BMP_C(0x800d0000) << (BMP_BIT - 32), /* 99 -- 16, 800d */ + BMP_C(0x800fe300) << (BMP_BIT - 32), /* 100 -- 24, 800fe3 */ + BMP_C(0x80b40000) << (BMP_BIT - 32), /* 101 -- 14, 202d */ + BMP_C(0x80c2e71c) << (BMP_BIT - 32), /* 102 -- 30,2030b9c7 */ + BMP_C(0x80f00000) << (BMP_BIT - 32), /* 103 -- 12, 80f */ + BMP_C(0x814141ab) << (BMP_BIT - 32), /* 104 -- 32,814141ab */ + BMP_C(0x8144c800) << (BMP_BIT - 32), /* 105 -- 21, 102899 */ + BMP_C(0x864cfb00) << (BMP_BIT - 32), /* 106 -- 24, 864cfb */ + BMP_C(0x87315576) << (BMP_BIT - 32), /* 107 -- 32,87315576 */ + BMP_C(0x89ec0000) << (BMP_BIT - 32), /* 108 -- 16, 89ec */ + BMP_C(0x8a000000) << (BMP_BIT - 32), /* 109 -- 7, 45 */ + BMP_C(0x8b320000) << (BMP_BIT - 32), /* 110 -- 15, 4599 */ + BMP_C(0x8bb70000) << (BMP_BIT - 32), /* 111 -- 16, 8bb7 */ + BMP_C(0x8cc00000) << (BMP_BIT - 32), /* 112 -- 10, 233 */ + BMP_C(0x904cddbf) << (BMP_BIT - 32), /* 113 -- 32,904cddbf */ + BMP_C(0x906e0000) << (BMP_BIT - 32), /* 114 -- 16, 906e */ + BMP_C(0x94000000) << (BMP_BIT - 32), /* 115 -- 8, 94 */ + BMP_C(0x97000000) << (BMP_BIT - 32), /* 116 -- 8, 97 */ + BMP_C(0x98000000) << (BMP_BIT - 32), /* 117 -- 6, 26 */ + BMP_C(0x99000000) << (BMP_BIT - 32), /* 118 -- 8, 99 */ + BMP_C(0x9b000000) << (BMP_BIT - 32), /* 119 -- 8, 9b */ + BMP_C(0x9c000000) << (BMP_BIT - 32), /* 120 -- 6, 27 */ + BMP_C(0x9d5e4de2) << (BMP_BIT - 32), /* 121 -- 31,4eaf26f1 */ + BMP_C(0x9e000000) << (BMP_BIT - 32), /* 122 -- 7, 4f */ + BMP_C(0x9ecf0000) << (BMP_BIT - 32), /* 123 -- 16, 9ecf */ + BMP_C(0xa0660000) << (BMP_BIT - 32), /* 124 -- 16, a066 */ + BMP_C(0xa0970000) << (BMP_BIT - 32), /* 125 -- 16, a097 */ + BMP_C(0xa1000000) << (BMP_BIT - 32), /* 126 -- 8, a1 */ + BMP_C(0xa3660000) << (BMP_BIT - 32), /* 127 -- 16, a366 */ + BMP_C(0xa6000000) << (BMP_BIT - 32), /* 128 -- 7, 53 */ + BMP_C(0xa7000000) << (BMP_BIT - 32), /* 129 -- 8, a7 */ + BMP_C(0xa8000000) << (BMP_BIT - 32), /* 130 -- 5, 15 */ + BMP_C(0xa8190000) << (BMP_BIT - 32), /* 131 -- 16, a819 */ + BMP_C(0xa833982b) << (BMP_BIT - 32), /* 132 -- 32,a833982b */ + BMP_C(0xabcdef00) << (BMP_BIT - 32), /* 133 -- 24, abcdef */ + BMP_C(0xac000000) << (BMP_BIT - 32), /* 134 -- 8, ac */ + BMP_C(0xaee70000) << (BMP_BIT - 32), /* 135 -- 16, aee7 */ + BMP_C(0xb0000000) << (BMP_BIT - 32), /* 136 -- 4, b */ + BMP_C(0xb0010000) << (BMP_BIT - 32), /* 137 -- 16, b001 */ + BMP_C(0xb2aa0000) << (BMP_BIT - 32), /* 138 -- 16, b2aa */ + BMP_C(0xb3400000) << (BMP_BIT - 32), /* 139 -- 12, b34 */ + BMP_C(0xb42d8000) << (BMP_BIT - 32), /* 140 -- 17, 1685b */ + BMP_C(0xb4600000) << (BMP_BIT - 32), /* 141 -- 11, 5a3 */ + BMP_C(0xb4c80000) << (BMP_BIT - 32), /* 142 -- 16, b4c8 */ + BMP_C(0xb4f3e600) << (BMP_BIT - 32), /* 143 -- 24, b4f3e6 */ + BMP_C(0xb704ce00) << (BMP_BIT - 32), /* 144 -- 24, b704ce */ + BMP_C(0xb798b438) << (BMP_BIT - 32), /* 145 -- 32,b798b438 */ + BMP_C(0xbb3d0000) << (BMP_BIT - 32), /* 146 -- 16, bb3d */ + BMP_C(0xbc000000) << (BMP_BIT - 32), /* 147 -- 6,2f/ 8,bc */ + BMP_C(0xbd0be338) << (BMP_BIT - 32), /* 148 -- 32,bd0be338 */ + BMP_C(0xbdf40000) << (BMP_BIT - 32), /* 149 -- 16, bdf4 */ + BMP_C(0xbf050000) << (BMP_BIT - 32), /* 150 -- 16, bf05 */ + BMP_C(0xc0000000) << (BMP_BIT - 32), /* 151 -- 3, 6 */ + BMP_C(0xc2000000) << (BMP_BIT - 32), /* 152 -- 7, 61 */ + BMP_C(0xc25a5600) << (BMP_BIT - 32), /* 153 -- 24, c25a56 */ + BMP_C(0xc2b70000) << (BMP_BIT - 32), /* 154 -- 16, c2b7 */ + BMP_C(0xc2b80000) << (BMP_BIT - 32), /* 155 -- 14, 30ae */ + BMP_C(0xc4000000) << (BMP_BIT - 32), /* 156 -- 8, c4 */ + BMP_C(0xc6c60000) << (BMP_BIT - 32), /* 157 -- 16, c6c6 */ + BMP_C(0xc7000000) << (BMP_BIT - 32), /* 158 -- 8, c7 */ + BMP_C(0xc704dd7b) << (BMP_BIT - 32), /* 159 -- 32,c704dd7b */ + BMP_C(0xc8000000) << (BMP_BIT - 32), /* 160 -- 5, 19 */ + BMP_C(0xc8670000) << (BMP_BIT - 32), /* 161 -- 16, c867 */ + BMP_C(0xcbf43926) << (BMP_BIT - 32), /* 162 -- 32,cbf43926 */ + BMP_C(0xcde70300) << (BMP_BIT - 32), /* 163 -- 24, cde703 */ + BMP_C(0xce3c0000) << (BMP_BIT - 32), /* 164 -- 16, ce3c */ + BMP_C(0xd0000000) << (BMP_BIT - 32), /* 165 -- 8, d0 */ + BMP_C(0xd02a0000) << (BMP_BIT - 32), /* 166 -- 15, 6815 */ + BMP_C(0xd0db0000) << (BMP_BIT - 32), /* 167 -- 16, d0db */ + BMP_C(0xd3100000) << (BMP_BIT - 32), /* 168 -- 12, d31 */ + BMP_C(0xd3be9568) << (BMP_BIT - 32), /* 169 -- 30,34efa55a */ + BMP_C(0xd4d00000) << (BMP_BIT - 32), /* 170 -- 12, d4d */ + BMP_C(0xd5000000) << (BMP_BIT - 32), /* 171 -- 8, d5 */ + BMP_C(0xd64e0000) << (BMP_BIT - 32), /* 172 -- 16, d64e */ + BMP_C(0xda000000) << (BMP_BIT - 32), /* 173 -- 8, da */ + BMP_C(0xdaf00000) << (BMP_BIT - 32), /* 174 -- 12, daf */ + BMP_C(0xdebb20e3) << (BMP_BIT - 32), /* 175 -- 32,debb20e3 */ + BMP_C(0xdf000000) << (BMP_BIT - 32), /* 176 -- 8, df */ + BMP_C(0xe0000000) << (BMP_BIT - 32), /* 177 -- 3, 7 */ + BMP_C(0xe3069283) << (BMP_BIT - 32), /* 178 -- 32,e3069283 */ + BMP_C(0xe3940000) << (BMP_BIT - 32), /* 179 -- 16, e394 */ + BMP_C(0xe5cc0000) << (BMP_BIT - 32), /* 180 -- 16, e5cc */ + BMP_C(0xe7a80000) << (BMP_BIT - 32), /* 181 -- 13, 1cf5 */ + BMP_C(0xe8000000) << (BMP_BIT - 32), /* 182 -- 6, 3a */ + BMP_C(0xea000000) << (BMP_BIT - 32), /* 183 -- 7, 75 */ + BMP_C(0xea820000) << (BMP_BIT - 32), /* 184 -- 16, ea82 */ + BMP_C(0xec000000) << (BMP_BIT - 32), /* 185 -- 6, 3b */ + BMP_C(0xf0000000) << (BMP_BIT - 32), /* 186 -- 4, f */ + BMP_C(0xf0b80000) << (BMP_BIT - 32), /* 187 -- 16, f0b8 */ + BMP_C(0xf1300000) << (BMP_BIT - 32), /* 188 -- 12, f13 */ + BMP_C(0xf4000000) << (BMP_BIT - 32), /* 189 -- 8, f4 */ + BMP_C(0xf4acfb13) << (BMP_BIT - 32), /* 190 -- 32,f4acfb13 */ + BMP_C(0xf5b00000) << (BMP_BIT - 32), /* 191 -- 12, f5b */ + BMP_C(0xf6400000) << (BMP_BIT - 32), /* 192 -- 10, 3d9 */ + BMP_C(0xf7000000) << (BMP_BIT - 32), /* 193 -- 8, f7 */ + BMP_C(0xf8000000) << (BMP_BIT - 32), /* 194 -- 5, 1f */ + BMP_C(0xfc000000) << (BMP_BIT - 32), /* 195 -- 6, 3f */ + BMP_C(0xfc891918) << (BMP_BIT - 32), /* 196 -- 32,fc891918 */ + BMP_C(0xfd000000) << (BMP_BIT - 32), /* 197 -- 8, fd */ + BMP_C(0xfe000000) << (BMP_BIT - 32), /* 198 -- 7, 7f */ + BMP_C(0xfedcba00) << (BMP_BIT - 32), /* 199 -- 24, fedcba */ + BMP_C(0xfee80000) << (BMP_BIT - 32), /* 200 -- 16, fee8 */ + BMP_C(0xff000000) << (BMP_BIT - 32), /* 201 -- 8, ff */ + BMP_C(0xffc00000) << (BMP_BIT - 32), /* 202 -- 10, 3ff */ + BMP_C(0xfff00000) << (BMP_BIT - 32), /* 203 -- 12, fff */ + BMP_C(0xfffc0000) << (BMP_BIT - 32), /* 204 -- 14, 3fff */ + BMP_C(0xffff0000) << (BMP_BIT - 32), /* 205 -- 16, ffff */ + BMP_C(0xffffff00) << (BMP_BIT - 32), /* 206 -- 24, ffffff */ + BMP_C(0xfffffffc) << (BMP_BIT - 32), /* 207 -- 30,3fffffff */ + BMP_C(0xfffffffe) << (BMP_BIT - 32), /* 208 -- 31,7fffffff */ + BMP_C(0xffffffff) << (BMP_BIT - 32), /* 209 -- 32,ffffffff */ }; static const struct malias aliases[]; diff --git a/client/deps/vec/vec/private/gcc.h b/client/deps/vec/vec/private/gcc.h index 4736a47e9..ef48229c3 100644 --- a/client/deps/vec/vec/private/gcc.h +++ b/client/deps/vec/vec/private/gcc.h @@ -2,9 +2,8 @@ #ifndef VEC_FN_ADD #define VEC_FN_ADD static inline union vec -vec_add (const union vec a, const union vec b) -{ - return (union vec) { .gcc.f = a.gcc.f + b.gcc.f }; + vec_add(const union vec a, const union vec b) { + return (union vec) { .gcc.f = a.gcc.f + b.gcc.f }; } #endif @@ -12,9 +11,8 @@ vec_add (const union vec a, const union vec b) #ifndef VEC_FN_IADD #define VEC_FN_IADD static inline union vec -vec_iadd (const union vec a, const union vec b) -{ - return (union vec) { .gcc.i = a.gcc.i + b.gcc.i }; + vec_iadd(const union vec a, const union vec b) { + return (union vec) { .gcc.i = a.gcc.i + b.gcc.i }; } #endif @@ -22,9 +20,8 @@ vec_iadd (const union vec a, const union vec b) #ifndef VEC_FN_UADD #define VEC_FN_UADD static inline union vec -vec_uadd (const union vec a, const union vec b) -{ - return (union vec) { .gcc.u = a.gcc.u + b.gcc.u }; + vec_uadd(const union vec a, const union vec b) { + return (union vec) { .gcc.u = a.gcc.u + b.gcc.u }; } #endif @@ -32,9 +29,8 @@ vec_uadd (const union vec a, const union vec b) #ifndef VEC_FN_SUB #define VEC_FN_SUB static inline union vec -vec_sub (const union vec a, const union vec b) -{ - return (union vec) { .gcc.f = a.gcc.f - b.gcc.f }; + vec_sub(const union vec a, const union vec b) { + return (union vec) { .gcc.f = a.gcc.f - b.gcc.f }; } #endif @@ -42,9 +38,8 @@ vec_sub (const union vec a, const union vec b) #ifndef VEC_FN_ISUB #define VEC_FN_ISUB static inline union vec -vec_isub (const union vec a, const union vec b) -{ - return (union vec) { .gcc.i = a.gcc.i - b.gcc.i }; + vec_isub(const union vec a, const union vec b) { + return (union vec) { .gcc.i = a.gcc.i - b.gcc.i }; } #endif @@ -52,9 +47,8 @@ vec_isub (const union vec a, const union vec b) #ifndef VEC_FN_USUB #define VEC_FN_USUB static inline union vec -vec_usub (const union vec a, const union vec b) -{ - return (union vec) { .gcc.u = a.gcc.u - b.gcc.u }; + vec_usub(const union vec a, const union vec b) { + return (union vec) { .gcc.u = a.gcc.u - b.gcc.u }; } #endif @@ -62,9 +56,8 @@ vec_usub (const union vec a, const union vec b) #ifndef VEC_FN_MUL #define VEC_FN_MUL static inline union vec -vec_mul (const union vec a, const union vec b) -{ - return (union vec) { .gcc.f = a.gcc.f * b.gcc.f }; + vec_mul(const union vec a, const union vec b) { + return (union vec) { .gcc.f = a.gcc.f * b.gcc.f }; } #endif @@ -72,9 +65,8 @@ vec_mul (const union vec a, const union vec b) #ifndef VEC_FN_DIV #define VEC_FN_DIV static inline union vec -vec_div (const union vec a, const union vec b) -{ - return (union vec) { .gcc.f = a.gcc.f / b.gcc.f }; + vec_div(const union vec a, const union vec b) { + return (union vec) { .gcc.f = a.gcc.f / b.gcc.f }; } #endif @@ -82,9 +74,8 @@ vec_div (const union vec a, const union vec b) #ifndef VEC_FN_AND #define VEC_FN_AND static inline union vec -vec_and (const union vec a, const union vec b) -{ - return (union vec) { .gcc.u = a.gcc.u & b.gcc.u }; + vec_and(const union vec a, const union vec b) { + return (union vec) { .gcc.u = a.gcc.u & b.gcc.u }; } #endif @@ -92,9 +83,8 @@ vec_and (const union vec a, const union vec b) #ifndef VEC_FN_OR #define VEC_FN_OR static inline union vec -vec_or (const union vec a, const union vec b) -{ - return (union vec) { .gcc.u = a.gcc.u | b.gcc.u }; + vec_or(const union vec a, const union vec b) { + return (union vec) { .gcc.u = a.gcc.u | b.gcc.u }; } #endif @@ -102,9 +92,8 @@ vec_or (const union vec a, const union vec b) #ifndef VEC_FN_XOR #define VEC_FN_XOR static inline union vec -vec_xor (const union vec a, const union vec b) -{ - return (union vec) { .gcc.u = a.gcc.u ^ b.gcc.u }; + vec_xor(const union vec a, const union vec b) { + return (union vec) { .gcc.u = a.gcc.u ^ b.gcc.u }; } #endif @@ -112,32 +101,30 @@ vec_xor (const union vec a, const union vec b) #ifndef VEC_FN_NOT #define VEC_FN_NOT static inline union vec -vec_not (const union vec v) -{ - return (union vec) { .gcc.u = ~v.gcc.u }; + vec_not(const union vec v) { + return (union vec) { .gcc.u = ~v.gcc.u }; } #endif // GCC added support for vector comparisons in version 4.8: #ifdef __GNUC__ - #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - #define VEC_GCC_COMPARE - #endif +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) +#define VEC_GCC_COMPARE +#endif #else - // Assume we're using clang - it's supported vector comparisons since at - // least version 3.0, possibly earlier: - #define VEC_GCC_COMPARE +// Assume we're using clang - it's supported vector comparisons since at +// least version 3.0, possibly earlier: +#define VEC_GCC_COMPARE #endif // Return float version of a == b: #ifdef VEC_GCC_COMPARE -#ifndef VEC_FN_EQ +#ifndef VEC_FN_EQ #define VEC_FN_EQ static inline union vec -vec_eq (const union vec a, const union vec b) -{ - return (union vec) { .gcc.i = a.gcc.f == b.gcc.f }; + vec_eq(const union vec a, const union vec b) { + return (union vec) { .gcc.i = a.gcc.f == b.gcc.f }; } #endif #endif @@ -147,9 +134,8 @@ vec_eq (const union vec a, const union vec b) #ifndef VEC_FN_IEQ #define VEC_FN_IEQ static inline union vec -vec_ieq (const union vec a, const union vec b) -{ - return (union vec) { .gcc.i = a.gcc.i == b.gcc.i }; + vec_ieq(const union vec a, const union vec b) { + return (union vec) { .gcc.i = a.gcc.i == b.gcc.i }; } #endif #endif @@ -159,9 +145,8 @@ vec_ieq (const union vec a, const union vec b) #ifndef VEC_FN_UEQ #define VEC_FN_UEQ static inline union vec -vec_ueq (const union vec a, const union vec b) -{ - return (union vec) { .gcc.i = a.gcc.u == b.gcc.u }; + vec_ueq(const union vec a, const union vec b) { + return (union vec) { .gcc.i = a.gcc.u == b.gcc.u }; } #endif #endif @@ -171,9 +156,8 @@ vec_ueq (const union vec a, const union vec b) #ifndef VEC_FN_LT #define VEC_FN_LT static inline union vec -vec_lt (const union vec a, const union vec b) -{ - return (union vec) { .gcc.i = a.gcc.f < b.gcc.f }; + vec_lt(const union vec a, const union vec b) { + return (union vec) { .gcc.i = a.gcc.f < b.gcc.f }; } #endif #endif @@ -183,9 +167,8 @@ vec_lt (const union vec a, const union vec b) #ifndef VEC_FN_ILT #define VEC_FN_ILT static inline union vec -vec_ilt (const union vec a, const union vec b) -{ - return (union vec) { .gcc.i = a.gcc.i < b.gcc.i }; + vec_ilt(const union vec a, const union vec b) { + return (union vec) { .gcc.i = a.gcc.i < b.gcc.i }; } #endif #endif @@ -195,9 +178,8 @@ vec_ilt (const union vec a, const union vec b) #ifndef VEC_FN_ULT #define VEC_FN_ULT static inline union vec -vec_ult (const union vec a, const union vec b) -{ - return (union vec) { .gcc.i = a.gcc.u < b.gcc.u }; + vec_ult(const union vec a, const union vec b) { + return (union vec) { .gcc.i = a.gcc.u < b.gcc.u }; } #endif #endif @@ -207,9 +189,8 @@ vec_ult (const union vec a, const union vec b) #ifndef VEC_FN_LE #define VEC_FN_LE static inline union vec -vec_le (const union vec a, const union vec b) -{ - return (union vec) { .gcc.i = a.gcc.f <= b.gcc.f }; + vec_le(const union vec a, const union vec b) { + return (union vec) { .gcc.i = a.gcc.f <= b.gcc.f }; } #endif #endif @@ -219,9 +200,8 @@ vec_le (const union vec a, const union vec b) #ifndef VEC_FN_ILE #define VEC_FN_ILE static inline union vec -vec_ile (const union vec a, const union vec b) -{ - return (union vec) { .gcc.i = a.gcc.i <= b.gcc.i }; + vec_ile(const union vec a, const union vec b) { + return (union vec) { .gcc.i = a.gcc.i <= b.gcc.i }; } #endif #endif @@ -231,9 +211,8 @@ vec_ile (const union vec a, const union vec b) #ifndef VEC_FN_ULE #define VEC_FN_ULE static inline union vec -vec_ule (const union vec a, const union vec b) -{ - return (union vec) { .gcc.i = a.gcc.u <= b.gcc.u }; + vec_ule(const union vec a, const union vec b) { + return (union vec) { .gcc.i = a.gcc.u <= b.gcc.u }; } #endif #endif @@ -243,9 +222,8 @@ vec_ule (const union vec a, const union vec b) #ifndef VEC_FN_GT #define VEC_FN_GT static inline union vec -vec_gt (const union vec a, const union vec b) -{ - return (union vec) { .gcc.i = a.gcc.f > b.gcc.f }; + vec_gt(const union vec a, const union vec b) { + return (union vec) { .gcc.i = a.gcc.f > b.gcc.f }; } #endif #endif @@ -255,9 +233,8 @@ vec_gt (const union vec a, const union vec b) #ifndef VEC_FN_IGT #define VEC_FN_IGT static inline union vec -vec_igt (const union vec a, const union vec b) -{ - return (union vec) { .gcc.i = a.gcc.i > b.gcc.i }; + vec_igt(const union vec a, const union vec b) { + return (union vec) { .gcc.i = a.gcc.i > b.gcc.i }; } #endif #endif @@ -267,9 +244,8 @@ vec_igt (const union vec a, const union vec b) #ifndef VEC_FN_UGT #define VEC_FN_UGT static inline union vec -vec_ugt (const union vec a, const union vec b) -{ - return (union vec) { .gcc.i = a.gcc.u > b.gcc.u }; + vec_ugt(const union vec a, const union vec b) { + return (union vec) { .gcc.i = a.gcc.u > b.gcc.u }; } #endif #endif @@ -279,9 +255,8 @@ vec_ugt (const union vec a, const union vec b) #ifndef VEC_FN_GE #define VEC_FN_GE static inline union vec -vec_ge (const union vec a, const union vec b) -{ - return (union vec) { .gcc.i = a.gcc.f >= b.gcc.f }; + vec_ge(const union vec a, const union vec b) { + return (union vec) { .gcc.i = a.gcc.f >= b.gcc.f }; } #endif #endif @@ -291,9 +266,8 @@ vec_ge (const union vec a, const union vec b) #ifndef VEC_FN_IGE #define VEC_FN_IGE static inline union vec -vec_ige (const union vec a, const union vec b) -{ - return (union vec) { .gcc.i = a.gcc.i >= b.gcc.i }; + vec_ige(const union vec a, const union vec b) { + return (union vec) { .gcc.i = a.gcc.i >= b.gcc.i }; } #endif #endif @@ -303,9 +277,8 @@ vec_ige (const union vec a, const union vec b) #ifndef VEC_FN_UGE #define VEC_FN_UGE static inline union vec -vec_uge (const union vec a, const union vec b) -{ - return (union vec) { .gcc.i = a.gcc.u >= b.gcc.u }; + vec_uge(const union vec a, const union vec b) { + return (union vec) { .gcc.i = a.gcc.u >= b.gcc.u }; } #endif #endif diff --git a/client/deps/vec/vec/private/generic.h b/client/deps/vec/vec/private/generic.h index ec2e8bb21..a4cbc41a1 100644 --- a/client/deps/vec/vec/private/generic.h +++ b/client/deps/vec/vec/private/generic.h @@ -2,9 +2,8 @@ #ifndef VEC_FN_ #define VEC_FN_ static inline union vec -vec (const float x, const float y, const float z, const float w) -{ - return (union vec) { .x = x, .y = y, .z = z, .w = w }; + vec(const float x, const float y, const float z, const float w) { + return (union vec) { .x = x, .y = y, .z = z, .w = w }; } #endif @@ -12,9 +11,8 @@ vec (const float x, const float y, const float z, const float w) #ifndef VEC_FN_I #define VEC_FN_I static inline union vec -vec_i (const int32_t x, const int32_t y, const int32_t z, const int32_t w) -{ - return (union vec) { .xi = x, .yi = y, .zi = z, .wi = w }; + vec_i(const int32_t x, const int32_t y, const int32_t z, const int32_t w) { + return (union vec) { .xi = x, .yi = y, .zi = z, .wi = w }; } #endif @@ -22,9 +20,8 @@ vec_i (const int32_t x, const int32_t y, const int32_t z, const int32_t w) #ifndef VEC_FN_U #define VEC_FN_U static inline union vec -vec_u (const uint32_t x, const uint32_t y, const uint32_t z, const uint32_t w) -{ - return (union vec) { .xu = x, .yu = y, .zu = z, .wu = w }; + vec_u(const uint32_t x, const uint32_t y, const uint32_t z, const uint32_t w) { + return (union vec) { .xu = x, .yu = y, .zu = z, .wu = w }; } #endif @@ -32,9 +29,8 @@ vec_u (const uint32_t x, const uint32_t y, const uint32_t z, const uint32_t w) #ifndef VEC_FN_1 #define VEC_FN_1 static inline union vec -vec_1 (const float val) -{ - return vec(val, val, val, val); + vec_1(const float val) { + return vec(val, val, val, val); } #endif @@ -42,9 +38,8 @@ vec_1 (const float val) #ifndef VEC_FN_I1 #define VEC_FN_I1 static inline union vec -vec_i1 (const int32_t val) -{ - return vec_i(val, val, val, val); + vec_i1(const int32_t val) { + return vec_i(val, val, val, val); } #endif @@ -52,9 +47,8 @@ vec_i1 (const int32_t val) #ifndef VEC_FN_U1 #define VEC_FN_U1 static inline union vec -vec_u1 (const uint32_t val) -{ - return vec_u(val, val, val, val); + vec_u1(const uint32_t val) { + return vec_u(val, val, val, val); } #endif @@ -62,9 +56,8 @@ vec_u1 (const uint32_t val) #ifndef VEC_FN_ZERO #define VEC_FN_ZERO static inline union vec -vec_zero (void) -{ - return vec_1(0.0f); + vec_zero(void) { + return vec_1(0.0f); } #endif @@ -72,9 +65,8 @@ vec_zero (void) #ifndef VEC_FN_IZERO #define VEC_FN_IZERO static inline union vec -vec_izero (void) -{ - return vec_i1(0); + vec_izero(void) { + return vec_i1(0); } #endif @@ -82,9 +74,8 @@ vec_izero (void) #ifndef VEC_FN_UZERO #define VEC_FN_UZERO static inline union vec -vec_uzero (void) -{ - return vec_u1(0U); + vec_uzero(void) { + return vec_u1(0U); } #endif @@ -92,9 +83,8 @@ vec_uzero (void) #ifndef VEC_FN_TO_INT #define VEC_FN_TO_INT static inline union vec -vec_to_int (const union vec v) -{ - return (union vec) { .xi = v.x, .yi = v.y, .zi = v.z, .wi = v.w }; + vec_to_int(const union vec v) { + return (union vec) { .xi = v.x, .yi = v.y, .zi = v.z, .wi = v.w }; } #endif @@ -102,9 +92,8 @@ vec_to_int (const union vec v) #ifndef VEC_FN_TO_FLOAT #define VEC_FN_TO_FLOAT static inline union vec -vec_to_float (const union vec v) -{ - return (union vec) { .x = v.xi, .y = v.yi, .z = v.zi, .w = v.wi }; + vec_to_float(const union vec v) { + return (union vec) { .x = v.xi, .y = v.yi, .z = v.zi, .w = v.wi }; } #endif @@ -112,14 +101,13 @@ vec_to_float (const union vec v) #ifndef VEC_FN_ADD #define VEC_FN_ADD static inline union vec -vec_add (const union vec a, const union vec b) -{ - return (union vec) { - .x = a.x + b.x, - .y = a.y + b.y, - .z = a.z + b.z, - .w = a.w + b.w, - }; + vec_add(const union vec a, const union vec b) { + return (union vec) { + .x = a.x + b.x, + .y = a.y + b.y, + .z = a.z + b.z, + .w = a.w + b.w, + }; } #endif @@ -127,14 +115,13 @@ vec_add (const union vec a, const union vec b) #ifndef VEC_FN_IADD #define VEC_FN_IADD static inline union vec -vec_iadd (const union vec a, const union vec b) -{ - return (union vec) { - .xi = a.xi + b.xi, - .yi = a.yi + b.yi, - .zi = a.zi + b.zi, - .wi = a.wi + b.wi, - }; + vec_iadd(const union vec a, const union vec b) { + return (union vec) { + .xi = a.xi + b.xi, + .yi = a.yi + b.yi, + .zi = a.zi + b.zi, + .wi = a.wi + b.wi, + }; } #endif @@ -142,14 +129,13 @@ vec_iadd (const union vec a, const union vec b) #ifndef VEC_FN_UADD #define VEC_FN_UADD static inline union vec -vec_uadd (const union vec a, const union vec b) -{ - return (union vec) { - .xu = a.xu + b.xu, - .yu = a.yu + b.yu, - .zu = a.zu + b.zu, - .wu = a.wu + b.wu, - }; + vec_uadd(const union vec a, const union vec b) { + return (union vec) { + .xu = a.xu + b.xu, + .yu = a.yu + b.yu, + .zu = a.zu + b.zu, + .wu = a.wu + b.wu, + }; } #endif @@ -157,14 +143,13 @@ vec_uadd (const union vec a, const union vec b) #ifndef VEC_FN_SUB #define VEC_FN_SUB static inline union vec -vec_sub (const union vec a, const union vec b) -{ - return (union vec) { - .x = a.x - b.x, - .y = a.y - b.y, - .z = a.z - b.z, - .w = a.w - b.w, - }; + vec_sub(const union vec a, const union vec b) { + return (union vec) { + .x = a.x - b.x, + .y = a.y - b.y, + .z = a.z - b.z, + .w = a.w - b.w, + }; } #endif @@ -172,14 +157,13 @@ vec_sub (const union vec a, const union vec b) #ifndef VEC_FN_ISUB #define VEC_FN_ISUB static inline union vec -vec_isub (const union vec a, const union vec b) -{ - return (union vec) { - .xi = a.xi - b.xi, - .yi = a.yi - b.yi, - .zi = a.zi - b.zi, - .wi = a.wi - b.wi, - }; + vec_isub(const union vec a, const union vec b) { + return (union vec) { + .xi = a.xi - b.xi, + .yi = a.yi - b.yi, + .zi = a.zi - b.zi, + .wi = a.wi - b.wi, + }; } #endif @@ -187,14 +171,13 @@ vec_isub (const union vec a, const union vec b) #ifndef VEC_FN_USUB #define VEC_FN_USUB static inline union vec -vec_usub (const union vec a, const union vec b) -{ - return (union vec) { - .xu = a.xu - b.xu, - .yu = a.yu - b.yu, - .zu = a.zu - b.zu, - .wu = a.wu - b.wu, - }; + vec_usub(const union vec a, const union vec b) { + return (union vec) { + .xu = a.xu - b.xu, + .yu = a.yu - b.yu, + .zu = a.zu - b.zu, + .wu = a.wu - b.wu, + }; } #endif @@ -202,14 +185,13 @@ vec_usub (const union vec a, const union vec b) #ifndef VEC_FN_MUL #define VEC_FN_MUL static inline union vec -vec_mul (const union vec a, const union vec b) -{ - return (union vec) { - .x = a.x * b.x, - .y = a.y * b.y, - .z = a.z * b.z, - .w = a.w * b.w, - }; + vec_mul(const union vec a, const union vec b) { + return (union vec) { + .x = a.x * b.x, + .y = a.y * b.y, + .z = a.z * b.z, + .w = a.w * b.w, + }; } #endif @@ -217,14 +199,13 @@ vec_mul (const union vec a, const union vec b) #ifndef VEC_FN_DIV #define VEC_FN_DIV static inline union vec -vec_div (const union vec a, const union vec b) -{ - return (union vec) { - .x = a.x / b.x, - .y = a.y / b.y, - .z = a.z / b.z, - .w = a.w / b.w, - }; + vec_div(const union vec a, const union vec b) { + return (union vec) { + .x = a.x / b.x, + .y = a.y / b.y, + .z = a.z / b.z, + .w = a.w / b.w, + }; } #endif @@ -232,14 +213,13 @@ vec_div (const union vec a, const union vec b) #ifndef VEC_FN_AND #define VEC_FN_AND static inline union vec -vec_and (const union vec a, const union vec b) -{ - return (union vec) { - .xu = a.xu & b.xu, - .yu = a.yu & b.yu, - .zu = a.zu & b.zu, - .wu = a.wu & b.wu, - }; + vec_and(const union vec a, const union vec b) { + return (union vec) { + .xu = a.xu & b.xu, + .yu = a.yu & b.yu, + .zu = a.zu & b.zu, + .wu = a.wu & b.wu, + }; } #endif @@ -247,14 +227,13 @@ vec_and (const union vec a, const union vec b) #ifndef VEC_FN_OR #define VEC_FN_OR static inline union vec -vec_or (const union vec a, const union vec b) -{ - return (union vec) { - .xu = a.xu | b.xu, - .yu = a.yu | b.yu, - .zu = a.zu | b.zu, - .wu = a.wu | b.wu, - }; + vec_or(const union vec a, const union vec b) { + return (union vec) { + .xu = a.xu | b.xu, + .yu = a.yu | b.yu, + .zu = a.zu | b.zu, + .wu = a.wu | b.wu, + }; } #endif @@ -262,14 +241,13 @@ vec_or (const union vec a, const union vec b) #ifndef VEC_FN_XOR #define VEC_FN_XOR static inline union vec -vec_xor (const union vec a, const union vec b) -{ - return (union vec) { - .xu = a.xu ^ b.xu, - .yu = a.yu ^ b.yu, - .zu = a.zu ^ b.zu, - .wu = a.wu ^ b.wu, - }; + vec_xor(const union vec a, const union vec b) { + return (union vec) { + .xu = a.xu ^ b.xu, + .yu = a.yu ^ b.yu, + .zu = a.zu ^ b.zu, + .wu = a.wu ^ b.wu, + }; } #endif @@ -277,14 +255,13 @@ vec_xor (const union vec a, const union vec b) #ifndef VEC_FN_NOT #define VEC_FN_NOT static inline union vec -vec_not (const union vec v) -{ - return (union vec) { - .xu = ~v.xu, - .yu = ~v.yu, - .zu = ~v.zu, - .wu = ~v.wu, - }; + vec_not(const union vec v) { + return (union vec) { + .xu = ~v.xu, + .yu = ~v.yu, + .zu = ~v.zu, + .wu = ~v.wu, + }; } #endif @@ -292,14 +269,13 @@ vec_not (const union vec v) #ifndef VEC_FN_EQ #define VEC_FN_EQ static inline union vec -vec_eq (const union vec a, const union vec b) -{ - return (union vec) { - .xi = a.x == b.x ? -1 : 0, - .yi = a.y == b.y ? -1 : 0, - .zi = a.z == b.z ? -1 : 0, - .wi = a.w == b.w ? -1 : 0, - }; + vec_eq(const union vec a, const union vec b) { + return (union vec) { + .xi = a.x == b.x ? -1 : 0, + .yi = a.y == b.y ? -1 : 0, + .zi = a.z == b.z ? -1 : 0, + .wi = a.w == b.w ? -1 : 0, + }; } #endif @@ -307,14 +283,13 @@ vec_eq (const union vec a, const union vec b) #ifndef VEC_FN_IEQ #define VEC_FN_IEQ static inline union vec -vec_ieq (const union vec a, const union vec b) -{ - return (union vec) { - .xi = a.xi == b.xi ? -1 : 0, - .yi = a.yi == b.yi ? -1 : 0, - .zi = a.zi == b.zi ? -1 : 0, - .wi = a.wi == b.wi ? -1 : 0, - }; + vec_ieq(const union vec a, const union vec b) { + return (union vec) { + .xi = a.xi == b.xi ? -1 : 0, + .yi = a.yi == b.yi ? -1 : 0, + .zi = a.zi == b.zi ? -1 : 0, + .wi = a.wi == b.wi ? -1 : 0, + }; } #endif @@ -322,14 +297,13 @@ vec_ieq (const union vec a, const union vec b) #ifndef VEC_FN_UEQ #define VEC_FN_UEQ static inline union vec -vec_ueq (const union vec a, const union vec b) -{ - return (union vec) { - .xi = a.xu == b.xu ? -1 : 0, - .yi = a.yu == b.yu ? -1 : 0, - .zi = a.zu == b.zu ? -1 : 0, - .wi = a.wu == b.wu ? -1 : 0, - }; + vec_ueq(const union vec a, const union vec b) { + return (union vec) { + .xi = a.xu == b.xu ? -1 : 0, + .yi = a.yu == b.yu ? -1 : 0, + .zi = a.zu == b.zu ? -1 : 0, + .wi = a.wu == b.wu ? -1 : 0, + }; } #endif @@ -337,14 +311,13 @@ vec_ueq (const union vec a, const union vec b) #ifndef VEC_FN_LT #define VEC_FN_LT static inline union vec -vec_lt (const union vec a, const union vec b) -{ - return (union vec) { - .xi = a.x < b.x ? -1 : 0, - .yi = a.y < b.y ? -1 : 0, - .zi = a.z < b.z ? -1 : 0, - .wi = a.w < b.w ? -1 : 0, - }; + vec_lt(const union vec a, const union vec b) { + return (union vec) { + .xi = a.x < b.x ? -1 : 0, + .yi = a.y < b.y ? -1 : 0, + .zi = a.z < b.z ? -1 : 0, + .wi = a.w < b.w ? -1 : 0, + }; } #endif @@ -352,14 +325,13 @@ vec_lt (const union vec a, const union vec b) #ifndef VEC_FN_ILT #define VEC_FN_ILT static inline union vec -vec_ilt (const union vec a, const union vec b) -{ - return (union vec) { - .xi = a.xi < b.xi ? -1 : 0, - .yi = a.yi < b.yi ? -1 : 0, - .zi = a.zi < b.zi ? -1 : 0, - .wi = a.wi < b.wi ? -1 : 0, - }; + vec_ilt(const union vec a, const union vec b) { + return (union vec) { + .xi = a.xi < b.xi ? -1 : 0, + .yi = a.yi < b.yi ? -1 : 0, + .zi = a.zi < b.zi ? -1 : 0, + .wi = a.wi < b.wi ? -1 : 0, + }; } #endif @@ -367,14 +339,13 @@ vec_ilt (const union vec a, const union vec b) #ifndef VEC_FN_ULT #define VEC_FN_ULT static inline union vec -vec_ult (const union vec a, const union vec b) -{ - return (union vec) { - .xi = a.xu < b.xu ? -1 : 0, - .yi = a.yu < b.yu ? -1 : 0, - .zi = a.zu < b.zu ? -1 : 0, - .wi = a.wu < b.wu ? -1 : 0, - }; + vec_ult(const union vec a, const union vec b) { + return (union vec) { + .xi = a.xu < b.xu ? -1 : 0, + .yi = a.yu < b.yu ? -1 : 0, + .zi = a.zu < b.zu ? -1 : 0, + .wi = a.wu < b.wu ? -1 : 0, + }; } #endif @@ -382,14 +353,13 @@ vec_ult (const union vec a, const union vec b) #ifndef VEC_FN_LE #define VEC_FN_LE static inline union vec -vec_le (const union vec a, const union vec b) -{ - return (union vec) { - .xi = a.x <= b.x ? -1 : 0, - .yi = a.y <= b.y ? -1 : 0, - .zi = a.z <= b.z ? -1 : 0, - .wi = a.w <= b.w ? -1 : 0, - }; + vec_le(const union vec a, const union vec b) { + return (union vec) { + .xi = a.x <= b.x ? -1 : 0, + .yi = a.y <= b.y ? -1 : 0, + .zi = a.z <= b.z ? -1 : 0, + .wi = a.w <= b.w ? -1 : 0, + }; } #endif @@ -397,14 +367,13 @@ vec_le (const union vec a, const union vec b) #ifndef VEC_FN_ILE #define VEC_FN_ILE static inline union vec -vec_ile (const union vec a, const union vec b) -{ - return (union vec) { - .xi = a.xi <= b.xi ? -1 : 0, - .yi = a.yi <= b.yi ? -1 : 0, - .zi = a.zi <= b.zi ? -1 : 0, - .wi = a.wi <= b.wi ? -1 : 0, - }; + vec_ile(const union vec a, const union vec b) { + return (union vec) { + .xi = a.xi <= b.xi ? -1 : 0, + .yi = a.yi <= b.yi ? -1 : 0, + .zi = a.zi <= b.zi ? -1 : 0, + .wi = a.wi <= b.wi ? -1 : 0, + }; } #endif @@ -412,14 +381,13 @@ vec_ile (const union vec a, const union vec b) #ifndef VEC_FN_ULE #define VEC_FN_ULE static inline union vec -vec_ule (const union vec a, const union vec b) -{ - return (union vec) { - .xi = a.xu <= b.xu ? -1 : 0, - .yi = a.yu <= b.yu ? -1 : 0, - .zi = a.zu <= b.zu ? -1 : 0, - .wi = a.wu <= b.wu ? -1 : 0, - }; + vec_ule(const union vec a, const union vec b) { + return (union vec) { + .xi = a.xu <= b.xu ? -1 : 0, + .yi = a.yu <= b.yu ? -1 : 0, + .zi = a.zu <= b.zu ? -1 : 0, + .wi = a.wu <= b.wu ? -1 : 0, + }; } #endif @@ -427,14 +395,13 @@ vec_ule (const union vec a, const union vec b) #ifndef VEC_FN_GT #define VEC_FN_GT static inline union vec -vec_gt (const union vec a, const union vec b) -{ - return (union vec) { - .xi = a.x > b.x ? -1 : 0, - .yi = a.y > b.y ? -1 : 0, - .zi = a.z > b.z ? -1 : 0, - .wi = a.w > b.w ? -1 : 0, - }; + vec_gt(const union vec a, const union vec b) { + return (union vec) { + .xi = a.x > b.x ? -1 : 0, + .yi = a.y > b.y ? -1 : 0, + .zi = a.z > b.z ? -1 : 0, + .wi = a.w > b.w ? -1 : 0, + }; } #endif @@ -442,14 +409,13 @@ vec_gt (const union vec a, const union vec b) #ifndef VEC_FN_IGT #define VEC_FN_IGT static inline union vec -vec_igt (const union vec a, const union vec b) -{ - return (union vec) { - .xi = a.xi > b.xi ? -1 : 0, - .yi = a.yi > b.yi ? -1 : 0, - .zi = a.zi > b.zi ? -1 : 0, - .wi = a.wi > b.wi ? -1 : 0, - }; + vec_igt(const union vec a, const union vec b) { + return (union vec) { + .xi = a.xi > b.xi ? -1 : 0, + .yi = a.yi > b.yi ? -1 : 0, + .zi = a.zi > b.zi ? -1 : 0, + .wi = a.wi > b.wi ? -1 : 0, + }; } #endif @@ -457,14 +423,13 @@ vec_igt (const union vec a, const union vec b) #ifndef VEC_FN_UGT #define VEC_FN_UGT static inline union vec -vec_ugt (const union vec a, const union vec b) -{ - return (union vec) { - .xi = a.xu > b.xu ? -1 : 0, - .yi = a.yu > b.yu ? -1 : 0, - .zi = a.zu > b.zu ? -1 : 0, - .wi = a.wu > b.wu ? -1 : 0, - }; + vec_ugt(const union vec a, const union vec b) { + return (union vec) { + .xi = a.xu > b.xu ? -1 : 0, + .yi = a.yu > b.yu ? -1 : 0, + .zi = a.zu > b.zu ? -1 : 0, + .wi = a.wu > b.wu ? -1 : 0, + }; } #endif @@ -472,14 +437,13 @@ vec_ugt (const union vec a, const union vec b) #ifndef VEC_FN_GE #define VEC_FN_GE static inline union vec -vec_ge (const union vec a, const union vec b) -{ - return (union vec) { - .xi = a.x >= b.x ? -1 : 0, - .yi = a.y >= b.y ? -1 : 0, - .zi = a.z >= b.z ? -1 : 0, - .wi = a.w >= b.w ? -1 : 0, - }; + vec_ge(const union vec a, const union vec b) { + return (union vec) { + .xi = a.x >= b.x ? -1 : 0, + .yi = a.y >= b.y ? -1 : 0, + .zi = a.z >= b.z ? -1 : 0, + .wi = a.w >= b.w ? -1 : 0, + }; } #endif @@ -487,14 +451,13 @@ vec_ge (const union vec a, const union vec b) #ifndef VEC_FN_IGE #define VEC_FN_IGE static inline union vec -vec_ige (const union vec a, const union vec b) -{ - return (union vec) { - .xi = a.xi >= b.xi ? -1 : 0, - .yi = a.yi >= b.yi ? -1 : 0, - .zi = a.zi >= b.zi ? -1 : 0, - .wi = a.wi >= b.wi ? -1 : 0, - }; + vec_ige(const union vec a, const union vec b) { + return (union vec) { + .xi = a.xi >= b.xi ? -1 : 0, + .yi = a.yi >= b.yi ? -1 : 0, + .zi = a.zi >= b.zi ? -1 : 0, + .wi = a.wi >= b.wi ? -1 : 0, + }; } #endif @@ -502,14 +465,13 @@ vec_ige (const union vec a, const union vec b) #ifndef VEC_FN_UGE #define VEC_FN_UGE static inline union vec -vec_uge (const union vec a, const union vec b) -{ - return (union vec) { - .xi = a.xu >= b.xu ? -1 : 0, - .yi = a.yu >= b.yu ? -1 : 0, - .zi = a.zu >= b.zu ? -1 : 0, - .wi = a.wu >= b.wu ? -1 : 0, - }; + vec_uge(const union vec a, const union vec b) { + return (union vec) { + .xi = a.xu >= b.xu ? -1 : 0, + .yi = a.yu >= b.yu ? -1 : 0, + .zi = a.zu >= b.zu ? -1 : 0, + .wi = a.wu >= b.wu ? -1 : 0, + }; } #endif @@ -517,9 +479,8 @@ vec_uge (const union vec a, const union vec b) #ifndef VEC_FN_DOT #define VEC_FN_DOT static inline float -vec_dot (const union vec a, const union vec b) -{ - return a.x * b.x + a.y * b.y + a.z * b.z; +vec_dot(const union vec a, const union vec b) { + return a.x * b.x + a.y * b.y + a.z * b.z; } #endif @@ -527,13 +488,12 @@ vec_dot (const union vec a, const union vec b) #ifndef VEC_FN_CROSS #define VEC_FN_CROSS static inline union vec -vec_cross (const union vec a, const union vec b) -{ - return (union vec) { - .x = a.y * b.z - a.z * b.y, - .y = a.z * b.x - a.x * b.z, - .z = a.x * b.y - a.y * b.x, - .w = 0.0f, - }; + vec_cross(const union vec a, const union vec b) { + return (union vec) { + .x = a.y * b.z - a.z * b.y, + .y = a.z * b.x - a.x * b.z, + .z = a.x * b.y - a.y * b.x, + .w = 0.0f, + }; } #endif diff --git a/client/deps/vec/vec/private/neon_asm.h b/client/deps/vec/vec/private/neon_asm.h index 8dbb02c10..a4414bc42 100644 --- a/client/deps/vec/vec/private/neon_asm.h +++ b/client/deps/vec/vec/private/neon_asm.h @@ -2,34 +2,33 @@ #ifndef VEC_FN_DIV #define VEC_FN_DIV static inline union vec -vec_div (const union vec a, const union vec b) -{ + vec_div(const union vec a, const union vec b) { #ifdef __aarch64__ - float32x4_t ret; + float32x4_t ret; - __asm__ ( - "fdiv %0.4s,%1.4s,%2.4s \n\t" + __asm__( + "fdiv %0.4s,%1.4s,%2.4s \n\t" - : "=&w" (ret) // Outputs: ret=v0 - : "w" (a.neon.f), "w" (b.neon.f) // Inputs: a=v1, b=v2 - ); + : "=&w"(ret) // Outputs: ret=v0 + : "w"(a.neon.f), "w"(b.neon.f) // Inputs: a=v1, b=v2 + ); #else - float32x4_t ret, tmp; + float32x4_t ret, tmp; - __asm__ ( - "vrecpeq.f32 %q0,%q3 \n\t" - "vrecpsq.f32 %q1,%q3,%q0 \n\t" - "vmulq.f32 %q0,%q1,%q0 \n\t" - "vrecpsq.f32 %q1,%q3,%q0 \n\t" - "vmulq.f32 %q0,%q1,%q0 \n\t" - "vmulq.f32 %q0,%q2,%q0 \n\t" + __asm__( + "vrecpeq.f32 %q0,%q3 \n\t" + "vrecpsq.f32 %q1,%q3,%q0 \n\t" + "vmulq.f32 %q0,%q1,%q0 \n\t" + "vrecpsq.f32 %q1,%q3,%q0 \n\t" + "vmulq.f32 %q0,%q1,%q0 \n\t" + "vmulq.f32 %q0,%q2,%q0 \n\t" - : "=&w" (ret), "=&w" (tmp) // Outputs: ret=q0, tmp=q1 - : "w" (a.neon.f), "w" (b.neon.f) // Inputs: a=q2, b=q3 - ); + : "=&w"(ret), "=&w"(tmp) // Outputs: ret=q0, tmp=q1 + : "w"(a.neon.f), "w"(b.neon.f) // Inputs: a=q2, b=q3 + ); #endif - return (union vec) { .neon.f = ret }; + return (union vec) { .neon.f = ret }; } #endif @@ -37,54 +36,53 @@ vec_div (const union vec a, const union vec b) #ifndef VEC_FN_CROSS #define VEC_FN_CROSS static inline union vec -vec_cross (const union vec a, const union vec b) -{ - // Make read/write copies of the inputs: - float32x4_t atmp = a.neon.f, btmp = b.neon.f; + vec_cross(const union vec a, const union vec b) { + // Make read/write copies of the inputs: + float32x4_t atmp = a.neon.f, btmp = b.neon.f; #ifdef __aarch64__ - float32x4_t ret, t1, t2; + float32x4_t ret, t1, t2; - __asm__ ( - "zip1 %0.4s,%3.4s,%4.4s \n\t" // v0 := a0 b0 a1 b1 - "zip2 %1.4s,%3.4s,%4.4s \n\t" // v1 := a2 b2 a3 b3 - "trn1 %2.4s,%3.4s,%4.4s \n\t" // v2 := a0 b0 a2 b2 - "trn2 %3.4s,%3.4s,%4.4s \n\t" // v3 := a1 b1 a3 b3 - "ext %0.16b,%0.16b,%0.16b,#8 \n\t" // v0 := a1 b1 a0 b0 - "ext %2.16b,%2.16b,%2.16b,#8 \n\t" // v2 := a2 b2 a0 b0 - "trn2 %4.4s,%0.4s,%1.4s \n\t" // v4 := b1 b2 b0 b3 = byzxw - "trn1 %0.4s,%0.4s,%1.4s \n\t" // v0 := a1 a2 a0 a3 = ayzxw - "uzp1 %1.4s,%2.4s,%3.4s \n\t" // v1 := a2 a0 a1 a3 = azxyw - "uzp2 %2.4s,%2.4s,%3.4s \n\t" // v2 := b2 b0 b1 b3 = bzxyw + __asm__( + "zip1 %0.4s,%3.4s,%4.4s \n\t" // v0 := a0 b0 a1 b1 + "zip2 %1.4s,%3.4s,%4.4s \n\t" // v1 := a2 b2 a3 b3 + "trn1 %2.4s,%3.4s,%4.4s \n\t" // v2 := a0 b0 a2 b2 + "trn2 %3.4s,%3.4s,%4.4s \n\t" // v3 := a1 b1 a3 b3 + "ext %0.16b,%0.16b,%0.16b,#8 \n\t" // v0 := a1 b1 a0 b0 + "ext %2.16b,%2.16b,%2.16b,#8 \n\t" // v2 := a2 b2 a0 b0 + "trn2 %4.4s,%0.4s,%1.4s \n\t" // v4 := b1 b2 b0 b3 = byzxw + "trn1 %0.4s,%0.4s,%1.4s \n\t" // v0 := a1 a2 a0 a3 = ayzxw + "uzp1 %1.4s,%2.4s,%3.4s \n\t" // v1 := a2 a0 a1 a3 = azxyw + "uzp2 %2.4s,%2.4s,%3.4s \n\t" // v2 := b2 b0 b1 b3 = bzxyw - "fmul %0.4s,%0.4s,%2.4s \n\t" // v0 := ayzxw * bzxyw - "fmls %0.4s,%1.4s,%4.4s \n\t" // v0 := ayzxw * bzxyw - azxyw * byzxw + "fmul %0.4s,%0.4s,%2.4s \n\t" // v0 := ayzxw * bzxyw + "fmls %0.4s,%1.4s,%4.4s \n\t" // v0 := ayzxw * bzxyw - azxyw * byzxw - : "=&w" (ret), "=&w" (t1), "=&w" (t2), // Outputs: ret=v0, t1=v1, t2=v2 - "+w" (atmp), "+w" (btmp) // Outputs (reused inputs): a=v3, b=v4 - ); + : "=&w"(ret), "=&w"(t1), "=&w"(t2), // Outputs: ret=v0, t1=v1, t2=v2 + "+w"(atmp), "+w"(btmp) // Outputs (reused inputs): a=v3, b=v4 + ); #else - float32x4_t ret, tmp; + float32x4_t ret, tmp; - __asm__ ( - "vext.8 %q0,%q2,%q2,#4 \n\t" // q0 := ayzwx - "vext.8 %q1,%q3,%q3,#4 \n\t" // q1 := byzwx - "vrev64.32 %f0,%f0 \n\t" // q0 := ayzxw - "vrev64.32 %f1,%f1 \n\t" // q1 := byzxw + __asm__( + "vext.8 %q0,%q2,%q2,#4 \n\t" // q0 := ayzwx + "vext.8 %q1,%q3,%q3,#4 \n\t" // q1 := byzwx + "vrev64.32 %f0,%f0 \n\t" // q0 := ayzxw + "vrev64.32 %f1,%f1 \n\t" // q1 := byzxw - "vtrn.32 %e2,%f2 \n\t" // q2 := axzyw - "vtrn.32 %e3,%f3 \n\t" // q3 := bxzyw - "vrev64.32 %e2,%e2 \n\t" // q2 := azxyw - "vrev64.32 %e3,%e3 \n\t" // q3 := bzxyw + "vtrn.32 %e2,%f2 \n\t" // q2 := axzyw + "vtrn.32 %e3,%f3 \n\t" // q3 := bxzyw + "vrev64.32 %e2,%e2 \n\t" // q2 := azxyw + "vrev64.32 %e3,%e3 \n\t" // q3 := bzxyw - "vmulq.f32 %q0,%q0,%q3 \n\t" // q0 := ayzxw * bzxyw - "vmlsq.f32 %q0,%q2,%q1 \n\t" // q0 := ayzxw * bzxyw - azxyw * byzxw + "vmulq.f32 %q0,%q0,%q3 \n\t" // q0 := ayzxw * bzxyw + "vmlsq.f32 %q0,%q2,%q1 \n\t" // q0 := ayzxw * bzxyw - azxyw * byzxw - : "=&w" (ret), "=&w" (tmp), // Outputs: ret=q0, tmp=q1 - "+w" (atmp), "+w" (btmp) // Outputs (reused inputs): a=q2, b=q3 - ); + : "=&w"(ret), "=&w"(tmp), // Outputs: ret=q0, tmp=q1 + "+w"(atmp), "+w"(btmp) // Outputs (reused inputs): a=q2, b=q3 + ); #endif - return (union vec) { .neon.f = ret }; + return (union vec) { .neon.f = ret }; } #endif diff --git a/client/deps/vec/vec/private/neon_intrin.h b/client/deps/vec/vec/private/neon_intrin.h index 6b07054a2..607c90042 100644 --- a/client/deps/vec/vec/private/neon_intrin.h +++ b/client/deps/vec/vec/private/neon_intrin.h @@ -2,15 +2,14 @@ #ifndef VEC_FN_ #define VEC_FN_ static inline union vec -vec (const float x, const float y, const float z, const float w) -{ - union { - float i[2]; - uint64_t u; - } lo = { { x, y } } - , hi = { { z, w } }; + vec(const float x, const float y, const float z, const float w) { + union { + float i[2]; + uint64_t u; + } lo = { { x, y } } + , hi = { { z, w } }; - return (union vec) { .neon.f = vcombine_f32(vcreate_f32(lo.u), vcreate_f32(hi.u)) }; + return (union vec) { .neon.f = vcombine_f32(vcreate_f32(lo.u), vcreate_f32(hi.u)) }; } #endif @@ -18,15 +17,14 @@ vec (const float x, const float y, const float z, const float w) #ifndef VEC_FN_I #define VEC_FN_I static inline union vec -vec_i (const int32_t x, const int32_t y, const int32_t z, const int32_t w) -{ - union { - int32_t i[2]; - uint64_t u; - } lo = { { x, y } } - , hi = { { z, w } }; + vec_i(const int32_t x, const int32_t y, const int32_t z, const int32_t w) { + union { + int32_t i[2]; + uint64_t u; + } lo = { { x, y } } + , hi = { { z, w } }; - return (union vec) { .neon.i = vcombine_s32(vcreate_s32(lo.u), vcreate_s32(hi.u)) }; + return (union vec) { .neon.i = vcombine_s32(vcreate_s32(lo.u), vcreate_s32(hi.u)) }; } #endif @@ -34,15 +32,14 @@ vec_i (const int32_t x, const int32_t y, const int32_t z, const int32_t w) #ifndef VEC_FN_U #define VEC_FN_U static inline union vec -vec_u (const uint32_t x, const uint32_t y, const uint32_t z, const uint32_t w) -{ - union { - uint32_t i[2]; - uint64_t u; - } lo = { { x, y } } - , hi = { { z, w } }; + vec_u(const uint32_t x, const uint32_t y, const uint32_t z, const uint32_t w) { + union { + uint32_t i[2]; + uint64_t u; + } lo = { { x, y } } + , hi = { { z, w } }; - return (union vec) { .neon.u = vcombine_u32(vcreate_u32(lo.u), vcreate_u32(hi.u)) }; + return (union vec) { .neon.u = vcombine_u32(vcreate_u32(lo.u), vcreate_u32(hi.u)) }; } #endif @@ -50,9 +47,8 @@ vec_u (const uint32_t x, const uint32_t y, const uint32_t z, const uint32_t w) #ifndef VEC_FN_1 #define VEC_FN_1 static inline union vec -vec_1 (const float val) -{ - return (union vec) { .neon.f = vdupq_n_f32(val) }; + vec_1(const float val) { + return (union vec) { .neon.f = vdupq_n_f32(val) }; } #endif @@ -60,9 +56,8 @@ vec_1 (const float val) #ifndef VEC_FN_I1 #define VEC_FN_I1 static inline union vec -vec_i1 (const int32_t val) -{ - return (union vec) { .neon.i = vdupq_n_s32(val) }; + vec_i1(const int32_t val) { + return (union vec) { .neon.i = vdupq_n_s32(val) }; } #endif @@ -70,9 +65,8 @@ vec_i1 (const int32_t val) #ifndef VEC_FN_U1 #define VEC_FN_U1 static inline union vec -vec_u1 (const uint32_t val) -{ - return (union vec) { .neon.u = vdupq_n_u32(val) }; + vec_u1(const uint32_t val) { + return (union vec) { .neon.u = vdupq_n_u32(val) }; } #endif @@ -80,9 +74,8 @@ vec_u1 (const uint32_t val) #ifndef VEC_FN_ZERO #define VEC_FN_ZERO static inline union vec -vec_zero (void) -{ - return vec_1(0.0f); + vec_zero(void) { + return vec_1(0.0f); } #endif @@ -90,9 +83,8 @@ vec_zero (void) #ifndef VEC_FN_IZERO #define VEC_FN_IZERO static inline union vec -vec_izero (void) -{ - return vec_i1(0); + vec_izero(void) { + return vec_i1(0); } #endif @@ -100,9 +92,8 @@ vec_izero (void) #ifndef VEC_FN_UZERO #define VEC_FN_UZERO static inline union vec -vec_uzero (void) -{ - return vec_u1(0U); + vec_uzero(void) { + return vec_u1(0U); } #endif @@ -110,9 +101,8 @@ vec_uzero (void) #ifndef VEC_FN_TO_INT #define VEC_FN_TO_INT static inline union vec -vec_to_int (const union vec v) -{ - return (union vec) { .neon.i = vcvtq_s32_f32(v.neon.f) }; + vec_to_int(const union vec v) { + return (union vec) { .neon.i = vcvtq_s32_f32(v.neon.f) }; } #endif @@ -120,9 +110,8 @@ vec_to_int (const union vec v) #ifndef VEC_FN_TO_FLOAT #define VEC_FN_TO_FLOAT static inline union vec -vec_to_float (const union vec v) -{ - return (union vec) { .neon.f = vcvtq_f32_s32(v.neon.i) }; + vec_to_float(const union vec v) { + return (union vec) { .neon.f = vcvtq_f32_s32(v.neon.i) }; } #endif @@ -130,9 +119,8 @@ vec_to_float (const union vec v) #ifndef VEC_FN_ADD #define VEC_FN_ADD static inline union vec -vec_add (const union vec a, const union vec b) -{ - return (union vec) { .neon.f = vaddq_f32(a.neon.f, b.neon.f) }; + vec_add(const union vec a, const union vec b) { + return (union vec) { .neon.f = vaddq_f32(a.neon.f, b.neon.f) }; } #endif @@ -140,9 +128,8 @@ vec_add (const union vec a, const union vec b) #ifndef VEC_FN_IADD #define VEC_FN_IADD static inline union vec -vec_iadd (const union vec a, const union vec b) -{ - return (union vec) { .neon.i = vaddq_s32(a.neon.i, b.neon.i) }; + vec_iadd(const union vec a, const union vec b) { + return (union vec) { .neon.i = vaddq_s32(a.neon.i, b.neon.i) }; } #endif @@ -150,9 +137,8 @@ vec_iadd (const union vec a, const union vec b) #ifndef VEC_FN_UADD #define VEC_FN_UADD static inline union vec -vec_uadd (const union vec a, const union vec b) -{ - return (union vec) { .neon.u = vaddq_u32(a.neon.u, b.neon.u) }; + vec_uadd(const union vec a, const union vec b) { + return (union vec) { .neon.u = vaddq_u32(a.neon.u, b.neon.u) }; } #endif @@ -160,9 +146,8 @@ vec_uadd (const union vec a, const union vec b) #ifndef VEC_FN_SUB #define VEC_FN_SUB static inline union vec -vec_sub (const union vec a, const union vec b) -{ - return (union vec) { .neon.f = vsubq_f32(a.neon.f, b.neon.f) }; + vec_sub(const union vec a, const union vec b) { + return (union vec) { .neon.f = vsubq_f32(a.neon.f, b.neon.f) }; } #endif @@ -170,9 +155,8 @@ vec_sub (const union vec a, const union vec b) #ifndef VEC_FN_ISUB #define VEC_FN_ISUB static inline union vec -vec_isub (const union vec a, const union vec b) -{ - return (union vec) { .neon.i = vsubq_s32(a.neon.i, b.neon.i) }; + vec_isub(const union vec a, const union vec b) { + return (union vec) { .neon.i = vsubq_s32(a.neon.i, b.neon.i) }; } #endif @@ -180,9 +164,8 @@ vec_isub (const union vec a, const union vec b) #ifndef VEC_FN_USUB #define VEC_FN_USUB static inline union vec -vec_usub (const union vec a, const union vec b) -{ - return (union vec) { .neon.u = vsubq_u32(a.neon.u, b.neon.u) }; + vec_usub(const union vec a, const union vec b) { + return (union vec) { .neon.u = vsubq_u32(a.neon.u, b.neon.u) }; } #endif @@ -190,9 +173,8 @@ vec_usub (const union vec a, const union vec b) #ifndef VEC_FN_MUL #define VEC_FN_MUL static inline union vec -vec_mul (const union vec a, const union vec b) -{ - return (union vec) { .neon.f = vmulq_f32(a.neon.f, b.neon.f) }; + vec_mul(const union vec a, const union vec b) { + return (union vec) { .neon.f = vmulq_f32(a.neon.f, b.neon.f) }; } #endif @@ -200,17 +182,16 @@ vec_mul (const union vec a, const union vec b) #ifndef VEC_FN_DIV #define VEC_FN_DIV static inline union vec -vec_div (const union vec a, const union vec b) -{ - // Estimate reciprocal of b: - float32x4_t recp = vrecpeq_f32(b.neon.f); + vec_div(const union vec a, const union vec b) { + // Estimate reciprocal of b: + float32x4_t recp = vrecpeq_f32(b.neon.f); - // Refine the estimate using Newton-Raphson: - recp = vmulq_f32(vrecpsq_f32(b.neon.f, recp), recp); - recp = vmulq_f32(vrecpsq_f32(b.neon.f, recp), recp); + // Refine the estimate using Newton-Raphson: + recp = vmulq_f32(vrecpsq_f32(b.neon.f, recp), recp); + recp = vmulq_f32(vrecpsq_f32(b.neon.f, recp), recp); - // Multiply by the reciprocal to approximate a / b: - return (union vec) { .neon.f = vmulq_f32(a.neon.f, recp) }; + // Multiply by the reciprocal to approximate a / b: + return (union vec) { .neon.f = vmulq_f32(a.neon.f, recp) }; } #endif @@ -218,9 +199,8 @@ vec_div (const union vec a, const union vec b) #ifndef VEC_FN_AND #define VEC_FN_AND static inline union vec -vec_and (const union vec a, const union vec b) -{ - return (union vec) { .neon.u = vandq_u32(a.neon.u, b.neon.u) }; + vec_and(const union vec a, const union vec b) { + return (union vec) { .neon.u = vandq_u32(a.neon.u, b.neon.u) }; } #endif @@ -228,9 +208,8 @@ vec_and (const union vec a, const union vec b) #ifndef VEC_FN_OR #define VEC_FN_OR static inline union vec -vec_or (const union vec a, const union vec b) -{ - return (union vec) { .neon.u = vorrq_u32(a.neon.u, b.neon.u) }; + vec_or(const union vec a, const union vec b) { + return (union vec) { .neon.u = vorrq_u32(a.neon.u, b.neon.u) }; } #endif @@ -238,9 +217,8 @@ vec_or (const union vec a, const union vec b) #ifndef VEC_FN_XOR #define VEC_FN_XOR static inline union vec -vec_xor (const union vec a, const union vec b) -{ - return (union vec) { .neon.u = veorq_u32(a.neon.u, b.neon.u) }; + vec_xor(const union vec a, const union vec b) { + return (union vec) { .neon.u = veorq_u32(a.neon.u, b.neon.u) }; } #endif @@ -248,9 +226,8 @@ vec_xor (const union vec a, const union vec b) #ifndef VEC_FN_NOT #define VEC_FN_NOT static inline union vec -vec_not (const union vec v) -{ - return (union vec) { .neon.u = vmvnq_u32(v.neon.u) }; + vec_not(const union vec v) { + return (union vec) { .neon.u = vmvnq_u32(v.neon.u) }; } #endif @@ -258,9 +235,8 @@ vec_not (const union vec v) #ifndef VEC_FN_EQ #define VEC_FN_EQ static inline union vec -vec_eq (const union vec a, const union vec b) -{ - return (union vec) { .neon.u = vceqq_f32(a.neon.f, b.neon.f) }; + vec_eq(const union vec a, const union vec b) { + return (union vec) { .neon.u = vceqq_f32(a.neon.f, b.neon.f) }; } #endif @@ -268,9 +244,8 @@ vec_eq (const union vec a, const union vec b) #ifndef VEC_FN_IEQ #define VEC_FN_IEQ static inline union vec -vec_ieq (const union vec a, const union vec b) -{ - return (union vec) { .neon.u = vceqq_s32(a.neon.i, b.neon.i) }; + vec_ieq(const union vec a, const union vec b) { + return (union vec) { .neon.u = vceqq_s32(a.neon.i, b.neon.i) }; } #endif @@ -278,9 +253,8 @@ vec_ieq (const union vec a, const union vec b) #ifndef VEC_FN_UEQ #define VEC_FN_UEQ static inline union vec -vec_ueq (const union vec a, const union vec b) -{ - return (union vec) { .neon.u = vceqq_u32(a.neon.u, b.neon.u) }; + vec_ueq(const union vec a, const union vec b) { + return (union vec) { .neon.u = vceqq_u32(a.neon.u, b.neon.u) }; } #endif @@ -288,9 +262,8 @@ vec_ueq (const union vec a, const union vec b) #ifndef VEC_FN_LT #define VEC_FN_LT static inline union vec -vec_lt (const union vec a, const union vec b) -{ - return (union vec) { .neon.u = vcltq_f32(a.neon.f, b.neon.f) }; + vec_lt(const union vec a, const union vec b) { + return (union vec) { .neon.u = vcltq_f32(a.neon.f, b.neon.f) }; } #endif @@ -298,9 +271,8 @@ vec_lt (const union vec a, const union vec b) #ifndef VEC_FN_ILT #define VEC_FN_ILT static inline union vec -vec_ilt (const union vec a, const union vec b) -{ - return (union vec) { .neon.u = vcltq_s32(a.neon.i, b.neon.i) }; + vec_ilt(const union vec a, const union vec b) { + return (union vec) { .neon.u = vcltq_s32(a.neon.i, b.neon.i) }; } #endif @@ -308,9 +280,8 @@ vec_ilt (const union vec a, const union vec b) #ifndef VEC_FN_ULT #define VEC_FN_ULT static inline union vec -vec_ult (const union vec a, const union vec b) -{ - return (union vec) { .neon.u = vcltq_u32(a.neon.u, b.neon.u) }; + vec_ult(const union vec a, const union vec b) { + return (union vec) { .neon.u = vcltq_u32(a.neon.u, b.neon.u) }; } #endif @@ -318,9 +289,8 @@ vec_ult (const union vec a, const union vec b) #ifndef VEC_FN_LE #define VEC_FN_LE static inline union vec -vec_le (const union vec a, const union vec b) -{ - return (union vec) { .neon.u = vcleq_f32(a.neon.f, b.neon.f) }; + vec_le(const union vec a, const union vec b) { + return (union vec) { .neon.u = vcleq_f32(a.neon.f, b.neon.f) }; } #endif @@ -328,9 +298,8 @@ vec_le (const union vec a, const union vec b) #ifndef VEC_FN_ILE #define VEC_FN_ILE static inline union vec -vec_ile (const union vec a, const union vec b) -{ - return (union vec) { .neon.u = vcleq_s32(a.neon.i, b.neon.i) }; + vec_ile(const union vec a, const union vec b) { + return (union vec) { .neon.u = vcleq_s32(a.neon.i, b.neon.i) }; } #endif @@ -338,9 +307,8 @@ vec_ile (const union vec a, const union vec b) #ifndef VEC_FN_ULE #define VEC_FN_ULE static inline union vec -vec_ule (const union vec a, const union vec b) -{ - return (union vec) { .neon.u = vcleq_u32(a.neon.u, b.neon.u) }; + vec_ule(const union vec a, const union vec b) { + return (union vec) { .neon.u = vcleq_u32(a.neon.u, b.neon.u) }; } #endif @@ -348,9 +316,8 @@ vec_ule (const union vec a, const union vec b) #ifndef VEC_FN_GT #define VEC_FN_GT static inline union vec -vec_gt (const union vec a, const union vec b) -{ - return (union vec) { .neon.u = vcgtq_f32(a.neon.f, b.neon.f) }; + vec_gt(const union vec a, const union vec b) { + return (union vec) { .neon.u = vcgtq_f32(a.neon.f, b.neon.f) }; } #endif @@ -358,9 +325,8 @@ vec_gt (const union vec a, const union vec b) #ifndef VEC_FN_IGT #define VEC_FN_IGT static inline union vec -vec_igt (const union vec a, const union vec b) -{ - return (union vec) { .neon.u = vcgtq_s32(a.neon.i, b.neon.i) }; + vec_igt(const union vec a, const union vec b) { + return (union vec) { .neon.u = vcgtq_s32(a.neon.i, b.neon.i) }; } #endif @@ -368,9 +334,8 @@ vec_igt (const union vec a, const union vec b) #ifndef VEC_FN_UGT #define VEC_FN_UGT static inline union vec -vec_ugt (const union vec a, const union vec b) -{ - return (union vec) { .neon.u = vcgtq_u32(a.neon.u, b.neon.u) }; + vec_ugt(const union vec a, const union vec b) { + return (union vec) { .neon.u = vcgtq_u32(a.neon.u, b.neon.u) }; } #endif @@ -378,9 +343,8 @@ vec_ugt (const union vec a, const union vec b) #ifndef VEC_FN_GE #define VEC_FN_GE static inline union vec -vec_ge (const union vec a, const union vec b) -{ - return (union vec) { .neon.u = vcgeq_f32(a.neon.f, b.neon.f) }; + vec_ge(const union vec a, const union vec b) { + return (union vec) { .neon.u = vcgeq_f32(a.neon.f, b.neon.f) }; } #endif @@ -388,9 +352,8 @@ vec_ge (const union vec a, const union vec b) #ifndef VEC_FN_IGE #define VEC_FN_IGE static inline union vec -vec_ige (const union vec a, const union vec b) -{ - return (union vec) { .neon.u = vcgeq_s32(a.neon.i, b.neon.i) }; + vec_ige(const union vec a, const union vec b) { + return (union vec) { .neon.u = vcgeq_s32(a.neon.i, b.neon.i) }; } #endif @@ -398,9 +361,8 @@ vec_ige (const union vec a, const union vec b) #ifndef VEC_FN_UGE #define VEC_FN_UGE static inline union vec -vec_uge (const union vec a, const union vec b) -{ - return (union vec) { .neon.u = vcgeq_u32(a.neon.u, b.neon.u) }; + vec_uge(const union vec a, const union vec b) { + return (union vec) { .neon.u = vcgeq_u32(a.neon.u, b.neon.u) }; } #endif @@ -408,12 +370,11 @@ vec_uge (const union vec a, const union vec b) #ifndef VEC_FN_DOT #define VEC_FN_DOT static inline float -vec_dot (const union vec a, const union vec b) -{ - const float32x4_t mul = vmulq_f32(a.neon.f, b.neon.f); - return vgetq_lane_f32(mul, 0) - + vgetq_lane_f32(mul, 1) - + vgetq_lane_f32(mul, 2); +vec_dot(const union vec a, const union vec b) { + const float32x4_t mul = vmulq_f32(a.neon.f, b.neon.f); + return vgetq_lane_f32(mul, 0) + + vgetq_lane_f32(mul, 1) + + vgetq_lane_f32(mul, 2); } #endif @@ -421,20 +382,19 @@ vec_dot (const union vec a, const union vec b) #ifndef VEC_FN_CROSS #define VEC_FN_CROSS static inline union vec -vec_cross (const union vec a, const union vec b) -{ - const float32x4_t ayzwx = (float32x4_t) vextq_u32((uint32x4_t) a.neon.f, (uint32x4_t) a.neon.f, 1); - const float32x4_t byzwx = (float32x4_t) vextq_u32((uint32x4_t) b.neon.f, (uint32x4_t) b.neon.f, 1); + vec_cross(const union vec a, const union vec b) { + const float32x4_t ayzwx = (float32x4_t) vextq_u32((uint32x4_t) a.neon.f, (uint32x4_t) a.neon.f, 1); + const float32x4_t byzwx = (float32x4_t) vextq_u32((uint32x4_t) b.neon.f, (uint32x4_t) b.neon.f, 1); - const float32x4_t ayzxw = vcombine_f32(vget_low_f32(ayzwx), vrev64_f32(vget_high_f32(ayzwx))); - const float32x4_t byzxw = vcombine_f32(vget_low_f32(byzwx), vrev64_f32(vget_high_f32(byzwx))); + const float32x4_t ayzxw = vcombine_f32(vget_low_f32(ayzwx), vrev64_f32(vget_high_f32(ayzwx))); + const float32x4_t byzxw = vcombine_f32(vget_low_f32(byzwx), vrev64_f32(vget_high_f32(byzwx))); - const float32x2x2_t azxwy_pair = vtrn_f32(vget_high_f32(a.neon.f), vget_low_f32(a.neon.f)); - const float32x2x2_t bzxwy_pair = vtrn_f32(vget_high_f32(b.neon.f), vget_low_f32(b.neon.f)); + const float32x2x2_t azxwy_pair = vtrn_f32(vget_high_f32(a.neon.f), vget_low_f32(a.neon.f)); + const float32x2x2_t bzxwy_pair = vtrn_f32(vget_high_f32(b.neon.f), vget_low_f32(b.neon.f)); - const float32x4_t azxyw = vcombine_f32(azxwy_pair.val[0], vrev64_f32(azxwy_pair.val[1])); - const float32x4_t bzxyw = vcombine_f32(bzxwy_pair.val[0], vrev64_f32(bzxwy_pair.val[1])); + const float32x4_t azxyw = vcombine_f32(azxwy_pair.val[0], vrev64_f32(azxwy_pair.val[1])); + const float32x4_t bzxyw = vcombine_f32(bzxwy_pair.val[0], vrev64_f32(bzxwy_pair.val[1])); - return (union vec) { .neon.f = vmlsq_f32(vmulq_f32(ayzxw, bzxyw), byzxw, azxyw) }; + return (union vec) { .neon.f = vmlsq_f32(vmulq_f32(ayzxw, bzxyw), byzxw, azxyw) }; } #endif diff --git a/client/deps/vec/vec/private/sse2.h b/client/deps/vec/vec/private/sse2.h index c3814875f..50bb04813 100644 --- a/client/deps/vec/vec/private/sse2.h +++ b/client/deps/vec/vec/private/sse2.h @@ -2,9 +2,8 @@ #ifndef VEC_FN_ #define VEC_FN_ static inline union vec -vec (const float x, const float y, const float z, const float w) -{ - return (union vec) { .sse.f = _mm_setr_ps(x, y, z, w) }; + vec(const float x, const float y, const float z, const float w) { + return (union vec) { .sse.f = _mm_setr_ps(x, y, z, w) }; } #endif @@ -12,9 +11,8 @@ vec (const float x, const float y, const float z, const float w) #ifndef VEC_FN_I #define VEC_FN_I static inline union vec -vec_i (const int32_t x, const int32_t y, const int32_t z, const int32_t w) -{ - return (union vec) { .sse.i = _mm_setr_epi32(x, y, z, w) }; + vec_i(const int32_t x, const int32_t y, const int32_t z, const int32_t w) { + return (union vec) { .sse.i = _mm_setr_epi32(x, y, z, w) }; } #endif @@ -22,9 +20,8 @@ vec_i (const int32_t x, const int32_t y, const int32_t z, const int32_t w) #ifndef VEC_FN_U #define VEC_FN_U static inline union vec -vec_u (const uint32_t x, const uint32_t y, const uint32_t z, const uint32_t w) -{ - return vec_i((int32_t) x, (int32_t) y, (int32_t) z, (int32_t) w); + vec_u(const uint32_t x, const uint32_t y, const uint32_t z, const uint32_t w) { + return vec_i((int32_t) x, (int32_t) y, (int32_t) z, (int32_t) w); } #endif @@ -32,9 +29,8 @@ vec_u (const uint32_t x, const uint32_t y, const uint32_t z, const uint32_t w) #ifndef VEC_FN_1 #define VEC_FN_1 static inline union vec -vec_1 (const float val) -{ - return (union vec) { .sse.f = _mm_set1_ps(val) }; + vec_1(const float val) { + return (union vec) { .sse.f = _mm_set1_ps(val) }; } #endif @@ -42,9 +38,8 @@ vec_1 (const float val) #ifndef VEC_FN_I1 #define VEC_FN_I1 static inline union vec -vec_i1 (const int32_t val) -{ - return (union vec) { .sse.i = _mm_set1_epi32(val) }; + vec_i1(const int32_t val) { + return (union vec) { .sse.i = _mm_set1_epi32(val) }; } #endif @@ -52,9 +47,8 @@ vec_i1 (const int32_t val) #ifndef VEC_FN_U1 #define VEC_FN_U1 static inline union vec -vec_u1 (const uint32_t val) -{ - return vec_i1((int32_t) val); + vec_u1(const uint32_t val) { + return vec_i1((int32_t) val); } #endif @@ -62,9 +56,8 @@ vec_u1 (const uint32_t val) #ifndef VEC_FN_ZERO #define VEC_FN_ZERO static inline union vec -vec_zero (void) -{ - return (union vec) { .sse.f = _mm_setzero_ps() }; + vec_zero(void) { + return (union vec) { .sse.f = _mm_setzero_ps() }; } #endif @@ -72,9 +65,8 @@ vec_zero (void) #ifndef VEC_FN_IZERO #define VEC_FN_IZERO static inline union vec -vec_izero (void) -{ - return (union vec) { .sse.i = _mm_setzero_si128() }; + vec_izero(void) { + return (union vec) { .sse.i = _mm_setzero_si128() }; } #endif @@ -82,9 +74,8 @@ vec_izero (void) #ifndef VEC_FN_UZERO #define VEC_FN_UZERO static inline union vec -vec_uzero (void) -{ - return vec_izero(); + vec_uzero(void) { + return vec_izero(); } #endif @@ -92,9 +83,8 @@ vec_uzero (void) #ifndef VEC_FN_TO_INT #define VEC_FN_TO_INT static inline union vec -vec_to_int (const union vec v) -{ - return (union vec) { .sse.i = _mm_cvttps_epi32(v.sse.f) }; + vec_to_int(const union vec v) { + return (union vec) { .sse.i = _mm_cvttps_epi32(v.sse.f) }; } #endif @@ -102,9 +92,8 @@ vec_to_int (const union vec v) #ifndef VEC_FN_TO_FLOAT #define VEC_FN_TO_FLOAT static inline union vec -vec_to_float (const union vec v) -{ - return (union vec) { .sse.f = _mm_cvtepi32_ps(v.sse.i) }; + vec_to_float(const union vec v) { + return (union vec) { .sse.f = _mm_cvtepi32_ps(v.sse.i) }; } #endif @@ -112,9 +101,8 @@ vec_to_float (const union vec v) #ifndef VEC_FN_ADD #define VEC_FN_ADD static inline union vec -vec_add (const union vec a, const union vec b) -{ - return (union vec) { .sse.f = _mm_add_ps(a.sse.f, b.sse.f) }; + vec_add(const union vec a, const union vec b) { + return (union vec) { .sse.f = _mm_add_ps(a.sse.f, b.sse.f) }; } #endif @@ -122,9 +110,8 @@ vec_add (const union vec a, const union vec b) #ifndef VEC_FN_IADD #define VEC_FN_IADD static inline union vec -vec_iadd (const union vec a, const union vec b) -{ - return (union vec) { .sse.i = _mm_add_epi32(a.sse.i, b.sse.i) }; + vec_iadd(const union vec a, const union vec b) { + return (union vec) { .sse.i = _mm_add_epi32(a.sse.i, b.sse.i) }; } #endif @@ -132,9 +119,8 @@ vec_iadd (const union vec a, const union vec b) #ifndef VEC_FN_UADD #define VEC_FN_UADD static inline union vec -vec_uadd (const union vec a, const union vec b) -{ - return vec_iadd(a, b); + vec_uadd(const union vec a, const union vec b) { + return vec_iadd(a, b); } #endif @@ -142,9 +128,8 @@ vec_uadd (const union vec a, const union vec b) #ifndef VEC_FN_SUB #define VEC_FN_SUB static inline union vec -vec_sub (const union vec a, const union vec b) -{ - return (union vec) { .sse.f = _mm_sub_ps(a.sse.f, b.sse.f) }; + vec_sub(const union vec a, const union vec b) { + return (union vec) { .sse.f = _mm_sub_ps(a.sse.f, b.sse.f) }; } #endif @@ -152,9 +137,8 @@ vec_sub (const union vec a, const union vec b) #ifndef VEC_FN_ISUB #define VEC_FN_ISUB static inline union vec -vec_isub (const union vec a, const union vec b) -{ - return (union vec) { .sse.i = _mm_sub_epi32(a.sse.i, b.sse.i) }; + vec_isub(const union vec a, const union vec b) { + return (union vec) { .sse.i = _mm_sub_epi32(a.sse.i, b.sse.i) }; } #endif @@ -162,9 +146,8 @@ vec_isub (const union vec a, const union vec b) #ifndef VEC_FN_USUB #define VEC_FN_USUB static inline union vec -vec_usub (const union vec a, const union vec b) -{ - return vec_isub(a, b); + vec_usub(const union vec a, const union vec b) { + return vec_isub(a, b); } #endif @@ -172,9 +155,8 @@ vec_usub (const union vec a, const union vec b) #ifndef VEC_FN_MUL #define VEC_FN_MUL static inline union vec -vec_mul (const union vec a, const union vec b) -{ - return (union vec) { .sse.f = _mm_mul_ps(a.sse.f, b.sse.f) }; + vec_mul(const union vec a, const union vec b) { + return (union vec) { .sse.f = _mm_mul_ps(a.sse.f, b.sse.f) }; } #endif @@ -182,9 +164,8 @@ vec_mul (const union vec a, const union vec b) #ifndef VEC_FN_DIV #define VEC_FN_DIV static inline union vec -vec_div (const union vec a, const union vec b) -{ - return (union vec) { .sse.f = _mm_div_ps(a.sse.f, b.sse.f) }; + vec_div(const union vec a, const union vec b) { + return (union vec) { .sse.f = _mm_div_ps(a.sse.f, b.sse.f) }; } #endif @@ -192,9 +173,8 @@ vec_div (const union vec a, const union vec b) #ifndef VEC_FN_AND #define VEC_FN_AND static inline union vec -vec_and (const union vec a, const union vec b) -{ - return (union vec) { .sse.u = _mm_and_si128(a.sse.u, b.sse.u) }; + vec_and(const union vec a, const union vec b) { + return (union vec) { .sse.u = _mm_and_si128(a.sse.u, b.sse.u) }; } #endif @@ -202,9 +182,8 @@ vec_and (const union vec a, const union vec b) #ifndef VEC_FN_OR #define VEC_FN_OR static inline union vec -vec_or (const union vec a, const union vec b) -{ - return (union vec) { .sse.u = _mm_or_si128(a.sse.u, b.sse.u) }; + vec_or(const union vec a, const union vec b) { + return (union vec) { .sse.u = _mm_or_si128(a.sse.u, b.sse.u) }; } #endif @@ -212,9 +191,8 @@ vec_or (const union vec a, const union vec b) #ifndef VEC_FN_XOR #define VEC_FN_XOR static inline union vec -vec_xor (const union vec a, const union vec b) -{ - return (union vec) { .sse.u = _mm_xor_si128(a.sse.u, b.sse.u) }; + vec_xor(const union vec a, const union vec b) { + return (union vec) { .sse.u = _mm_xor_si128(a.sse.u, b.sse.u) }; } #endif @@ -222,11 +200,10 @@ vec_xor (const union vec a, const union vec b) #ifndef VEC_FN_NOT #define VEC_FN_NOT static inline union vec -vec_not (const union vec v) -{ - const __m128i allset = _mm_set1_epi32(INT32_C(0xFFFFFFFF)); + vec_not(const union vec v) { + const __m128i allset = _mm_set1_epi32(INT32_C(0xFFFFFFFF)); - return (union vec) { .sse.u = _mm_xor_si128(v.sse.u, allset) }; + return (union vec) { .sse.u = _mm_xor_si128(v.sse.u, allset) }; } #endif @@ -234,9 +211,8 @@ vec_not (const union vec v) #ifndef VEC_FN_EQ #define VEC_FN_EQ static inline union vec -vec_eq (const union vec a, const union vec b) -{ - return (union vec) { .sse.f = _mm_cmpeq_ps(a.sse.f, b.sse.f) }; + vec_eq(const union vec a, const union vec b) { + return (union vec) { .sse.f = _mm_cmpeq_ps(a.sse.f, b.sse.f) }; } #endif @@ -244,9 +220,8 @@ vec_eq (const union vec a, const union vec b) #ifndef VEC_FN_IEQ #define VEC_FN_IEQ static inline union vec -vec_ieq (const union vec a, const union vec b) -{ - return (union vec) { .sse.i = _mm_cmpeq_epi32(a.sse.i, b.sse.i) }; + vec_ieq(const union vec a, const union vec b) { + return (union vec) { .sse.i = _mm_cmpeq_epi32(a.sse.i, b.sse.i) }; } #endif @@ -254,9 +229,8 @@ vec_ieq (const union vec a, const union vec b) #ifndef VEC_FN_UEQ #define VEC_FN_UEQ static inline union vec -vec_ueq (const union vec a, const union vec b) -{ - return (union vec) { .sse.u = _mm_cmpeq_epi32(a.sse.u, b.sse.u) }; + vec_ueq(const union vec a, const union vec b) { + return (union vec) { .sse.u = _mm_cmpeq_epi32(a.sse.u, b.sse.u) }; } #endif @@ -264,9 +238,8 @@ vec_ueq (const union vec a, const union vec b) #ifndef VEC_FN_LT #define VEC_FN_LT static inline union vec -vec_lt (const union vec a, const union vec b) -{ - return (union vec) { .sse.f = _mm_cmplt_ps(a.sse.f, b.sse.f) }; + vec_lt(const union vec a, const union vec b) { + return (union vec) { .sse.f = _mm_cmplt_ps(a.sse.f, b.sse.f) }; } #endif @@ -274,9 +247,8 @@ vec_lt (const union vec a, const union vec b) #ifndef VEC_FN_ILT #define VEC_FN_ILT static inline union vec -vec_ilt (const union vec a, const union vec b) -{ - return (union vec) { .sse.i = _mm_cmplt_epi32(a.sse.i, b.sse.i) }; + vec_ilt(const union vec a, const union vec b) { + return (union vec) { .sse.i = _mm_cmplt_epi32(a.sse.i, b.sse.i) }; } #endif @@ -284,13 +256,14 @@ vec_ilt (const union vec a, const union vec b) #ifndef VEC_FN_ULT #define VEC_FN_ULT static inline union vec -vec_ult (const union vec a, const union vec b) -{ - const __m128i bias = _mm_set1_epi32(INT32_C(0x80000000)); + vec_ult(const union vec a, const union vec b) { + const __m128i bias = _mm_set1_epi32(INT32_C(0x80000000)); - return (union vec) { .sse.i = _mm_cmplt_epi32( - _mm_sub_epi32(a.sse.i, bias), - _mm_sub_epi32(b.sse.i, bias)) }; + return (union vec) { + .sse.i = _mm_cmplt_epi32( + _mm_sub_epi32(a.sse.i, bias), + _mm_sub_epi32(b.sse.i, bias)) + }; } #endif @@ -298,9 +271,8 @@ vec_ult (const union vec a, const union vec b) #ifndef VEC_FN_LE #define VEC_FN_LE static inline union vec -vec_le (const union vec a, const union vec b) -{ - return (union vec) { .sse.f = _mm_cmple_ps(a.sse.f, b.sse.f) }; + vec_le(const union vec a, const union vec b) { + return (union vec) { .sse.f = _mm_cmple_ps(a.sse.f, b.sse.f) }; } #endif @@ -308,11 +280,12 @@ vec_le (const union vec a, const union vec b) #ifndef VEC_FN_ILE #define VEC_FN_ILE static inline union vec -vec_ile (const union vec a, const union vec b) -{ - return (union vec) { .sse.i = _mm_or_si128( - _mm_cmplt_epi32(a.sse.i, b.sse.i), - _mm_cmpeq_epi32(a.sse.i, b.sse.i)) }; + vec_ile(const union vec a, const union vec b) { + return (union vec) { + .sse.i = _mm_or_si128( + _mm_cmplt_epi32(a.sse.i, b.sse.i), + _mm_cmpeq_epi32(a.sse.i, b.sse.i)) + }; } #endif @@ -320,9 +293,8 @@ vec_ile (const union vec a, const union vec b) #ifndef VEC_FN_ULE #define VEC_FN_ULE static inline union vec -vec_ule (const union vec a, const union vec b) -{ - return vec_or(vec_ult(a, b), vec_ueq(a, b)); + vec_ule(const union vec a, const union vec b) { + return vec_or(vec_ult(a, b), vec_ueq(a, b)); } #endif @@ -330,9 +302,8 @@ vec_ule (const union vec a, const union vec b) #ifndef VEC_FN_GT #define VEC_FN_GT static inline union vec -vec_gt (const union vec a, const union vec b) -{ - return (union vec) { .sse.f = _mm_cmpgt_ps(a.sse.f, b.sse.f) }; + vec_gt(const union vec a, const union vec b) { + return (union vec) { .sse.f = _mm_cmpgt_ps(a.sse.f, b.sse.f) }; } #endif @@ -340,9 +311,8 @@ vec_gt (const union vec a, const union vec b) #ifndef VEC_FN_IGT #define VEC_FN_IGT static inline union vec -vec_igt (const union vec a, const union vec b) -{ - return (union vec) { .sse.i = _mm_cmpgt_epi32(a.sse.i, b.sse.i) }; + vec_igt(const union vec a, const union vec b) { + return (union vec) { .sse.i = _mm_cmpgt_epi32(a.sse.i, b.sse.i) }; } #endif @@ -350,13 +320,14 @@ vec_igt (const union vec a, const union vec b) #ifndef VEC_FN_UGT #define VEC_FN_UGT static inline union vec -vec_ugt (const union vec a, const union vec b) -{ - const __m128i bias = _mm_set1_epi32(INT32_C(0x80000000)); + vec_ugt(const union vec a, const union vec b) { + const __m128i bias = _mm_set1_epi32(INT32_C(0x80000000)); - return (union vec) { .sse.i = _mm_cmpgt_epi32( - _mm_sub_epi32(a.sse.i, bias), - _mm_sub_epi32(b.sse.i, bias)) }; + return (union vec) { + .sse.i = _mm_cmpgt_epi32( + _mm_sub_epi32(a.sse.i, bias), + _mm_sub_epi32(b.sse.i, bias)) + }; } #endif @@ -364,9 +335,8 @@ vec_ugt (const union vec a, const union vec b) #ifndef VEC_FN_GE #define VEC_FN_GE static inline union vec -vec_ge (const union vec a, const union vec b) -{ - return (union vec) { .sse.f = _mm_cmpge_ps(a.sse.f, b.sse.f) }; + vec_ge(const union vec a, const union vec b) { + return (union vec) { .sse.f = _mm_cmpge_ps(a.sse.f, b.sse.f) }; } #endif @@ -374,11 +344,12 @@ vec_ge (const union vec a, const union vec b) #ifndef VEC_FN_IGE #define VEC_FN_IGE static inline union vec -vec_ige (const union vec a, const union vec b) -{ - return (union vec) { .sse.i = _mm_or_si128( - _mm_cmpgt_epi32(a.sse.i, b.sse.i), - _mm_cmpeq_epi32(a.sse.i, b.sse.i)) }; + vec_ige(const union vec a, const union vec b) { + return (union vec) { + .sse.i = _mm_or_si128( + _mm_cmpgt_epi32(a.sse.i, b.sse.i), + _mm_cmpeq_epi32(a.sse.i, b.sse.i)) + }; } #endif @@ -386,9 +357,8 @@ vec_ige (const union vec a, const union vec b) #ifndef VEC_FN_UGE #define VEC_FN_UGE static inline union vec -vec_uge (const union vec a, const union vec b) -{ - return vec_or(vec_ugt(a, b), vec_ueq(a, b)); + vec_uge(const union vec a, const union vec b) { + return vec_or(vec_ugt(a, b), vec_ueq(a, b)); } #endif @@ -396,15 +366,14 @@ vec_uge (const union vec a, const union vec b) #ifndef VEC_FN_DOT #define VEC_FN_DOT static inline float -vec_dot (const union vec a, const union vec b) -{ - const __m128 mulx = _mm_mul_ps(a.sse.f, b.sse.f); - const __m128 muly = _mm_shuffle_ps(mulx, mulx, _MM_SHUFFLE(0, 0, 0, 1)); - const __m128 mulz = _mm_shuffle_ps(mulx, mulx, _MM_SHUFFLE(0, 0, 0, 2)); - const __m128 sum = _mm_add_ps(mulx, _mm_add_ps(muly, mulz)); +vec_dot(const union vec a, const union vec b) { + const __m128 mulx = _mm_mul_ps(a.sse.f, b.sse.f); + const __m128 muly = _mm_shuffle_ps(mulx, mulx, _MM_SHUFFLE(0, 0, 0, 1)); + const __m128 mulz = _mm_shuffle_ps(mulx, mulx, _MM_SHUFFLE(0, 0, 0, 2)); + const __m128 sum = _mm_add_ps(mulx, _mm_add_ps(muly, mulz)); - // Extract first element: - return ((union vec) { .xi = _mm_cvtsi128_si32(_mm_castps_si128(sum)) }).x; + // Extract first element: + return ((union vec) { .xi = _mm_cvtsi128_si32(_mm_castps_si128(sum)) }).x; } #endif @@ -412,22 +381,21 @@ vec_dot (const union vec a, const union vec b) #ifndef VEC_FN_CROSS #define VEC_FN_CROSS static inline union vec -vec_cross (const union vec a, const union vec b) -{ - // Shuffle a: - const __m128 ayzx = _mm_shuffle_ps(a.sse.f, a.sse.f, _MM_SHUFFLE(0, 0, 2, 1)); - const __m128 azxy = _mm_shuffle_ps(a.sse.f, a.sse.f, _MM_SHUFFLE(0, 1, 0, 2)); + vec_cross(const union vec a, const union vec b) { + // Shuffle a: + const __m128 ayzx = _mm_shuffle_ps(a.sse.f, a.sse.f, _MM_SHUFFLE(0, 0, 2, 1)); + const __m128 azxy = _mm_shuffle_ps(a.sse.f, a.sse.f, _MM_SHUFFLE(0, 1, 0, 2)); - // Shuffle b: - const __m128 byzx = _mm_shuffle_ps(b.sse.f, b.sse.f, _MM_SHUFFLE(0, 0, 2, 1)); - const __m128 bzxy = _mm_shuffle_ps(b.sse.f, b.sse.f, _MM_SHUFFLE(0, 1, 0, 2)); + // Shuffle b: + const __m128 byzx = _mm_shuffle_ps(b.sse.f, b.sse.f, _MM_SHUFFLE(0, 0, 2, 1)); + const __m128 bzxy = _mm_shuffle_ps(b.sse.f, b.sse.f, _MM_SHUFFLE(0, 1, 0, 2)); - // (ay * bz), (az * bx), (ax * by), (ax * bx): - const __m128 mul1 = _mm_mul_ps(ayzx, bzxy); + // (ay * bz), (az * bx), (ax * by), (ax * bx): + const __m128 mul1 = _mm_mul_ps(ayzx, bzxy); - // (az * by), (ax * bz), (ay * bx), (ax * bx): - const __m128 mul2 = _mm_mul_ps(azxy, byzx); + // (az * by), (ax * bz), (ay * bx), (ax * bx): + const __m128 mul2 = _mm_mul_ps(azxy, byzx); - return (union vec) { .sse.f = _mm_sub_ps(mul1, mul2) }; + return (union vec) { .sse.f = _mm_sub_ps(mul1, mul2) }; } #endif diff --git a/client/deps/vec/vec/private/sse41.h b/client/deps/vec/vec/private/sse41.h index 797596f79..196e042e0 100644 --- a/client/deps/vec/vec/private/sse41.h +++ b/client/deps/vec/vec/private/sse41.h @@ -2,11 +2,10 @@ #ifndef VEC_FN_DOT #define VEC_FN_DOT static inline float -vec_dot (const union vec a, const union vec b) -{ - const __m128 dot = _mm_dp_ps(a.sse.f, b.sse.f, 0x7F); +vec_dot(const union vec a, const union vec b) { + const __m128 dot = _mm_dp_ps(a.sse.f, b.sse.f, 0x7F); - // Extract first element: - return ((union vec) { .xi = _mm_cvtsi128_si32(_mm_castps_si128(dot)) }).x; + // Extract first element: + return ((union vec) { .xi = _mm_cvtsi128_si32(_mm_castps_si128(dot)) }).x; } #endif diff --git a/client/deps/vec/vec/vec.h b/client/deps/vec/vec/vec.h index 34b85c04a..e0dd0e39b 100644 --- a/client/deps/vec/vec/vec.h +++ b/client/deps/vec/vec/vec.h @@ -4,106 +4,106 @@ // GCC-style vector extensions work with Clang >= 3 or GCC >= 4.0: #if !defined(VEC_SUPPRESS_GCC) - #if __GNUC__ >= 4 || __clang_major__ >= 3 - #define VEC_GCC - #endif +#if __GNUC__ >= 4 || __clang_major__ >= 3 +#define VEC_GCC +#endif #endif // For testing purposes, allow the user to bypass any platform-specific support // and to use only the generic functions: #if !defined(VEC_SUPPRESS_HW) - // Check for SSE support: - #if defined(__SSE2__) - #define VEC_SSE2 - #include - #endif +// Check for SSE support: +#if defined(__SSE2__) +#define VEC_SSE2 +#include +#endif - // Check for SSE4 support: - #if defined(__SSE4_1__) - #define VEC_SSE41 - #include - #endif +// Check for SSE4 support: +#if defined(__SSE4_1__) +#define VEC_SSE41 +#include +#endif - // Check for ARM NEON support: - #if defined(__ARM_NEON__) || defined(__ARM_NEON) - #define VEC_NEON - #include +// Check for ARM NEON support: +#if defined(__ARM_NEON__) || defined(__ARM_NEON) +#define VEC_NEON +#include - // GCC and Clang support inline assembly: - #if defined(__GNUC__) || defined(__clang_major__) - #define VEC_NEON_ASM - #endif - #endif +// GCC and Clang support inline assembly: +#if defined(__GNUC__) || defined(__clang_major__) +#define VEC_NEON_ASM +#endif +#endif #endif // Define architecture-independent vector types. // This syntax is valid for GCC and LLVM/Clang: #if defined(VEC_GCC) -typedef float vec4f __attribute__ ((vector_size (16), aligned (16))); -typedef int32_t vec4i __attribute__ ((vector_size (16), aligned (16))); -typedef uint32_t vec4u __attribute__ ((vector_size (16), aligned (16))); +typedef float vec4f __attribute__((vector_size(16), aligned(16))); +typedef int32_t vec4i __attribute__((vector_size(16), aligned(16))); +typedef uint32_t vec4u __attribute__((vector_size(16), aligned(16))); #endif // Union to represent a 4x32-bit (128-bit) vector in various ways: union vec { - // Named member representation in float form, assuming a 3D vector: - struct { - float x; - float y; - float z; - float w; - }; + // Named member representation in float form, assuming a 3D vector: + struct { + float x; + float y; + float z; + float w; + }; - // Named member representation in signed integer form: - struct { - int32_t xi; - int32_t yi; - int32_t zi; - int32_t wi; - }; + // Named member representation in signed integer form: + struct { + int32_t xi; + int32_t yi; + int32_t zi; + int32_t wi; + }; - // Named member representation in unsigned integer form: - struct { - uint32_t xu; - uint32_t yu; - uint32_t zu; - uint32_t wu; - }; + // Named member representation in unsigned integer form: + struct { + uint32_t xu; + uint32_t yu; + uint32_t zu; + uint32_t wu; + }; - // Representation as array of separate elements: - union { - float f[4]; - int32_t i[4]; - uint32_t u[4]; - } elem; + // Representation as array of separate elements: + union { + float f[4]; + int32_t i[4]; + uint32_t u[4]; + } elem; - // Representation as GCC-style vector extensions: + // Representation as GCC-style vector extensions: #if defined(VEC_GCC) - union { - vec4f f; - vec4i i; - vec4u u; - } gcc; + union { + vec4f f; + vec4i i; + vec4u u; + } gcc; #endif - // SSE representation: + // SSE representation: #if defined(VEC_SSE2) - union { - __m128 f; - __m128i i; - __m128i u; - } sse; + union { + __m128 f; + __m128i i; + __m128i u; + } sse; #endif - // NEON representation: + // NEON representation: #if defined(VEC_NEON) - union { - float32x4_t f; - int32x4_t i; - uint32x4_t u; - } neon; + union { + float32x4_t f; + int32x4_t i; + uint32x4_t u; + } neon; #endif }; @@ -124,23 +124,23 @@ union vec { // are available. #if defined(VEC_SSE41) - #include "private/sse41.h" +#include "private/sse41.h" #endif #if defined(VEC_SSE2) - #include "private/sse2.h" +#include "private/sse2.h" #endif #if defined(VEC_NEON_ASM) - #include "private/neon_asm.h" +#include "private/neon_asm.h" #endif #if defined(VEC_NEON) - #include "private/neon_intrin.h" +#include "private/neon_intrin.h" #endif #if defined(VEC_GCC) - #include "private/gcc.h" +#include "private/gcc.h" #endif #include "private/generic.h" diff --git a/client/src/cmdflashmemspiffs.c b/client/src/cmdflashmemspiffs.c index e2d5417ff..62a85f246 100644 --- a/client/src/cmdflashmemspiffs.c +++ b/client/src/cmdflashmemspiffs.c @@ -467,7 +467,7 @@ static int CmdFlashMemSpiFFSWipe(const char *Cmd) { CLIParserInit(&ctx, "mem spiffs wipe", _RED_("* * * Warning * * *") " \n" _CYAN_("This command wipes all files on the device SPIFFS file system"), - "mem spiffs wipe"); + "mem spiffs wipe"); void *argtable[] = { arg_param_begin, diff --git a/client/src/cmdhf14a.c b/client/src/cmdhf14a.c index d5076205d..712cfd6a4 100644 --- a/client/src/cmdhf14a.c +++ b/client/src/cmdhf14a.c @@ -3025,7 +3025,7 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) { int16_t fsci = card.ats[1] & 0x0f; PrintAndLogEx(INFO, " ..." _YELLOW_("%02X") "............ T0 TA1 is%s present, TB1 is%s present, " - "TC1 is%s present, FSCI is %d (FSC = %d)", + "TC1 is%s present, FSCI is %d (FSC = %d)", card.ats[1], (ta1 ? "" : _RED_(" NOT")), (tb1 ? "" : _RED_(" NOT")), @@ -3047,7 +3047,7 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) { if (strlen(ds) != 0) ds[strlen(ds) - 2] = '\0'; if (strlen(dr) != 0) dr[strlen(dr) - 2] = '\0'; PrintAndLogEx(INFO, " ......" _YELLOW_("%02X") "......... TA1 different divisors are%s supported, " - "DR: [%s], DS: [%s]", + "DR: [%s], DS: [%s]", card.ats[pos], ((card.ats[pos] & 0x80) ? _RED_(" NOT") : ""), dr, diff --git a/client/src/cmdhfcalypso.c b/client/src/cmdhfcalypso.c index f45e9429e..b1d49928b 100644 --- a/client/src/cmdhfcalypso.c +++ b/client/src/cmdhfcalypso.c @@ -613,7 +613,7 @@ static bool calypso_json_parse_hex_uint(json_t *value, uint32_t max, uint32_t *o return false; } - while (isspace((unsigned char)*text)) { + while (isspace((unsigned char) * text)) { text++; } @@ -624,7 +624,7 @@ static bool calypso_json_parse_hex_uint(json_t *value, uint32_t max, uint32_t *o return false; } - while (isspace((unsigned char)*end)) { + while (isspace((unsigned char) * end)) { end++; } diff --git a/client/src/cmdhffelica.c b/client/src/cmdhffelica.c index f2860b0b7..485bd58df 100644 --- a/client/src/cmdhffelica.c +++ b/client/src/cmdhffelica.c @@ -350,10 +350,10 @@ static void print_status_flag1_interpretation(void) { PrintAndLogEx(INFO, "----+--------------------------------------------------------------------------------------------------------------------"); PrintAndLogEx(INFO, " 00 | Indicates the successful completion of a command."); PrintAndLogEx(INFO, " FF | If an error occurs during the processing of a command that includes no list in the command packet, \n" - " | or if an error occurs independently of any list, the card returns a response by setting FFh to Status Flag1."); + " | or if an error occurs independently of any list, the card returns a response by setting FFh to Status Flag1."); PrintAndLogEx(INFO, " XX | If an error occurs while processing a command that includes Service Code List or Block List \n" - " | in the command packet, the card returns a response by setting a number in the list to Status Flag1,\n" - " | indicating the location of the error."); + " | in the command packet, the card returns a response by setting a number in the list to Status Flag1,\n" + " | indicating the location of the error."); PrintAndLogEx(INFO, "----+--------------------------------------------------------------------------------------------------------------------"); } @@ -362,28 +362,28 @@ static void print_status_flag2_interpration(void) { PrintAndLogEx(INFO, "----+--------------------------------------------------------------------------------------------------------------------"); PrintAndLogEx(INFO, " 00 | Indicates the successful completion of a command."); PrintAndLogEx(INFO, " 01 | The calculated result is either less than zero when the purse data is decremented, or exceeds 4\n" - " | Bytes when the purse data is incremented."); + " | Bytes when the purse data is incremented."); PrintAndLogEx(INFO, " 02 | The specified data exceeds the value of cashback data at cashback of purse."); PrintAndLogEx(INFO, " 70 | Memory error (fatal error)."); PrintAndLogEx(INFO, " 71 | The number of memory rewrites exceeds the upper limit (this is only a warning; data writing is performed as normal).\n" - " | The maximum number of rewrites can differ, depending on the product being used.\n" - " | In addition, Status Flag1 is either 00h or FFh depending on the product being used."); + " | The maximum number of rewrites can differ, depending on the product being used.\n" + " | In addition, Status Flag1 is either 00h or FFh depending on the product being used."); PrintAndLogEx(INFO, " A1 | Illegal Number of Service| Number of Service or Number of Node specified by the command \n" - " | falls outside the range of the prescribed value."); + " | falls outside the range of the prescribed value."); PrintAndLogEx(INFO, " A2 | Illegal command packet (specified Number of Block) : Number of Block specified by the \n" - " | command falls outside the range of the prescribed values for the product."); + " | command falls outside the range of the prescribed values for the product."); PrintAndLogEx(INFO, " A3 | Illegal Block List (specified order of Service) : Service Code List Order specified by \n" - " | Block List Element falls outside the Number of Service specified by the command \n" - " | (or the Number of Service specified at the times of mutual authentication)."); + " | Block List Element falls outside the Number of Service specified by the command \n" + " | (or the Number of Service specified at the times of mutual authentication)."); PrintAndLogEx(INFO, " A4 | Illegal Service type : Area Attribute specified by the command or Service Attribute of Service Code is incorrect."); PrintAndLogEx(INFO, " A5 | Access is not allowed : Area or Service specified by the command cannot be accessed.\n" - " | The parameter specified by the command does not satisfy the conditions for success."); + " | The parameter specified by the command does not satisfy the conditions for success."); PrintAndLogEx(INFO, " A6 | Illegal Service Code List : Target to be accessed, identified by Service Code List Order, specified by Block\n" - " | List Element does not exist. Or, Node specified by Node Code List does not exist."); + " | List Element does not exist. Or, Node specified by Node Code List does not exist."); PrintAndLogEx(INFO, " A7 | Illegal Block List (Access Mode) : Access Mode specified by Block List Element is incorrect."); PrintAndLogEx(INFO, " A8 | Illegal Block Number Block Number (access to the specified data is inhibited) :\n" - " | specified by Block List Element exceeds the number of Blocks assigned to Service."); + " | specified by Block List Element exceeds the number of Blocks assigned to Service."); PrintAndLogEx(INFO, " A9 | Data write failure : This is the error that occurs in issuance commands."); PrintAndLogEx(INFO, " AA | Key-change failure : Key change failed."); PrintAndLogEx(INFO, " AB | Illegal Package Parity or illegal Package MAC : This is the error that occurs in issuance commands."); @@ -391,7 +391,7 @@ static void print_status_flag2_interpration(void) { PrintAndLogEx(INFO, " AD | Service exists already : This is the error that occurs in issuance commands."); PrintAndLogEx(INFO, " AE | Illegal System Code : This is the error that occurs in issuance commands."); PrintAndLogEx(INFO, " AF | Too many simultaneous cyclic write operations : Number of simultaneous write Blocks\n" - " | specified by the command to Cyclic Service exceeds the number of Blocks assigned to Service."); + " | specified by the command to Cyclic Service exceeds the number of Blocks assigned to Service."); PrintAndLogEx(INFO, " C0 | Illegal Package Identifier : This is the error that occurs in issuance commands."); PrintAndLogEx(INFO, " C1 | Discrepancy of parameters inside and outside Package : This is the error that occurs in issuance commands."); PrintAndLogEx(INFO, " C2 | Command is disabled already : This is the error that occurs in issuance commands."); @@ -415,16 +415,16 @@ static void print_number_of_service_constraints(void) { static void print_number_of_block_constraints(void) { PrintAndLogEx(INFO, " - Number of Block: shall be less than or equal to the maximum number of Blocks that can be read simultaneously.\n" - " The maximum number of Blocks that can be read simultaneously can differ, depending on the product being used.\n" - " Use as default 01"); + " The maximum number of Blocks that can be read simultaneously can differ, depending on the product being used.\n" + " Use as default 01"); } static void print_service_code_list_constraints(void) { PrintAndLogEx(INFO, " - Service Code List: For Service Code List, only Service Code existing in the product shall be specified:"); PrintAndLogEx(INFO, " - Even when Service Code exists in the product, Service Code not referenced from Block List shall not \n" - " be specified to Service Code List."); + " be specified to Service Code List."); PrintAndLogEx(INFO, " - For existence or nonexistence of Service in a product, please check using the Request Service \n" - " (or Request Service v2) command."); + " (or Request Service v2) command."); } /* diff --git a/client/src/cmdhfgallagher.c b/client/src/cmdhfgallagher.c index 4cacbbc8a..08ffbec17 100644 --- a/client/src/cmdhfgallagher.c +++ b/client/src/cmdhfgallagher.c @@ -381,7 +381,7 @@ static int hfgal_create_creds_app(DesfireContext_t *ctx, uint8_t *site_key, uint // UID is required for key diversification if (ctx->uidlen == 0) { PM3_RET_ERR(PM3_EINVARG, "UID is required for key diversification. " - "Please fetch it before calling `hfgal_create_creds_app`"); + "Please fetch it before calling `hfgal_create_creds_app`"); } // Create application @@ -871,11 +871,11 @@ static int hfgal_read_desfire_card(uint32_t aid, uint8_t *site_key, bool verbose PM3_RET_IF_ERR_MAYBE_MSG(res, !quiet, "Failed reading card application credentials"); PrintAndLogEx(SUCCESS, "Gallagher (AID %06X) - region: " _GREEN_("%c") " ( " _GREEN_("%u") " )" - ", facility: " _GREEN_("%u") - ", card number: " _GREEN_("%u") - ", issue level: " _GREEN_("%u"), + ", facility: " _GREEN_("%u") + ", card number: " _GREEN_("%u") + ", issue level: " _GREEN_("%u"), current_aid, - 'A' + creds.region_code, + 'A' + creds.region_code, creds.region_code, creds.facility_code, creds.card_number, @@ -1696,10 +1696,10 @@ static int CmdGallagherDecode(const char *cmd) { gallagher_decode_creds(data_buf, &creds); PrintAndLogEx(SUCCESS, "Gallagher - region: " _GREEN_("%c") " ( " _GREEN_("%u") " )" - ", facility: " _GREEN_("%u") - ", card number: " _GREEN_("%u") - ", issue level: " _GREEN_("%u"), - 'A' + creds.region_code, + ", facility: " _GREEN_("%u") + ", card number: " _GREEN_("%u") + ", issue level: " _GREEN_("%u"), + 'A' + creds.region_code, creds.region_code, creds.facility_code, creds.card_number, diff --git a/client/src/cmdhflegic.c b/client/src/cmdhflegic.c index 5caf36c4f..f1539cceb 100644 --- a/client/src/cmdhflegic.c +++ b/client/src/cmdhflegic.c @@ -352,7 +352,7 @@ static int decode_and_print_memory(uint16_t card_size, const uint8_t *input_buff // for printing the complete segment we need at least wrc + wrp_len + remain_seg_payload_len bytes if ((i + wrc + wrp_len + remain_seg_payload_len) > card_size) { PrintAndLogEx(FAILED, "Cannot read segment body, because the input buffer is too small. " - "Please check that the data is correct and properly aligned. "); + "Please check that the data is correct and properly aligned. "); return_value = PM3_EOUTOFBOUND; goto out; } @@ -436,7 +436,7 @@ static int decode_and_print_memory(uint16_t card_size, const uint8_t *input_buff // for printing the complete segment we need at least wrc + wrp_len + remain_seg_payload_len bytes if ((i + wrc + wrp_len + remain_seg_payload_len) > card_size) { PrintAndLogEx(FAILED, "Cannot read segment body, because the input buffer is too small. " - "Please check that the data is correct and properly aligned. "); + "Please check that the data is correct and properly aligned. "); return_value = PM3_EOUTOFBOUND; goto out; } @@ -607,7 +607,7 @@ static int CmdLegicSim(const char *Cmd) { "If a file is supplied, it is loaded into emulator memory first.", "hf legic sim --22\n" "hf legic sim -f myfile.bin --1024\n" - ); + ); void *argtable[] = { arg_param_begin, diff --git a/client/src/cmdhfmf.c b/client/src/cmdhfmf.c index 33bb4dc0f..7411426eb 100644 --- a/client/src/cmdhfmf.c +++ b/client/src/cmdhfmf.c @@ -5050,7 +5050,7 @@ void printKeyTableEx(size_t sectorscnt, sector_t *e_sector, uint8_t start_sector _YELLOW_("H") ":Hardnested / " _YELLOW_("C") ":statiCnested / " _YELLOW_("A") ":keyA " - " )" + " )" ); if (sectorscnt == 18) { PrintAndLogEx(INFO, "( " _MAGENTA_("*") " ) These sectors used for signature. Lays outside of user memory"); diff --git a/client/src/cmdhfmfdes.c b/client/src/cmdhfmfdes.c index ab643e2bc..4d03185c4 100644 --- a/client/src/cmdhfmfdes.c +++ b/client/src/cmdhfmfdes.c @@ -9234,7 +9234,7 @@ static int CmdHF14ADesVerifyCert(const char *Cmd) { arg_str0(NULL, "fid", "", "Certificate file ID (1 byte)"), // 15 arg_lit0(NULL, "no-auth", "Read certificate file without authentication"), // 16 arg_strn(NULL, "ca", "", 0, MFDES_VERIFYCERT_MAX_CAS, - "CA input, or `skip` to skip certificate signature validation. Repeat --ca for multiple entries"), // 17 + "CA input, or `skip` to skip certificate signature validation. Repeat --ca for multiple entries"), // 17 arg_str0(NULL, "keyaid", "", "Key application ID (default: cert app)"), // 18 arg_str0(NULL, "keyisoid", "", "Key application ISO DF ID (2 bytes)"), // 19 arg_str0(NULL, "keydfname", "", "Key application DF name (default: cert app)"), // 20 diff --git a/client/src/cmdhfmfsen.c b/client/src/cmdhfmfsen.c index 34f959f44..bc4f8c39e 100644 --- a/client/src/cmdhfmfsen.c +++ b/client/src/cmdhfmfsen.c @@ -1236,7 +1236,7 @@ static uint32_t fm11_count_candidate_seed_matches_vec(const fm11_keylist_t *list uint32_t i = 0; for (; i + 4 <= list->count; i += 4) { const union vec probe = VEC_U(list->data[i].seed, list->data[i + 1].seed, - list->data[i + 2].seed, list->data[i + 3].seed); + list->data[i + 2].seed, list->data[i + 3].seed); const union vec eq = vec_ueq(probe, target); matches += eq.elem.u[0] != 0; matches += eq.elem.u[1] != 0; @@ -1289,7 +1289,7 @@ static int fm11_filter_candidates_by_seed(fm11_keylist_t *list, uint32_t nt, uin uint32_t i = 0; for (; i + 4 <= list->count; i += 4) { const union vec probe = VEC_U(list->data[i].seed, list->data[i + 1].seed, - list->data[i + 2].seed, list->data[i + 3].seed); + list->data[i + 2].seed, list->data[i + 3].seed); const union vec eq = vec_ueq(probe, target); if (eq.elem.u[0] != 0) { filtered.data[filtered.count++] = list->data[i]; @@ -1401,30 +1401,38 @@ static int fm11_intersect_pair(uint32_t nt_a, fm11_keylist_t *a, uint32_t nt_b, fm11_keylist_t fb = {0}; for (uint32_t i = 0; i < a->count; i++) { if (((i & 0x3FF) == 0) && kbd_enter_pressed()) { - free(bset_a); free(bset_b); - fm11_keylist_free(&fa); fm11_keylist_free(&fb); + free(bset_a); + free(bset_b); + fm11_keylist_free(&fa); + fm11_keylist_free(&fb); return PM3_EOPABORTED; } if (BSET_TEST(bset_b, a->data[i].seed)) { int res = fm11_keylist_push_seeded(&fa, a->data[i].key, a->data[i].seed); if (res != PM3_SUCCESS) { - free(bset_a); free(bset_b); - fm11_keylist_free(&fa); fm11_keylist_free(&fb); + free(bset_a); + free(bset_b); + fm11_keylist_free(&fa); + fm11_keylist_free(&fb); return res; } } } for (uint32_t i = 0; i < b->count; i++) { if (((i & 0x3FF) == 0) && kbd_enter_pressed()) { - free(bset_a); free(bset_b); - fm11_keylist_free(&fa); fm11_keylist_free(&fb); + free(bset_a); + free(bset_b); + fm11_keylist_free(&fa); + fm11_keylist_free(&fb); return PM3_EOPABORTED; } if (BSET_TEST(bset_a, b->data[i].seed)) { int res = fm11_keylist_push_seeded(&fb, b->data[i].key, b->data[i].seed); if (res != PM3_SUCCESS) { - free(bset_a); free(bset_b); - fm11_keylist_free(&fa); fm11_keylist_free(&fb); + free(bset_a); + free(bset_b); + fm11_keylist_free(&fa); + fm11_keylist_free(&fb); return res; } } @@ -1462,8 +1470,8 @@ typedef struct { } fm11_seed_bucket_t; static int fm11_build_seed_buckets(fm11_keylist_t *a, fm11_keylist_t *b, - fm11_seed_bucket_t **buckets_out, - uint32_t *bucket_count_out) { + fm11_seed_bucket_t **buckets_out, + uint32_t *bucket_count_out) { uint32_t *count_a = calloc(UINT16_MAX + 1, sizeof(uint32_t)); uint32_t *count_b = calloc(UINT16_MAX + 1, sizeof(uint32_t)); if (count_a == NULL || count_b == NULL) { @@ -1763,7 +1771,7 @@ static void fm11_probe_queue_push(fm11_probe_queue_t *q, uint8_t sec, uint8_t kt return; } } - q->entries[q->count++] = (fm11_probe_entry_t){.sec = sec, .key_type = kt, .key = key}; + q->entries[q->count++] = (fm11_probe_entry_t) {.sec = sec, .key_type = kt, .key = key}; } static uint32_t fm11_accept_found_key_global( @@ -1891,9 +1899,9 @@ static uint32_t fm11_promote_singletons(const iso14a_fm11rf08s_nonces_with_data_ } static uint32_t fm11_propagate_exact_reused_keys(fm11_keylist_t candidates[FM11RF08S_SECTORS][2], - uint64_t keys_found[FM11RF08S_SECTORS][2], - bool found_key[FM11RF08S_SECTORS][2], - bool promote_inferred) { + uint64_t keys_found[FM11RF08S_SECTORS][2], + bool found_key[FM11RF08S_SECTORS][2], + bool promote_inferred) { uint32_t propagated = 0; if (promote_inferred == false) { return 0; @@ -3121,7 +3129,7 @@ int CmdHF14AMfSEN(const char *Cmd) { fm11_keylist_free(&priority); } - priority = (fm11_keylist_t){0}; + priority = (fm11_keylist_t) {0}; retval = fm11_build_global_priority_keys(candidates, duplicate_prefix, &priority); if (retval != PM3_SUCCESS) { fm11_keylist_free(&priority); @@ -3256,7 +3264,7 @@ int CmdHF14AMfSEN(const char *Cmd) { snprintf(activity, sizeof(activity), "sec %03u key %c - checking %u candidates", real_sec, kt ? 'B' : 'A', candidates[sec][kt].count); fm11_sen_progress(nonce_count, activity, candidates[sec][kt].count, - (candidates[sec][kt].count / 2 / FM11RF08S_FCHK_KEYS_PER_SECOND) + 1); + (candidates[sec][kt].count / 2 / FM11RF08S_FCHK_KEYS_PER_SECOND) + 1); uint64_t key = 0; int res = fm11_verify_candidates(real_sec, kt, &candidates[sec][kt], &key); if (res == PM3_SUCCESS) { diff --git a/client/src/cmdhfntag424.c b/client/src/cmdhfntag424.c index 92639f864..97108a741 100644 --- a/client/src/cmdhfntag424.c +++ b/client/src/cmdhfntag424.c @@ -723,8 +723,8 @@ static int ntag424_authenticate_ev2_first(uint8_t keyno, uint8_t *key, ntag424_s if (memcmp(response.rnd_a, &rnd_a_clear[1], 15) != 0 || response.rnd_a[15] != rnd_a_clear[0]) { PrintAndLogEx(ERR, "Incorrect response from card\n" - "expected: %s\n" - "got: %s" + "expected: %s\n" + "got: %s" , sprint_hex(rnd_a_clear, 16), sprint_hex(response.rnd_a, 16)); return PM3_ESOFT; diff --git a/client/src/cmdhfsecc.c b/client/src/cmdhfsecc.c index ae1ebda62..c08ed687f 100644 --- a/client/src/cmdhfsecc.c +++ b/client/src/cmdhfsecc.c @@ -476,11 +476,11 @@ static int CmdHFHIDConfigSim(const char *Cmd) { strncpy(uid_str, sprint_hex_inrow(uid, uidlen), sizeof(uid_str) - 1); uid_str[sizeof(uid_str) - 1] = '\0'; PrintAndLogEx(INFO, "HID Config Card sim:" - " UID " _YELLOW_("%s") - " AID " _YELLOW_("%s") - " ATS len " _YELLOW_("%d") - " APDU overrides " _YELLOW_("%u") - " default resp " _YELLOW_("%s"), + " UID " _YELLOW_("%s") + " AID " _YELLOW_("%s") + " ATS len " _YELLOW_("%d") + " APDU overrides " _YELLOW_("%u") + " default resp " _YELLOW_("%s"), uid_str, aid_str, ats_len, apdu_count, has_default_resp ? sprint_hex_inrow(default_resp, default_resp_len_sz) : "9000 (builtin)"); PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " or " _GREEN_("") " to abort simulation"); diff --git a/client/src/cmdlf.c b/client/src/cmdlf.c index edb995872..6acbe0dad 100644 --- a/client/src/cmdlf.c +++ b/client/src/cmdlf.c @@ -1829,11 +1829,11 @@ int CmdLFRelay(const char *Cmd) { " --rdr : Reading device, act as IP client and reads LF tag and sends data\n" " --tag : Simulation device, act as IP server and simulates relayed data\n", _WHITE_("Device A, reading LF tag, client") "\n" - "lf relay --rdr --ip 192.168.1.141 -> Client, connect to IP 192.168.1.141:8000\n" - "lf relay --rdr --ip 192.168.1.141 -p 18111 -> Client, connect to IP 192.168.1.141:18111 \n\n" + "lf relay --rdr --ip 192.168.1.141 -> Client, connect to IP 192.168.1.141:8000\n" + "lf relay --rdr --ip 192.168.1.141 -p 18111 -> Client, connect to IP 192.168.1.141:18111 \n\n" _WHITE_("Device B, simulate LF tag, server") "\n" - "lf relay --tag -p 8111 -> Server listening port 8111, recv 40000 samples\n" - "lf relay --tag -s 10000 -> Server listening port 8000, recv 10000 samples\n" + "lf relay --tag -p 8111 -> Server listening port 8111, recv 40000 samples\n" + "lf relay --tag -s 10000 -> Server listening port 8000, recv 10000 samples\n" ); void *argtable[] = { diff --git a/client/src/cmdlft55xx.c b/client/src/cmdlft55xx.c index b07c4e015..fe75af79e 100644 --- a/client/src/cmdlft55xx.c +++ b/client/src/cmdlft55xx.c @@ -948,9 +948,9 @@ static int CmdT55xxReadBlock(const char *Cmd) { _CYAN_("Use of read with password on a tag not configured") "\n" _CYAN_("for a password can damage the tag") "\n" _RED_(" * * * * * * * * * *"), - "lf t55xx read -b 0 --> read data from block 0\n" - "lf t55xx read -b 0 --pwd 01020304 --> read data from block 0, pwd 01020304\n" - "lf t55xx read -b 0 --pwd 01020304 -o --> read data from block 0, pwd 01020304, override\n" + "lf t55xx read -b 0 --> read data from block 0\n" + "lf t55xx read -b 0 --pwd 01020304 --> read data from block 0, pwd 01020304\n" + "lf t55xx read -b 0 --pwd 01020304 -o --> read data from block 0, pwd 01020304, override\n" ); // 1 (help) + 4(four user specified params) + (5 T55XX_DLMODE_SINGLE) diff --git a/client/src/cmdtrace.c b/client/src/cmdtrace.c index c72eb4dac..d565fb2a1 100644 --- a/client/src/cmdtrace.c +++ b/client/src/cmdtrace.c @@ -1498,7 +1498,7 @@ int CmdTraceList(const char *Cmd) { if (protocol == LEGIC) PrintAndLogEx(INFO, _YELLOW_("LEGIC") " - Reader Mode: Timings are in ticks (1us == 1.5ticks)\n" - " Tag Mode: Timings are in sub carrier periods (1/212 kHz == 4.7us)"); + " Tag Mode: Timings are in sub carrier periods (1/212 kHz == 4.7us)"); if (protocol == ISO_14443B || protocol == PROTO_CRYPTORF) { if (use_us) diff --git a/client/src/flash.c b/client/src/flash.c index 25edb7c0f..584288779 100644 --- a/client/src/flash.c +++ b/client/src/flash.c @@ -124,7 +124,7 @@ static int build_segs_from_phdrs(flash_file_t *ctx, uint32_t flash_size) { offset); if (filesz != memsz) { PrintAndLogEx(ERR, "Error: PHDR file size does not equal memory size\n" - "(DATA+BSS PHDRs do not make sense on ROM platforms!)"); + "(DATA+BSS PHDRs do not make sense on ROM platforms!)"); return PM3_EFILE; } if (paddr < last_end) { diff --git a/client/src/mifare/gallaghercore.c b/client/src/mifare/gallaghercore.c index 3caba0b0a..07f83060d 100644 --- a/client/src/mifare/gallaghercore.c +++ b/client/src/mifare/gallaghercore.c @@ -300,10 +300,10 @@ void print_gallagher_creds(GallagherCredentials_t *creds) { return; } PrintAndLogEx(SUCCESS, "Gallagher - region: " _GREEN_("%c") " ( " _GREEN_("%u") " )" - ", facility: " _GREEN_("%u") - ", card number: " _GREEN_("%u") - ", issue level: " _GREEN_("%u"), - 'A' + creds->region_code, + ", facility: " _GREEN_("%u") + ", card number: " _GREEN_("%u") + ", issue level: " _GREEN_("%u"), + 'A' + creds->region_code, creds->region_code, creds->facility_code, creds->card_number, diff --git a/client/src/mifare/mifarehost.c b/client/src/mifare/mifarehost.c index 31e81cec6..47c0dbfc6 100644 --- a/client/src/mifare/mifarehost.c +++ b/client/src/mifare/mifarehost.c @@ -319,10 +319,10 @@ int mf_check_keys_fast_ex(uint8_t sectorsCnt, uint8_t firstChunk, uint8_t lastCh PrintAndLogEx(NORMAL, ""); PrintAndLogEx(SUCCESS, "\nTarget block " _GREEN_("%4u") " key type " _GREEN_("%c") " -- found valid key [ " _GREEN_("%s") " ]", - block_no, - key_type ? 'B' : 'A', - sprint_hex_inrow(resp.data.asBytes, MIFARE_KEY_SIZE) - ); + block_no, + key_type ? 'B' : 'A', + sprint_hex_inrow(resp.data.asBytes, MIFARE_KEY_SIZE) + ); return PM3_SUCCESS; } diff --git a/client/src/pm3_luawrap.c b/client/src/pm3_luawrap.c index 65798a2e5..0d5753a9d 100644 --- a/client/src/pm3_luawrap.c +++ b/client/src/pm3_luawrap.c @@ -2756,9 +2756,9 @@ static int _wrap_new_pm3(lua_State *L) { } SWIG_Lua_pusherrstring(L, "Wrong arguments for overloaded function 'new_pm3'\n" - " Possible C/C++ prototypes are:\n" - " pm3::pm3()\n" - " pm3::pm3(char *)\n"); + " Possible C/C++ prototypes are:\n" + " pm3::pm3()\n" + " pm3::pm3(char *)\n"); lua_error(L); return 0; } diff --git a/client/src/pm3line_vocabulary.h b/client/src/pm3line_vocabulary.h index 285f50197..c11f65c3d 100644 --- a/client/src/pm3line_vocabulary.h +++ b/client/src/pm3line_vocabulary.h @@ -356,6 +356,7 @@ const static vocabulary_t vocabulary[] = { { 0, "hf legic rdbl" }, { 0, "hf legic reader" }, { 0, "hf legic restore" }, + { 0, "hf legic clone" }, { 0, "hf legic wipe" }, { 0, "hf legic wrbl" }, { 0, "hf legic sim" }, @@ -379,6 +380,7 @@ const static vocabulary_t vocabulary[] = { { 0, "hf mf nested" }, { 1, "hf mf hardnested" }, { 0, "hf mf staticnested" }, + { 0, "hf mf sen" }, { 0, "hf mf brute" }, { 0, "hf mf autopwn" }, { 0, "hf mf nack" }, diff --git a/client/src/proxmark3.c b/client/src/proxmark3.c index 3b9c69386..341b9ec0d 100644 --- a/client/src/proxmark3.c +++ b/client/src/proxmark3.c @@ -854,7 +854,7 @@ static int dumpmem_pm3(char *serial_port_name, const char *filename, uint32_t ad PrintAndLogEx(INFO, "Device is running the bootloader."); } else { PrintAndLogEx(ERR, "Device is running the bootloader, but the bootloader" - " doesn't understand the READ MEM command."); + " doesn't understand the READ MEM command."); goto finish2; } } diff --git a/common/bruteforce.h b/common/bruteforce.h index cab98c8c7..4a956801d 100644 --- a/common/bruteforce.h +++ b/common/bruteforce.h @@ -63,8 +63,8 @@ typedef struct { uint64_t current_key; // Use 64 bit and truncate when needed. uint8_t mode; uint8_t charset[ - BF_CHARSET_DIGITS_SIZE - + BF_CHARSET_UPPERCASE_SIZE + BF_CHARSET_DIGITS_SIZE + + BF_CHARSET_UPPERCASE_SIZE ]; uint8_t charset_length; diff --git a/common/iso15693tools.h b/common/iso15693tools.h index a18498a8d..0f9445c4d 100644 --- a/common/iso15693tools.h +++ b/common/iso15693tools.h @@ -73,14 +73,14 @@ static const int Iso15693FrameSOF[] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - -1, -1, -1, -1, - -1, -1, -1, -1, - 1, 1, 1, 1, - 1, 1, 1, 1 - }; + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + -1, -1, -1, -1, + -1, -1, -1, -1, + 1, 1, 1, 1, + 1, 1, 1, 1 +}; static const int Iso15693Logic0[] = { 1, 1, 1, 1, 1, 1, 1, 1, @@ -89,10 +89,10 @@ static const int Iso15693Logic0[] = { }; static const int Iso15693Logic1[] = { -1, -1, -1, -1, - -1, -1, -1, -1, - 1, 1, 1, 1, - 1, 1, 1, 1 - }; + -1, -1, -1, -1, + 1, 1, 1, 1, + 1, 1, 1, 1 +}; // EOF defined as // 1) logic '0' (8 pulses of 423.75kHz followed by unmodulated for 18.88us) diff --git a/common/mbedtls/aesni.c b/common/mbedtls/aesni.c index 7a89a298b..7add8c1af 100644 --- a/common/mbedtls/aesni.c +++ b/common/mbedtls/aesni.c @@ -254,7 +254,7 @@ void mbedtls_aesni_inverse_key(unsigned char *invkey, for (fk -= 16, ik += 16; fk > fwdkey; fk -= 16, ik += 16) asm("movdqu (%0), %%xmm0 \n\t" AESIMC xmm0_xmm0 "\n\t" - "movdqu %%xmm0, (%1) \n\t" + "movdqu %%xmm0, (%1) \n\t" : : "r"(fk), "r"(ik) : "memory", "xmm0"); @@ -403,23 +403,23 @@ static void aesni_setkey_enc_256(unsigned char *rk, /* Set xmm2 to stuff:Y:stuff:stuff with Y = subword( r11 ) * and proceed to generate next round key from there */ AESKEYGENA xmm0_xmm2 ",0x00 \n\t" - "pshufd $0xaa, %%xmm2, %%xmm2 \n\t" - "pxor %%xmm1, %%xmm2 \n\t" - "pslldq $4, %%xmm1 \n\t" - "pxor %%xmm1, %%xmm2 \n\t" - "pslldq $4, %%xmm1 \n\t" - "pxor %%xmm1, %%xmm2 \n\t" - "pslldq $4, %%xmm1 \n\t" - "pxor %%xmm2, %%xmm1 \n\t" - "add $16, %0 \n\t" - "movdqu %%xmm1, (%0) \n\t" - "ret \n\t" + "pshufd $0xaa, %%xmm2, %%xmm2 \n\t" + "pxor %%xmm1, %%xmm2 \n\t" + "pslldq $4, %%xmm1 \n\t" + "pxor %%xmm1, %%xmm2 \n\t" + "pslldq $4, %%xmm1 \n\t" + "pxor %%xmm1, %%xmm2 \n\t" + "pslldq $4, %%xmm1 \n\t" + "pxor %%xmm2, %%xmm1 \n\t" + "add $16, %0 \n\t" + "movdqu %%xmm1, (%0) \n\t" + "ret \n\t" /* * Main "loop" - Generating one more key than necessary, * see definition of mbedtls_aes_context.buf */ - "2: \n\t" + "2: \n\t" AESKEYGENA xmm1_xmm2 ",0x01 \n\tcall 1b \n\t" AESKEYGENA xmm1_xmm2 ",0x02 \n\tcall 1b \n\t" AESKEYGENA xmm1_xmm2 ",0x04 \n\tcall 1b \n\t" diff --git a/common/mbedtls/camellia.c b/common/mbedtls/camellia.c index 7b49f9aae..56097c704 100644 --- a/common/mbedtls/camellia.c +++ b/common/mbedtls/camellia.c @@ -215,16 +215,16 @@ static const signed char indexes[2][4][20] = { }, /* KL -> RK */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - }, /* KR -> RK */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 + }, /* KR -> RK */ { 4, 5, 6, 7, 12, 13, 14, 15, 16, 17, 18, 19, -1, 24, 25, -1, 31, 28, 29, 30 }, /* KA -> RK */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - } /* KB -> RK */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 + } /* KB -> RK */ }, { { @@ -233,12 +233,12 @@ static const signed char indexes[2][4][20] = { }, /* KL -> RK */ { -1, -1, -1, -1, 8, 9, 10, 11, 16, 17, - 18, 19, -1, -1, -1, -1, 39, 36, 37, 38 - }, /* KR -> RK */ + 18, 19, -1, -1, -1, -1, 39, 36, 37, 38 + }, /* KR -> RK */ { -1, -1, -1, -1, 12, 13, 14, 15, 58, 59, - 56, 57, 31, 28, 29, 30, -1, -1, -1, -1 - }, /* KA -> RK */ + 56, 57, 31, 28, 29, 30, -1, -1, -1, -1 + }, /* KA -> RK */ { 4, 5, 6, 7, 65, 66, 67, 64, 20, 21, 22, 23, -1, -1, -1, -1, 43, 40, 41, 42 diff --git a/common/mbedtls/ctr_drbg.c b/common/mbedtls/ctr_drbg.c index f5d39d38d..ae42e93b1 100644 --- a/common/mbedtls/ctr_drbg.c +++ b/common/mbedtls/ctr_drbg.c @@ -119,7 +119,7 @@ void mbedtls_ctr_drbg_set_reseed_interval(mbedtls_ctr_drbg_context *ctx, static int block_cipher_df(unsigned char *output, const unsigned char *data, size_t data_len) { unsigned char buf[MBEDTLS_CTR_DRBG_MAX_SEED_INPUT + - MBEDTLS_CTR_DRBG_BLOCKSIZE + 16]; + MBEDTLS_CTR_DRBG_BLOCKSIZE + 16]; unsigned char tmp[MBEDTLS_CTR_DRBG_SEEDLEN]; unsigned char key[MBEDTLS_CTR_DRBG_KEYSIZE]; unsigned char chain[MBEDTLS_CTR_DRBG_BLOCKSIZE]; diff --git a/common/mbedtls/memory_buffer_alloc.c b/common/mbedtls/memory_buffer_alloc.c index a1e9accda..e3c16e74f 100644 --- a/common/mbedtls/memory_buffer_alloc.c +++ b/common/mbedtls/memory_buffer_alloc.c @@ -86,7 +86,7 @@ static void debug_header(memory_header *hdr) { #endif mbedtls_fprintf(stderr, "HDR: PTR(%10zu), PREV(%10zu), NEXT(%10zu), " - "ALLOC(%zu), SIZE(%10zu)\n", + "ALLOC(%zu), SIZE(%10zu)\n", (size_t) hdr, (size_t) hdr->prev, (size_t) hdr->next, hdr->alloc, hdr->size); mbedtls_fprintf(stderr, " FPREV(%10zu), FNEXT(%10zu)\n", @@ -164,7 +164,7 @@ static int verify_chain(void) { if (prv == NULL || verify_header(prv) != 0) { #if defined(MBEDTLS_MEMORY_DEBUG) mbedtls_fprintf(stderr, "FATAL: verification of first header " - "failed\n"); + "failed\n"); #endif return (1); } @@ -172,7 +172,7 @@ static int verify_chain(void) { if (heap.first->prev != NULL) { #if defined(MBEDTLS_MEMORY_DEBUG) mbedtls_fprintf(stderr, "FATAL: verification failed: " - "first->prev != NULL\n"); + "first->prev != NULL\n"); #endif return (1); } @@ -183,7 +183,7 @@ static int verify_chain(void) { if (verify_header(cur) != 0) { #if defined(MBEDTLS_MEMORY_DEBUG) mbedtls_fprintf(stderr, "FATAL: verification of header " - "failed\n"); + "failed\n"); #endif return (1); } @@ -191,7 +191,7 @@ static int verify_chain(void) { if (cur->prev != prv) { #if defined(MBEDTLS_MEMORY_DEBUG) mbedtls_fprintf(stderr, "FATAL: verification failed: " - "cur->prev != prv\n"); + "cur->prev != prv\n"); #endif return (1); } @@ -243,7 +243,7 @@ static void *buffer_alloc_calloc(size_t n, size_t size) { if (cur->alloc != 0) { #if defined(MBEDTLS_MEMORY_DEBUG) mbedtls_fprintf(stderr, "FATAL: block in free_list but allocated " - "data\n"); + "data\n"); #endif mbedtls_exit(1); } @@ -359,7 +359,7 @@ static void buffer_alloc_free(void *ptr) { if (p < heap.buf || p >= heap.buf + heap.len) { #if defined(MBEDTLS_MEMORY_DEBUG) mbedtls_fprintf(stderr, "FATAL: mbedtls_free() outside of managed " - "space\n"); + "space\n"); #endif mbedtls_exit(1); } @@ -373,7 +373,7 @@ static void buffer_alloc_free(void *ptr) { if (hdr->alloc != 1) { #if defined(MBEDTLS_MEMORY_DEBUG) mbedtls_fprintf(stderr, "FATAL: mbedtls_free() on unallocated " - "data\n"); + "data\n"); #endif mbedtls_exit(1); } diff --git a/common/mbedtls/ssl.h b/common/mbedtls/ssl.h index 7c78a698a..3603dc373 100644 --- a/common/mbedtls/ssl.h +++ b/common/mbedtls/ssl.h @@ -445,14 +445,14 @@ union mbedtls_ssl_premaster_secret { #endif #if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) unsigned char _pms_dhe_psk[4 + MBEDTLS_MPI_MAX_SIZE - + MBEDTLS_PSK_MAX_LEN]; /* RFC 4279 3 */ + + MBEDTLS_PSK_MAX_LEN]; /* RFC 4279 3 */ #endif #if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) unsigned char _pms_rsa_psk[52 + MBEDTLS_PSK_MAX_LEN]; /* RFC 4279 4 */ #endif #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) unsigned char _pms_ecdhe_psk[4 + MBEDTLS_ECP_MAX_BYTES - + MBEDTLS_PSK_MAX_LEN]; /* RFC 5489 2 */ + + MBEDTLS_PSK_MAX_LEN]; /* RFC 5489 2 */ #endif #if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) unsigned char _pms_ecjpake[32]; /* Thread spec: SHA-256 output */ diff --git a/common/mbedtls/ssl_cli.c b/common/mbedtls/ssl_cli.c index b41b01167..cb4552a38 100644 --- a/common/mbedtls/ssl_cli.c +++ b/common/mbedtls/ssl_cli.c @@ -804,7 +804,7 @@ static int ssl_write_use_srtp_ext(mbedtls_ssl_context *ssl, */ MBEDTLS_SSL_DEBUG_MSG(3, ("client hello, " - "illegal DTLS-SRTP protection profile %d", + "illegal DTLS-SRTP protection profile %d", ssl->conf->dtls_srtp_profile_list[protection_profiles_index] )); return (MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED); diff --git a/common/mbedtls/ssl_msg.c b/common/mbedtls/ssl_msg.c index d13be766f..8eed325ec 100644 --- a/common/mbedtls/ssl_msg.c +++ b/common/mbedtls/ssl_msg.c @@ -3954,7 +3954,7 @@ static int ssl_buffer_message(mbedtls_ssl_context *ssl) { /* Silently ignore -- message too far in the future */ MBEDTLS_SSL_DEBUG_MSG(2, ("Ignore future HS message with sequence number %u, " - "buffering window %u - %u", + "buffering window %u - %u", recv_msg_seq, ssl->handshake->in_msg_seq, ssl->handshake->in_msg_seq + MBEDTLS_SSL_MAX_BUFFERED_HS - 1)); diff --git a/common/mbedtls/x509_crt.c b/common/mbedtls/x509_crt.c index 850893f0a..2e1cea165 100644 --- a/common/mbedtls/x509_crt.c +++ b/common/mbedtls/x509_crt.c @@ -2101,7 +2101,7 @@ int mbedtls_x509_crt_verify_info(char *buf, size_t size, const char *prefix, if (flags != 0) { ret = mbedtls_snprintf(p, n, "%sUnknown reason " - "(this should not happen)\n", prefix); + "(this should not happen)\n", prefix); MBEDTLS_X509_SAFE_SNPRINTF; } diff --git a/doc/commands.json b/doc/commands.json index 9e66171a6..7762fb29d 100644 --- a/doc/commands.json +++ b/doc/commands.json @@ -2343,6 +2343,22 @@ ], "usage": "hf calypso list [-h1crux] [--frame] [-f ]" }, + "hf calypso probecmdcompat": { + "command": "hf calypso probecmdcompat", + "description": "Probe Calypso SELECT command compatibility", + "notes": [ + "hf calypso probecmdcompat", + "hf calypso probecmdcompat -v", + "hf calypso probecmdcompat --aid 315449432E494341" + ], + "offline": false, + "options": [ + "-h, --help This help", + "--aid Calypso application AID or AID prefix (5..16 bytes)", + "-v, --verbose verbose output" + ], + "usage": "hf calypso probecmdcompat [-hv] [--aid ]" + }, "hf cipurse aread": { "command": "hf cipurse aread", "description": "Read file attributes by file ID with key ID and key. If no key is supplied, default key of 737373...7373 will be used", @@ -4392,6 +4408,24 @@ ], "usage": "hf ksx6924 prec [-hka] " }, + "hf legic clone": { + "command": "hf legic clone", + "description": "Rewrite a LEGIC dump for a new target tag or MCC. Use --mcc to rewrite only the dump obfuscation, or --write to clone to the current tag.", + "notes": [ + "hf legic clone -f src.bin -c 39 -o clone.bin", + "hf legic clone -f src.bin --write", + "hf legic clone -f src.bin --write -o clone.bin" + ], + "offline": false, + "options": [ + "-h, --help This help", + "-f, --file Source dump file", + "--mcc Target MCC byte for output-only cloning", + "-o, --output Output cloned dump file", + "-w, --write Write cloned dump to the currently attached tag" + ], + "usage": "hf legic clone [-hw] -f [--mcc ] [-o ]" + }, "hf legic crc": { "command": "hf legic crc", "description": "Calculates the legic crc8/crc16 on the given data", @@ -4572,18 +4606,20 @@ }, "hf legic sim": { "command": "hf legic sim", - "description": "Simulates a LEGIC Prime tag. Following types supported (MIM22, MIM256, MIM1024)", + "description": "Simulates a LEGIC Prime tag. If a file is supplied, it is loaded into emulator memory first.", "notes": [ - "hf legic sim --22" + "hf legic sim --22", + "hf legic sim -f myfile.bin --1024" ], "offline": false, "options": [ "-h, --help This help", "--22 LEGIC Prime MIM22", "--256 LEGIC Prime MIM256 (def)", - "--1024 LEGIC Prime MIM1024" + "--1024 LEGIC Prime MIM1024", + "-f, --file Optional dump file to load into emulator memory" ], - "usage": "hf legic sim [-h] [--22] [--256] [--1024]" + "usage": "hf legic sim [-h] [--22] [--256] [--1024] [-f ]" }, "hf legic view": { "command": "hf legic view", @@ -5844,6 +5880,28 @@ ], "usage": "hf mf restore [-h] [--mini] [--1k] [--2k] [--4k] [-u ] [-f ] [-k ] [--ka] [--force]" }, + "hf mf sen": { + "command": "hf mf sen", + "description": "Recover FM11RF08S keys using static encrypted nonce evidence in native client code", + "notes": [ + "hf mf sen", + "hf mf sen --keep-nonces", + "hf mf sen --no-oob", + "hf mf sen --reader" + ], + "offline": false, + "options": [ + "-h, --help This help", + "--keep-nonces save collected nonce/data JSON evidence", + "--no-oob do not include FM11RF08S out-of-bounds sector 32 in key file", + "--reader pre-pass: emulate this UID to a reader and digest recovered reader keys", + "--offline-only stop after offline filtering, do not verify online", + "--online-confirm only do online confirmation (skip generation if nonces loaded)", + "--max-online-candidates abort online phase if total candidates exceed this limit", + "--parity-mask parity filter mask 1..F (default 1 = vetted staticnested_1nt behavior)" + ], + "usage": "hf mf sen [-h] [--keep-nonces] [--no-oob] [--reader] [--offline-only] [--online-confirm] [--max-online-candidates ] [--parity-mask ]" + }, "hf mf setmod": { "command": "hf mf setmod", "description": "Sets the load modulation strength of a MIFARE Classic EV1 card", @@ -6461,6 +6519,41 @@ ], "usage": "hf mfdes createmacfile [-hav] [-n ] [-t ] [-k ] [--kdf ] [-i ] [-m ] [-c ] [--schann ] [--aid ] [--isoid ] [--fid ] [--amode ] [--rawrights ] [--rrights ] [--wrights ] [--rwrights ] [--chrights ] [--no-auth] [--mackey ] [--mackeyver ]" }, + "hf mfdes createmfcmapping": { + "command": "hf mfdes createmfcmapping", + "description": "Create a Mifare Classic mapping on a DESFire EV3C. The MFC License MAC key (AES only) must have been set previously as PICC key number 50.", + "notes": [ + "hf mfdes createmfcmapping --aid 123456 --fid 01 --mfc-keys FFFFFFFFFFFF111111111111222222222222 --mfc-blocks 4,5,6,8", + "-> Map blocks 4, 5, 6, 8 where sector 1 key A is FFFFFFFFFFFF with key B readable,", + "-> sector 2 keys are 111111111111 and 222222222222 with key B used for authentication" + ], + "offline": false, + "options": [ + "-h, --help This help", + "-a, --apdu Show APDU requests and responses", + "-v, --verbose Verbose output", + "-n, --keyno Key number", + "-t, --algo Crypt algo", + "-k, --key Key for authenticate (HEX 8(DES), 16(2TDEA or AES) or 24(3TDEA) bytes)", + "--kdf Key Derivation Function (KDF)", + "-i, --kdfi KDF input (1-31 hex bytes)", + "-m, --cmode Communicaton mode", + "-c, --ccset Communicaton command set", + "--schann Secure channel", + "--aid Application ID (3 hex bytes, big endian)", + "--isoid Application ISO ID (ISO DF ID) (2 hex bytes, big endian)", + "--fid File ID to map (1 hex byte)", + "--restore-fid Restore source when mapping value files to value blocks (1 hex byte)", + "-b, --blk [,[,...]] The MFC blocks to map, must be unique (use -b data for all data blocks, and -b trailer for all trailer blocks)", + "--mfc-license The MFC license (omit to use saved license and license MAC)", + "--mfc-license-mac The MFC license MAC (omit to use saved license and license MAC)", + "--ka Allow updating key A from inside sector trailers mapped to DESFire files", + "--kb Allow updating key B from inside sector trailers mapped to DESFire files", + "--access-conditions Allow updating the access conditions from inside sector trailers mapped to DESFire files", + "--restore-transfer Enable the RestoreTransfer command for the mapped value blocks" + ], + "usage": "hf mfdes createmfcmapping [-hav] [-n ] [-t ] [-k ] [--kdf ] [-i ] [-m ] [-c ] [--schann ] [--aid ] [--isoid ] [--fid ] [--restore-fid ] [-b [,[,...]]] [--mfc-license ] [--mfc-license-mac ] [--ka] [--kb] [--access-conditions] [--restore-transfer]" + }, "hf mfdes createrecordfile": { "command": "hf mfdes createrecordfile", "description": "Create Linear/Cyclic Record file in the application. Application master key needs to be provided or flag --no-auth set (depend on application settings).", @@ -7118,8 +7211,8 @@ "-v, --verbose Show more output", "-k, --key Key for computing the MAC, must be HEX 16(AES)", "-b, --blk [,[,...]] The MFC blocks to map, must be given in ascending order (use the special value 'all' for all blocks)", - "--key-a Allow updating key A from inside sector trailers mapped to DESFire files", - "--key-b Allow updating key B from inside sector trailers mapped to DESFire files", + "--ka Allow updating key A from inside sector trailers mapped to DESFire files", + "--kb Allow updating key B from inside sector trailers mapped to DESFire files", "--restrict Allow the restriction of data updates by the MFC side", "--map Allow mapping the blocks to DESFire files", "--access-conditions Allow updating the access conditions from inside sector trailers mapped to DESFire files", @@ -7127,7 +7220,7 @@ "--mfc-keys The concatenated MFC sector keys, one (if key B is readable) or two per sector", "-s, --save Save the license and license MAC for the next commands in this session" ], - "usage": "hf mfdes makemfclicense [-hvs] [-k ] [-b [,[,...]]] [--key-a] [--key-b] [--restrict] [--map] [--access-conditions] [-r ] [--mfc-keys ]" + "usage": "hf mfdes makemfclicense [-hvs] [-k ] [-b [,[,...]]] [--ka] [--kb] [--restrict] [--map] [--access-conditions] [-r ] [--mfc-keys ]" }, "hf mfdes pc": { "command": "hf mfdes pc", @@ -14605,8 +14698,8 @@ } }, "metadata": { - "commands_extracted": 825, + "commands_extracted": 829, "extracted_by": "PM3Help2JSON v1.00", - "extracted_on": "2026-05-11T12:35:32" + "extracted_on": "2026-05-21T18:53:46" } } diff --git a/doc/commands.md b/doc/commands.md index 5e3f99a69..78bb03368 100644 --- a/doc/commands.md +++ b/doc/commands.md @@ -297,6 +297,7 @@ Check column "offline" for their availability. |`hf calypso help `|Y |`This help` |`hf calypso info `|N |`Tag information` |`hf calypso dump `|N |`Dump readable files and records` +|`hf calypso probecmdcompat`|N |`Probe SELECT command compatibility` |`hf calypso list `|Y |`List Calypso history` @@ -542,6 +543,7 @@ Check column "offline" for their availability. |`hf legic rdbl `|N |`Read bytes from a LEGIC Prime tag` |`hf legic reader `|N |`LEGIC Prime Reader UID and tag info` |`hf legic restore `|N |`Restore a dump file onto a LEGIC Prime tag` +|`hf legic clone `|N |`Clone a LEGIC Prime dump to a new MCC or tag` |`hf legic wipe `|N |`Wipe a LEGIC Prime tag` |`hf legic wrbl `|N |`Write data to a LEGIC Prime tag` |`hf legic sim `|N |`Start tag simulator` @@ -581,6 +583,7 @@ Check column "offline" for their availability. |`hf mf nested `|N |`Nested attack` |`hf mf hardnested `|Y |`Nested attack for hardened MIFARE Classic cards` |`hf mf staticnested `|N |`Nested attack against static nonce MIFARE Classic cards` +|`hf mf sen `|N |`FM11RF08S Static Encrypted Nonce attack` |`hf mf brute `|N |`Smart bruteforce to exploit weak key generators` |`hf mf autopwn `|N |`Automatic key recovery tool for MIFARE Classic` |`hf mf nack `|N |`Test for MIFARE NACK bug` @@ -755,6 +758,7 @@ Check column "offline" for their availability. |`hf mfdes value `|N |`Operations with value file (get/credit/limited credit/debit/clear)` |`hf mfdes clearrecfile `|N |`Clear record File` |`hf mfdes makemfclicense`|Y |`Generate a Mifare Classic license for DESFire EV3C` +|`hf mfdes createmfcmapping`|N |`Create a Mifare Classic mapping on a DESFire EV3C` |`hf mfdes verifycert `|N |`Validate cert from file and verify key possession` |`hf mfdes intauth `|N |`ISO Internal Authenticate (ECDSA challenge-response)` |`hf mfdes vdesign `|N |`VDE ECDSASign (EV charging signature over 32-byte challenge)` diff --git a/include/pm3_cmd.h b/include/pm3_cmd.h index d75ed5f01..6efe9f339 100644 --- a/include/pm3_cmd.h +++ b/include/pm3_cmd.h @@ -331,7 +331,7 @@ typedef struct { typedef struct { // 64KB SRAM -> 524288 bits(max sample num) < 2^30 -uint32_t samples : + uint32_t samples : LF_SAMPLES_BITS; bool realtime : 1; bool verbose : 1; diff --git a/tools/deprecated-hid-flasher/flasher/flash.c b/tools/deprecated-hid-flasher/flasher/flash.c index 179693d8b..ebef34397 100644 --- a/tools/deprecated-hid-flasher/flasher/flash.c +++ b/tools/deprecated-hid-flasher/flasher/flash.c @@ -71,7 +71,7 @@ static int build_segs_from_phdrs(flash_file_t *ctx, FILE *fd, Elf32_Phdr *phdrs, offset); if (filesz != memsz) { fprintf(stderr, "Error: PHDR file size does not equal memory size\n" - "(DATA+BSS PHDRs do not make sense on ROM platforms!)\n"); + "(DATA+BSS PHDRs do not make sense on ROM platforms!)\n"); return -1; } if (paddr < last_end) {