mirror of
https://github.com/rdolbeau/VexRiscvBPluginGenerator.git
synced 2025-04-18 18:44:42 -04:00
60 lines
1.4 KiB
C
60 lines
1.4 KiB
C
/* ecrypt-machine.h */
|
|
|
|
/*
|
|
* This file is included by 'ecrypt-portable.h'. It allows to override
|
|
* the default macros for specific platforms. Please carefully check
|
|
* the machine code generated by your compiler (with optimisations
|
|
* turned on) before deciding to edit this file.
|
|
*/
|
|
|
|
/* ------------------------------------------------------------------------- */
|
|
|
|
#if (defined(ECRYPT_DEFAULT_ROT) && !defined(ECRYPT_MACHINE_ROT))
|
|
|
|
#define ECRYPT_MACHINE_ROT
|
|
|
|
#if (defined(WIN32) && defined(_MSC_VER))
|
|
|
|
#undef ROTL32
|
|
#undef ROTR32
|
|
#undef ROTL64
|
|
#undef ROTR64
|
|
|
|
#include <stdlib.h>
|
|
|
|
#pragma intrinsic(_lrotl) /* compile rotations "inline" */
|
|
#pragma intrinsic(_lrotr)
|
|
|
|
#define ROTL32(v, n) _lrotl(v, n)
|
|
#define ROTR32(v, n) _lrotr(v, n)
|
|
#define ROTL64(v, n) _rotl64(v, n)
|
|
#define ROTR64(v, n) _rotr64(v, n)
|
|
|
|
#endif
|
|
|
|
#if 0 //def __riscv
|
|
#warning "Hardwiring support for B"
|
|
#include <rvintrin.h>
|
|
#undef ROTL32
|
|
#define ROTL32(v,c) _rv32_rol(v,c)
|
|
#undef ROTR32
|
|
#define ROTR32(v,c) _rv32_ror(v,c)
|
|
#endif
|
|
|
|
#endif
|
|
|
|
/* ------------------------------------------------------------------------- */
|
|
|
|
#if (defined(ECRYPT_DEFAULT_SWAP) && !defined(ECRYPT_MACHINE_SWAP))
|
|
|
|
#define ECRYPT_MACHINE_SWAP
|
|
|
|
#if 0 //def __riscv
|
|
#warning "Hardwiring support for B"
|
|
#include <rvintrin.h>
|
|
#undef SWAP32
|
|
#define SWAP32(v) _rv32_rev8(v) // grev with imm=24
|
|
#endif
|
|
|
|
#endif
|
|
/* ------------------------------------------------------------------------- */
|