diff --git a/README.adoc b/README.adoc index b83fc17..87d1470 100644 --- a/README.adoc +++ b/README.adoc @@ -11756,6 +11756,9 @@ The first examples you should look into are: ** <> ** <> * registers: <> +* SIMD +** <> +** <> The add examples in particular: @@ -12320,6 +12323,15 @@ Bibliography: * <> 3.7.5 "Specifying an Offset" * https://sourceware.org/binutils/docs-2.18/as/i386_002dMemory.html +=== x86 binary arithmetic instructions + +<> 5.1.2 "Binary Arithmetic Instructions": + +* link:userland/arch/x86_64/add.S[ADD] +* link:userland/arch/x86_64/dec.S[DEC] +* link:userland/arch/x86_64/inc.S[INC] +* link:userland/arch/x86_64/sub.S[SUB] + === x86 SIMD History: @@ -12411,12 +12423,12 @@ Userland basics: http://web.archive.org/web/20190606075544/https://software.inte Instruction list: http://web.archive.org/web/20190606075330/https://software.intel.com/sites/default/files/managed/a4/60/325383-sdm-vol-2abcd.pdf [[intel-manual-3]] -====== Intel 64 and IA-32 Architectures Software Developer's Manuals Volume 2 +====== Intel 64 and IA-32 Architectures Software Developer's Manuals Volume 3 Kernel land: http://web.archive.org/web/20190606075534/https://software.intel.com/sites/default/files/managed/a4/60/325384-sdm-vol-3abcd.pdf [[intel-manual-4]] -====== Intel 64 and IA-32 Architectures Software Developer's Manuals Volume 2 +====== Intel 64 and IA-32 Architectures Software Developer's Manuals Volume 4 Model specific extensions: http://web.archive.org/web/20190606075325/https://software.intel.com/sites/default/files/managed/22/0d/335592-sdm-vol-4.pdf diff --git a/userland/arch/x86_64/dec.S b/userland/arch/x86_64/dec.S new file mode 100644 index 0000000..5d0e277 --- /dev/null +++ b/userland/arch/x86_64/dec.S @@ -0,0 +1,9 @@ +/* Decrement: i--. */ + +#include + +LKMC_PROLOGUE + mov $3, %rax + dec %rax + LKMC_ASSERT_EQ_32(%rax, $2) +LKMC_EPILOGUE diff --git a/userland/arch/x86_64/inc.S b/userland/arch/x86_64/inc.S new file mode 100644 index 0000000..263ef16 --- /dev/null +++ b/userland/arch/x86_64/inc.S @@ -0,0 +1,9 @@ +/* Increment: i++. */ + +#include + +LKMC_PROLOGUE + mov $2, %eax + inc %eax + LKMC_ASSERT_EQ_32(%eax, $3) +LKMC_EPILOGUE diff --git a/userland/arch/x86_64/sub.S b/userland/arch/x86_64/sub.S new file mode 100644 index 0000000..16996ca --- /dev/null +++ b/userland/arch/x86_64/sub.S @@ -0,0 +1,9 @@ +/* Subtraction. */ + +#include + +LKMC_PROLOGUE + mov $3, %rax + sub $2, %rax + LKMC_ASSERT_EQ(%rax, $1) +LKMC_EPILOGUE