File tree Expand file tree Collapse file tree 6 files changed +35
-44
lines changed Expand file tree Collapse file tree 6 files changed +35
-44
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ LKMC_PROLOGUE
1616 mov r0 , 0xFF
1717 tst r0 , 0x0F
1818 LKMC_ASSERT(bne)
19- # r0 was not modified.
19+ / * r0 was not modified. * /
2020 LKMC_ASSERT_EQ(r0 , = 0xFF )
2121
2222LKMC_EPILOGUE
Original file line number Diff line number Diff line change 1- # # bswap
2-
3- # Little endian <=> big endian.
1+ /* https://github.com/cirosantilli/linux-kernel-module-cheat#x86-data-transfer-instructions */
42
53#include <lkmc.h>
64
Original file line number Diff line number Diff line change 11/* https://github.com/cirosantilli/linux-kernel-module-cheat#x86-string-instructions */
22
3- # Compare two arrays
4-
53#include <lkmc.h>
64
75.section .rodata
Original file line number Diff line number Diff line change 88 double_4_0: .double 4.0
99LKMC_PROLOGUE
1010 fldl double_4_0
11- # ST0 = 4.0
11+ /* ST0 = 4.0 */
1212
1313 fldl double_2_5
14- # ST0 = 2.5
15- # ST1 = 4.0
14+ /* ST0 = 2.5
15+ * ST1 = 4.0 */
1616
1717 fldl double_1_0
18- # ST0 = 1.0
19- # ST1 = 2.5
20- # ST2 = 4.0
18+ /* ST0 = 1.0
19+ * ST1 = 2.5
20+ * ST2 = 4.0 */
2121
22- # ST0 = 1 * 2 ^ (RoundTowardZero(2.5))
23- # = 1 * 2 ^ 2
24- # = 4
22+ /* ST0 = 1 * 2 ^ (RoundTowardZero(2.5))
23+ * = 1 * 2 ^ 2
24+ * = 4 */
2525 fscale
26- # ST0 = 4.0
27- # ST1 = 2.5
28- # ST2 = 4.0
26+ /* ST0 = 4.0
27+ * ST1 = 2.5
28+ * ST2 = 4.0 */
2929
3030 fcomip %st (2 )
31- # ST0 = 4.0
32- # ST1 = 2.5
31+ /* ST0 = 4.0
32+ * ST1 = 2.5 */
3333 LKMC_ASSERT(je )
3434LKMC_EPILOGUE
Original file line number Diff line number Diff line change 77 double_1_0: .double 1.0
88LKMC_PROLOGUE
99 fldz
10- # ST0 = 0.0
10+ /* ST0 = 0.0 */
1111
1212 fld1
13- # ST0 = 1.0
14- # ST1 = 0.0
13+ /* ST0 = 1.0
14+ * ST1 = 0.0 */
1515
16- # Swap ST0 and ST1.
16+ /* Swap ST0 and ST1. */
1717 fxch %st (1 )
18- # ST0 = 0.0
19- # ST1 = 1.0
18+ /* ST0 = 0.0
19+ * ST1 = 1.0 */
2020
2121 fldz
22- # ST0 = 0.0
23- # ST1 = 0.0
24- # ST2 = 1.0
22+ /* ST0 = 0.0
23+ * ST1 = 0.0
24+ * ST2 = 1.0 */
2525
2626 fcomip %st (1 )
27- # ST0 = 0.0
28- # ST1 = 1.0
27+ /* ST0 = 0.0
28+ * ST1 = 1.0 */
2929 LKMC_ASSERT(je )
3030
31- # Swap ST0 and ST1.
31+ /* Swap ST0 and ST1. */
3232 fxch %st (1 )
33- # ST0 = 1.0
34- # ST1 = 0.0
33+ /* ST0 = 1.0
34+ * ST1 = 0.0 */
3535
3636 fld1
37- # ST0 = 1.0
38- # ST1 = 1.0
39- # ST2 = 0.0
37+ /* ST0 = 1.0
38+ * ST1 = 1.0
39+ * ST2 = 0.0 */
4040
4141 fcomip %st (1 )
42- # ST0 = 1.0
43- # ST1 = 0.0
42+ /* ST0 = 1.0
43+ * ST1 = 0.0 */
4444 LKMC_ASSERT(je )
4545LKMC_EPILOGUE
Original file line number Diff line number Diff line change 11/* https://github.com/cirosantilli/linux-kernel-module-cheat#x86-string-instructions */
2- # # movs
3-
4- # Copy one string into another.
5-
6- # Input pointed by esi, output by edi.
72
83#include <lkmc.h>
94
You can’t perform that action at this time.
0 commit comments