Welcome to mirror list, hosted at ThFree Co, Russian Federation.

arm_arch_queries.c « utils « windows - github.com/mRemoteNG/PuTTYNG.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b0193276dbdde7e35ac8a350e1a11dcca5d1d6c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
 * Windows implementation of the OS query functions that detect Arm
 * architecture extensions.
 */

#include "putty.h"
#include "ssh.h"

#if !(defined _M_ARM || defined _M_ARM64)
/*
 * For non-Arm, stub out these functions. This module shouldn't be
 * _called_ in that situation anyway, but it will still be compiled
 * (because that's easier than getting CMake to identify the
 * architecture in all cases).
 */
#define IsProcessorFeaturePresent(...) false
#endif

bool platform_aes_neon_available(void)
{
    return IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE);
}

bool platform_pmull_neon_available(void)
{
    return IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE);
}

bool platform_sha256_neon_available(void)
{
    return IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE);
}

bool platform_sha1_neon_available(void)
{
    return IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE);
}

bool platform_sha512_neon_available(void)
{
    /* As of 2020-12-24, as far as I can tell from docs.microsoft.com,
     * Windows on Arm does not yet provide a PF_ARM_V8_* flag for the
     * SHA-512 architecture extension. */
    return false;
}