Files
linux-kernel-module-cheat/userland/arch/x86_64/fchs.S
2019-07-07 00:00:01 +00:00

25 lines
443 B
ArmAsm

/* https://cirosantilli.com/linux-kernel-module-cheat#x86-x87-fpu-instructions */
#include <lkmc.h>
.data
double_1: .double 1.0
double_minus_1: .double -1.0
LKMC_PROLOGUE
/* -(1) == -1 */
fldl double_1
fchs
fldl double_minus_1
fcomip %st(1)
LKMC_ASSERT(je)
finit
/* -(-1) == 1 */
fldl double_minus_1
fchs
fldl double_1
fcomip %st(1)
LKMC_ASSERT(je)
finit
LKMC_EPILOGUE