1 # When trying (and failing) to instrument at the basic block level
2 # I thought up a lot of corner-cases in the rep code. This tries
3 # to catch some of them
5 # Performance counters give us 8207 insns
6 # 11 + 8*1024 + 3 = 8206
10 cld # we want these to happen forward
12 mov $0xfeb131978,%rax # value to store
14 # test back-to-back rep/stosb's
17 mov $buffer1, %rdi # set destination
18 rep stosb # store 1024 times
19 rep stosb # should store 0 times
20 rep stosb # should store 0 times
23 # test stosb where cx is 0
26 mov $buffer1, %rdi # set destination
27 rep stosb # should not load at all
29 # test rep inside of a loop
35 mov $buffer1, %rdi # set destination
39 mov $buffer1, %rdi # set destination
46 #================================
48 #================================
51 xor %rdi,%rdi # we return 0