/* Henry Wong Microbenchmarking Return Address Branch Prediction http://blog.stuffedcow.net/2018/04/ras-microbenchmarks/ 2018-03-31 Tests to probe the return address stack branch predictor (Also known by various other names: RAS, RSB, return stack) This code makes heavy use of R"( raw string literals )" (new in C++11, non-standard for C). Make sure the compiler supports it (gcc seems to support it without extra flags). This code must be compiled for 32-bit x86 (too much inline assembly I didn't want to write twice). Compile with -m32 on a 64-bit system. gcc -O2 -m32 ret.c -o ret AMD K8/K10: Do not place ret instructions at even addresses that are not divisible by 16. There are no branch indicator bits there. Also, do not have more than three branches in any aligned 16-byte block. Via Nano U3500: It seems to learn whether to use the RAS or BTB depending on accuracy. A variant of the test that shares a single static return instruction (by jmping to it) is used for the Nano, so that using the BTB will mispredict. */ #include #include #include // for mprotect #ifndef AMT #define AMT 0 // How many extra addresses to push (AMT > 0) or pop off (AMT < 0) at the deepest point of the call stack. #endif #ifndef BTBMISS #define BTBMISS 0 // Whether to use a return or an indirect branch for the final return (deepest return of the call stark). #endif // Disable compiling some of the code because it takes very long to compile. #define SPECCLOBBER 0 inline uint64_t rdtsc() { uint32_t lo, hi; __asm__ volatile (".byte 0x0f, 0x31" : "=a" (lo), "=d" (hi)); return (uint64_t)(((uint64_t)hi)<<32LL) | (uint64_t) lo; } void f_ret(); // Function with a ret asm(R"( .align 16 f_ret: ret )"); void f_nopret(); // Function with some nops followed by ret asm(R"( .align 16 f_nopret: nop nop nop ret )"); void f_add0(); // Adds 0 to the return address on the stack, then ret asm(R"( .align 16 f_add0: addl $0, (%esp) ret )"); void f_add1(); // Adds 1 to the return address on the stack, then ret asm(R"( .align 16 f_add1: addl $1, (%esp) ret )"); void f_jmp(); // Uses an indirect branch instead of a ret asm(R"( .align 16 f_jmp: pop %eax jmp *%eax )"); // The body of the test function. Runs 16K copies of FRAG in a partially-unrolled loop. // Don't use eax as the loop counter because one of the FRAGs (f_jmp) clobbers eax. #define L1 (16) #define L2 (512) #define COMMA , #define T_BODY(NAME,FRAG) T_BODY_IC(NAME,FRAG, , "eax" COMMA "edx") #define T_BODY_IC(NAME,FRAG,INPUTS,CLOBBER) do { \ uint64_t st, et, m=-1LL, mx=0, s=0; \ for (int j=(L1)+4;--j;) { \ asm("call pf_ras_clobber1;"); \ st = rdtsc(); \ for (int i=(L2);i--;) { \ asm( \ FRAG \ FRAG \ FRAG \ FRAG \ FRAG \ FRAG \ FRAG \ FRAG \ FRAG \ FRAG \ FRAG \ FRAG \ FRAG \ FRAG \ FRAG \ FRAG \ : :INPUTS : CLOBBER); \ } \ et = rdtsc(); \ if (j>(L1)) continue; \ m = m > et-st ? et-st : m; \ mx = mx < et-st ? et-st : mx; \ s += et-st; \ } \ printf("%s, %.2f, %.2f, %.2f, %.2f\n", NAME, m/(L2*16.0), mx/(L2*16.0), s/(L1*L2*16.0), s/(L1*L2*16.0)); } while(0) // min , max , average , average void t_call_ret() { T_BODY("call; ret", "call f_ret\n"); } void t_call_nopret() { T_BODY("call; nop-ret", "call f_nopret\n"); } void t_call_add0() { T_BODY("call; +0 ret", "call f_add0\nnop\n"); } void t_call_add1() { T_BODY("call; +1 ret", "call f_add1\nnop\n"); } void t_jmp_ret() { T_BODY("jmp; ret", "push $1f\njmp f_ret\n1: "); } void t_call_jmp() { T_BODY("call; jmp", "call f_jmp\n"); } void t_jmp_jmp() { T_BODY("jmp; jmp", "push $1f\njmp f_jmp\n1: \n"); } void t_call4_ret() { T_BODY("4x call; ret", "call f_ret; call f_ret; call f_ret; call f_ret\n"); } void t_call4_nopret() { T_BODY("4x call; nop-ret", "call f_nopret; call f_nopret; call f_nopret; call f_nopret\n"); } void t_call4_add0() { T_BODY("4x call; +0 ret", "call f_add0; nop; call f_add0; nop; call f_add0; nop; call f_add0; nop\n"); } void t_call4_add1() { T_BODY("4x call; +1 ret", "call f_add1; nop; call f_add1; nop; call f_add1; nop; call f_add1; nop\n"); } void t_jmp4_ret() { T_BODY("4x jmp; ret", "push $1f; jmp f_ret; 1: push $1f; jmp f_ret; 1: push $1f; jmp f_ret; 1: push $1f; jmp f_ret; 1: \n"); } void t_call4_jmp() { T_BODY("4x call; jmp", "call f_jmp; call f_jmp; call f_jmp; call f_jmp\n"); } void t_jmp4_jmp() { T_BODY("4x jmp; jmp", "push $1f; jmp f_jmp; 1: push $1f; jmp f_jmp; 1: push $1f; jmp f_jmp; 1: push $1f; jmp f_jmp; 1: \n"); } void *calibrate_pointer = &calibrate_pointer; void calibrate_timer() // L1 loads take a small integer number of CPU clock cycles. Use it to sanity-check or calibrate the rdtsc timer. { T_BODY_IC("L1 load", "mov (%%eax), %%eax\n", "a"(calibrate_pointer), ); } asm(R"( .align 16; nop; ras_depth_1: ret .align 16; ras_depth_2: call ras_depth_1 ; ret .align 16; ras_depth_3: call ras_depth_2 ; ret .align 16; ras_depth_4: call ras_depth_3 ; ret .align 16; ras_depth_5: call ras_depth_4 ; ret .align 16; ras_depth_6: call ras_depth_5 ; ret .align 16; ras_depth_7: call ras_depth_6 ; ret .align 16; ras_depth_8: call ras_depth_7 ; ret .align 16; ras_depth_9: call ras_depth_8 ; ret .align 16; ras_depth_10: call ras_depth_9 ; ret .align 16; ras_depth_11: call ras_depth_10 ; ret .align 16; ras_depth_12: call ras_depth_11 ; ret .align 16; ras_depth_13: call ras_depth_12 ; ret .align 16; ras_depth_14: call ras_depth_13 ; ret .align 16; ras_depth_15: call ras_depth_14 ; ret .align 16; ras_depth_16: call ras_depth_15 ; ret .align 16; ras_depth_17: call ras_depth_16 ; ret .align 16; ras_depth_18: call ras_depth_17 ; ret .align 16; ras_depth_19: call ras_depth_18 ; ret .align 16; ras_depth_20: call ras_depth_19 ; ret .align 16; ras_depth_21: call ras_depth_20 ; ret .align 16; ras_depth_22: call ras_depth_21 ; ret .align 16; ras_depth_23: call ras_depth_22 ; ret .align 16; ras_depth_24: call ras_depth_23 ; ret .align 16; ras_depth_25: call ras_depth_24 ; ret .align 16; ras_depth_26: call ras_depth_25 ; ret .align 16; ras_depth_27: call ras_depth_26 ; ret .align 16; ras_depth_28: call ras_depth_27 ; ret .align 16; ras_depth_29: call ras_depth_28 ; ret .align 16; ras_depth_30: call ras_depth_29 ; ret .align 16; ras_depth_31: call ras_depth_30 ; ret .align 16; ras_depth_32: call ras_depth_31 ; ret .align 16; ras_depth_33: call ras_depth_32 ; ret .align 16; ras_depth_34: call ras_depth_33 ; ret .align 16; ras_depth_35: call ras_depth_34 ; ret .align 16; ras_depth_36: call ras_depth_35 ; ret .align 16; ras_depth_37: call ras_depth_36 ; ret .align 16; ras_depth_38: call ras_depth_37 ; ret .align 16; ras_depth_39: call ras_depth_38 ; ret )"); asm(R"( .align 16; ras_depth_nano_1: ret .align 16; ras_depth_nano_2: call ras_depth_nano_1 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_3: call ras_depth_nano_2 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_4: call ras_depth_nano_3 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_5: call ras_depth_nano_4 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_6: call ras_depth_nano_5 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_7: call ras_depth_nano_6 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_8: call ras_depth_nano_7 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_9: call ras_depth_nano_8 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_10: call ras_depth_nano_9 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_11: call ras_depth_nano_10 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_12: call ras_depth_nano_11 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_13: call ras_depth_nano_12 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_14: call ras_depth_nano_13 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_15: call ras_depth_nano_14 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_16: call ras_depth_nano_15 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_17: call ras_depth_nano_16 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_18: call ras_depth_nano_17 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_19: call ras_depth_nano_18 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_20: call ras_depth_nano_19 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_21: call ras_depth_nano_20 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_22: call ras_depth_nano_21 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_23: call ras_depth_nano_22 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_24: call ras_depth_nano_23 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_25: call ras_depth_nano_24 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_26: call ras_depth_nano_25 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_27: call ras_depth_nano_26 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_28: call ras_depth_nano_27 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_29: call ras_depth_nano_28 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_30: call ras_depth_nano_29 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_31: call ras_depth_nano_30 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_32: call ras_depth_nano_31 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_33: call ras_depth_nano_32 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_34: call ras_depth_nano_33 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_35: call ras_depth_nano_34 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_36: call ras_depth_nano_35 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_37: call ras_depth_nano_36 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_38: call ras_depth_nano_37 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano_39: call ras_depth_nano_38 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_2: call ras_depth_nano_1 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_3: call ras_depth_nano2_2 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_4: call ras_depth_nano2_3 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_5: call ras_depth_nano2_4 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_6: call ras_depth_nano2_5 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_7: call ras_depth_nano2_6 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_8: call ras_depth_nano2_7 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_9: call ras_depth_nano2_8 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_10: call ras_depth_nano2_9 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_11: call ras_depth_nano2_10 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_12: call ras_depth_nano2_11 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_13: call ras_depth_nano2_12 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_14: call ras_depth_nano2_13 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_15: call ras_depth_nano2_14 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_16: call ras_depth_nano2_15 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_17: call ras_depth_nano2_16 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_18: call ras_depth_nano2_17 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_19: call ras_depth_nano2_18 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_20: call ras_depth_nano2_19 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_21: call ras_depth_nano2_20 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_22: call ras_depth_nano2_21 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_23: call ras_depth_nano2_22 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_24: call ras_depth_nano2_23 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_25: call ras_depth_nano2_24 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_26: call ras_depth_nano2_25 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_27: call ras_depth_nano2_26 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_28: call ras_depth_nano2_27 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_29: call ras_depth_nano2_28 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_30: call ras_depth_nano2_29 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_31: call ras_depth_nano2_30 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_32: call ras_depth_nano2_31 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_33: call ras_depth_nano2_32 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_34: call ras_depth_nano2_33 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_35: call ras_depth_nano2_34 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_36: call ras_depth_nano2_35 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_37: call ras_depth_nano2_36 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_38: call ras_depth_nano2_37 ; jmp ras_depth_nano_1 .align 16; ras_depth_nano2_39: call ras_depth_nano2_38 ; jmp ras_depth_nano_1)"); asm(R"( .align 16; ras_depth_mp_1: add $1, (%esp); ret .align 16; nop; ras_depth_mp_2: call ras_depth_mp_1 ; ret; ret .align 16; ras_depth_mp_3: call ras_depth_mp_2 ; ret .align 16; ras_depth_mp_4: call ras_depth_mp_3 ; ret .align 16; ras_depth_mp_5: call ras_depth_mp_4 ; ret .align 16; ras_depth_mp_6: call ras_depth_mp_5 ; ret .align 16; ras_depth_mp_7: call ras_depth_mp_6 ; ret .align 16; ras_depth_mp_8: call ras_depth_mp_7 ; ret .align 16; ras_depth_mp_9: call ras_depth_mp_8 ; ret .align 16; ras_depth_mp_10: call ras_depth_mp_9 ; ret .align 16; ras_depth_mp_11: call ras_depth_mp_10 ; ret .align 16; ras_depth_mp_12: call ras_depth_mp_11 ; ret .align 16; ras_depth_mp_13: call ras_depth_mp_12 ; ret .align 16; ras_depth_mp_14: call ras_depth_mp_13 ; ret .align 16; ras_depth_mp_15: call ras_depth_mp_14 ; ret .align 16; ras_depth_mp_16: call ras_depth_mp_15 ; ret .align 16; ras_depth_mp_17: call ras_depth_mp_16 ; ret .align 16; ras_depth_mp_18: call ras_depth_mp_17 ; ret .align 16; ras_depth_mp_19: call ras_depth_mp_18 ; ret .align 16; ras_depth_mp_20: call ras_depth_mp_19 ; ret .align 16; ras_depth_mp_21: call ras_depth_mp_20 ; ret .align 16; ras_depth_mp_22: call ras_depth_mp_21 ; ret .align 16; ras_depth_mp_23: call ras_depth_mp_22 ; ret .align 16; ras_depth_mp_24: call ras_depth_mp_23 ; ret .align 16; ras_depth_mp_25: call ras_depth_mp_24 ; ret .align 16; ras_depth_mp_26: call ras_depth_mp_25 ; ret .align 16; ras_depth_mp_27: call ras_depth_mp_26 ; ret .align 16; ras_depth_mp_28: call ras_depth_mp_27 ; ret .align 16; ras_depth_mp_29: call ras_depth_mp_28 ; ret .align 16; ras_depth_mp_30: call ras_depth_mp_29 ; ret .align 16; ras_depth_mp_31: call ras_depth_mp_30 ; ret .align 16; ras_depth_mp_32: call ras_depth_mp_31 ; ret .align 16; ras_depth_mp_33: call ras_depth_mp_32 ; ret .align 16; ras_depth_mp_34: call ras_depth_mp_33 ; ret .align 16; ras_depth_mp_35: call ras_depth_mp_34 ; ret .align 16; ras_depth_mp_36: call ras_depth_mp_35 ; ret .align 16; ras_depth_mp_37: call ras_depth_mp_36 ; ret .align 16; ras_depth_mp_38: call ras_depth_mp_37 ; ret .align 16; ras_depth_mp_39: call ras_depth_mp_38 ; ret )"); asm(R"( .align 16; ras_depth_ma_1: pop %eax; jmp *%eax .align 16; ras_depth_ma_2: call ras_depth_ma_1 ; ret; ret .align 16; ras_depth_ma_3: call ras_depth_ma_2 ; ret .align 16; ras_depth_ma_4: call ras_depth_ma_3 ; ret .align 16; ras_depth_ma_5: call ras_depth_ma_4 ; ret .align 16; ras_depth_ma_6: call ras_depth_ma_5 ; ret .align 16; ras_depth_ma_7: call ras_depth_ma_6 ; ret .align 16; ras_depth_ma_8: call ras_depth_ma_7 ; ret .align 16; ras_depth_ma_9: call ras_depth_ma_8 ; ret .align 16; ras_depth_ma_10: call ras_depth_ma_9 ; ret .align 16; ras_depth_ma_11: call ras_depth_ma_10 ; ret .align 16; ras_depth_ma_12: call ras_depth_ma_11 ; ret .align 16; ras_depth_ma_13: call ras_depth_ma_12 ; ret .align 16; ras_depth_ma_14: call ras_depth_ma_13 ; ret .align 16; ras_depth_ma_15: call ras_depth_ma_14 ; ret .align 16; ras_depth_ma_16: call ras_depth_ma_15 ; ret .align 16; ras_depth_ma_17: call ras_depth_ma_16 ; ret .align 16; ras_depth_ma_18: call ras_depth_ma_17 ; ret .align 16; ras_depth_ma_19: call ras_depth_ma_18 ; ret .align 16; ras_depth_ma_20: call ras_depth_ma_19 ; ret .align 16; ras_depth_ma_21: call ras_depth_ma_20 ; ret .align 16; ras_depth_ma_22: call ras_depth_ma_21 ; ret .align 16; ras_depth_ma_23: call ras_depth_ma_22 ; ret .align 16; ras_depth_ma_24: call ras_depth_ma_23 ; ret .align 16; ras_depth_ma_25: call ras_depth_ma_24 ; ret .align 16; ras_depth_ma_26: call ras_depth_ma_25 ; ret .align 16; ras_depth_ma_27: call ras_depth_ma_26 ; ret .align 16; ras_depth_ma_28: call ras_depth_ma_27 ; ret .align 16; ras_depth_ma_29: call ras_depth_ma_28 ; ret .align 16; ras_depth_ma_30: call ras_depth_ma_29 ; ret .align 16; ras_depth_ma_31: call ras_depth_ma_30 ; ret .align 16; ras_depth_ma_32: call ras_depth_ma_31 ; ret .align 16; ras_depth_ma_33: call ras_depth_ma_32 ; ret .align 16; ras_depth_ma_34: call ras_depth_ma_33 ; ret .align 16; ras_depth_ma_35: call ras_depth_ma_34 ; ret .align 16; ras_depth_ma_36: call ras_depth_ma_35 ; ret .align 16; ras_depth_ma_37: call ras_depth_ma_36 ; ret .align 16; ras_depth_ma_38: call ras_depth_ma_37 ; ret .align 16; ras_depth_ma_39: call ras_depth_ma_38 ; ret )"); // ras_depth_mp and ras_depth_ma with just one return, for Via Nano asm(R"( .align 16; ras_depth_mp_nano_1: add $1, (%esp); ras_depth_mp_nano_1_ret: ret .align 16; ras_depth_mp_nano_2: call ras_depth_mp_nano_1 ; ret; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_3: call ras_depth_mp_nano_2 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_4: call ras_depth_mp_nano_3 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_5: call ras_depth_mp_nano_4 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_6: call ras_depth_mp_nano_5 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_7: call ras_depth_mp_nano_6 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_8: call ras_depth_mp_nano_7 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_9: call ras_depth_mp_nano_8 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_10: call ras_depth_mp_nano_9 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_11: call ras_depth_mp_nano_10 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_12: call ras_depth_mp_nano_11 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_13: call ras_depth_mp_nano_12 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_14: call ras_depth_mp_nano_13 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_15: call ras_depth_mp_nano_14 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_16: call ras_depth_mp_nano_15 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_17: call ras_depth_mp_nano_16 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_18: call ras_depth_mp_nano_17 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_19: call ras_depth_mp_nano_18 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_20: call ras_depth_mp_nano_19 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_21: call ras_depth_mp_nano_20 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_22: call ras_depth_mp_nano_21 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_23: call ras_depth_mp_nano_22 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_24: call ras_depth_mp_nano_23 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_25: call ras_depth_mp_nano_24 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_26: call ras_depth_mp_nano_25 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_27: call ras_depth_mp_nano_26 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_28: call ras_depth_mp_nano_27 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_29: call ras_depth_mp_nano_28 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_30: call ras_depth_mp_nano_29 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_31: call ras_depth_mp_nano_30 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_32: call ras_depth_mp_nano_31 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_33: call ras_depth_mp_nano_32 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_34: call ras_depth_mp_nano_33 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_35: call ras_depth_mp_nano_34 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_36: call ras_depth_mp_nano_35 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_37: call ras_depth_mp_nano_36 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_38: call ras_depth_mp_nano_37 ; jmp ras_depth_mp_nano_1_ret .align 16; ras_depth_mp_nano_39: call ras_depth_mp_nano_38 ; jmp ras_depth_mp_nano_1_ret )"); asm(R"( .align 16; ras_depth_ma_nano_1: pop %eax; jmp *%eax ; ras_depth_ma_nano_1_ret: ret .align 16; ras_depth_ma_nano_2: call ras_depth_ma_nano_1 ; ret; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_3: call ras_depth_ma_nano_2 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_4: call ras_depth_ma_nano_3 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_5: call ras_depth_ma_nano_4 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_6: call ras_depth_ma_nano_5 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_7: call ras_depth_ma_nano_6 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_8: call ras_depth_ma_nano_7 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_9: call ras_depth_ma_nano_8 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_10: call ras_depth_ma_nano_9 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_11: call ras_depth_ma_nano_10 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_12: call ras_depth_ma_nano_11 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_13: call ras_depth_ma_nano_12 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_14: call ras_depth_ma_nano_13 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_15: call ras_depth_ma_nano_14 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_16: call ras_depth_ma_nano_15 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_17: call ras_depth_ma_nano_16 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_18: call ras_depth_ma_nano_17 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_19: call ras_depth_ma_nano_18 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_20: call ras_depth_ma_nano_19 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_21: call ras_depth_ma_nano_20 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_22: call ras_depth_ma_nano_21 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_23: call ras_depth_ma_nano_22 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_24: call ras_depth_ma_nano_23 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_25: call ras_depth_ma_nano_24 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_26: call ras_depth_ma_nano_25 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_27: call ras_depth_ma_nano_26 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_28: call ras_depth_ma_nano_27 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_29: call ras_depth_ma_nano_28 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_30: call ras_depth_ma_nano_29 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_31: call ras_depth_ma_nano_30 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_32: call ras_depth_ma_nano_31 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_33: call ras_depth_ma_nano_32 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_34: call ras_depth_ma_nano_33 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_35: call ras_depth_ma_nano_34 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_36: call ras_depth_ma_nano_35 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_37: call ras_depth_ma_nano_36 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_38: call ras_depth_ma_nano_37 ; jmp ras_depth_ma_nano_1_ret .align 16; ras_depth_ma_nano_39: call ras_depth_ma_nano_38 ; jmp ras_depth_ma_nano_1_ret )"); // Test whether call 0 is treated as a call (Properly matched if call +0 is treated as a call) asm(R"( .align 16; ras_depth_call0_2: call 1f; 1: ret .align 16; ras_depth_call0_3: call ras_depth_call0_2 ; ret .align 16; ras_depth_call0_4: call ras_depth_call0_3 ; ret .align 16; ras_depth_call0_5: call ras_depth_call0_4 ; ret .align 16; ras_depth_call0_6: call ras_depth_call0_5 ; ret .align 16; ras_depth_call0_7: call ras_depth_call0_6 ; ret .align 16; ras_depth_call0_8: call ras_depth_call0_7 ; ret .align 16; ras_depth_call0_9: call ras_depth_call0_8 ; ret .align 16; ras_depth_call0_10: call ras_depth_call0_9 ; ret .align 16; ras_depth_call0_11: call ras_depth_call0_10 ; ret .align 16; ras_depth_call0_12: call ras_depth_call0_11 ; ret .align 16; ras_depth_call0_13: call ras_depth_call0_12 ; ret .align 16; ras_depth_call0_14: call ras_depth_call0_13 ; ret .align 16; ras_depth_call0_15: call ras_depth_call0_14 ; ret .align 16; ras_depth_call0_16: call ras_depth_call0_15 ; ret .align 16; ras_depth_call0_17: call ras_depth_call0_16 ; ret .align 16; ras_depth_call0_18: call ras_depth_call0_17 ; ret .align 16; ras_depth_call0_19: call ras_depth_call0_18 ; ret .align 16; ras_depth_call0_20: call ras_depth_call0_19 ; ret .align 16; ras_depth_call0_21: call ras_depth_call0_20 ; ret .align 16; ras_depth_call0_22: call ras_depth_call0_21 ; ret .align 16; ras_depth_call0_23: call ras_depth_call0_22 ; ret .align 16; ras_depth_call0_24: call ras_depth_call0_23 ; ret .align 16; ras_depth_call0_25: call ras_depth_call0_24 ; ret .align 16; ras_depth_call0_26: call ras_depth_call0_25 ; ret .align 16; ras_depth_call0_27: call ras_depth_call0_26 ; ret .align 16; ras_depth_call0_28: call ras_depth_call0_27 ; ret .align 16; ras_depth_call0_29: call ras_depth_call0_28 ; ret .align 16; ras_depth_call0_30: call ras_depth_call0_29 ; ret .align 16; ras_depth_call0_31: call ras_depth_call0_30 ; ret .align 16; ras_depth_call0_32: call ras_depth_call0_31 ; ret .align 16; ras_depth_call0_33: call ras_depth_call0_32 ; ret .align 16; ras_depth_call0_34: call ras_depth_call0_33 ; ret .align 16; ras_depth_call0_35: call ras_depth_call0_34 ; ret .align 16; ras_depth_call0_36: call ras_depth_call0_35 ; ret .align 16; ras_depth_call0_37: call ras_depth_call0_36 ; ret .align 16; ras_depth_call0_38: call ras_depth_call0_37 ; ret .align 16; ras_depth_call0_39: call ras_depth_call0_38 ; ret )"); // Test whether call 0 is treated as a call (Properly matched if call +0 is not treated as a call) asm(R"( .align 16; nop; ras_depth_call0b_2: call 1f ; 1: pop %eax; ret .align 16; ras_depth_call0b_3: call ras_depth_call0b_2 ; ret .align 16; ras_depth_call0b_4: call ras_depth_call0b_3 ; ret .align 16; ras_depth_call0b_5: call ras_depth_call0b_4 ; ret .align 16; ras_depth_call0b_6: call ras_depth_call0b_5 ; ret .align 16; ras_depth_call0b_7: call ras_depth_call0b_6 ; ret .align 16; ras_depth_call0b_8: call ras_depth_call0b_7 ; ret .align 16; ras_depth_call0b_9: call ras_depth_call0b_8 ; ret .align 16; ras_depth_call0b_10: call ras_depth_call0b_9 ; ret .align 16; ras_depth_call0b_11: call ras_depth_call0b_10 ; ret .align 16; ras_depth_call0b_12: call ras_depth_call0b_11 ; ret .align 16; ras_depth_call0b_13: call ras_depth_call0b_12 ; ret .align 16; ras_depth_call0b_14: call ras_depth_call0b_13 ; ret .align 16; ras_depth_call0b_15: call ras_depth_call0b_14 ; ret .align 16; ras_depth_call0b_16: call ras_depth_call0b_15 ; ret .align 16; ras_depth_call0b_17: call ras_depth_call0b_16 ; ret .align 16; ras_depth_call0b_18: call ras_depth_call0b_17 ; ret .align 16; ras_depth_call0b_19: call ras_depth_call0b_18 ; ret .align 16; ras_depth_call0b_20: call ras_depth_call0b_19 ; ret .align 16; ras_depth_call0b_21: call ras_depth_call0b_20 ; ret .align 16; ras_depth_call0b_22: call ras_depth_call0b_21 ; ret .align 16; ras_depth_call0b_23: call ras_depth_call0b_22 ; ret .align 16; ras_depth_call0b_24: call ras_depth_call0b_23 ; ret .align 16; ras_depth_call0b_25: call ras_depth_call0b_24 ; ret .align 16; ras_depth_call0b_26: call ras_depth_call0b_25 ; ret .align 16; ras_depth_call0b_27: call ras_depth_call0b_26 ; ret .align 16; ras_depth_call0b_28: call ras_depth_call0b_27 ; ret .align 16; ras_depth_call0b_29: call ras_depth_call0b_28 ; ret .align 16; ras_depth_call0b_30: call ras_depth_call0b_29 ; ret .align 16; ras_depth_call0b_31: call ras_depth_call0b_30 ; ret .align 16; ras_depth_call0b_32: call ras_depth_call0b_31 ; ret .align 16; ras_depth_call0b_33: call ras_depth_call0b_32 ; ret .align 16; ras_depth_call0b_34: call ras_depth_call0b_33 ; ret .align 16; ras_depth_call0b_35: call ras_depth_call0b_34 ; ret .align 16; ras_depth_call0b_36: call ras_depth_call0b_35 ; ret .align 16; ras_depth_call0b_37: call ras_depth_call0b_36 ; ret .align 16; ras_depth_call0b_38: call ras_depth_call0b_37 ; ret .align 16; ras_depth_call0b_39: call ras_depth_call0b_38 ; ret )"); // Test whether call 0 is treated as a call (Properly matched if call +0 is treated as a call), Via Nano variant asm(R"( .align 16; ras_depth_call0_nano_2: call 1f; 1: ; ras_depth_call0_nano_1: ret .align 16; ras_depth_call0_nano_3: call ras_depth_call0_nano_2 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_4: call ras_depth_call0_nano_3 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_5: call ras_depth_call0_nano_4 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_6: call ras_depth_call0_nano_5 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_7: call ras_depth_call0_nano_6 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_8: call ras_depth_call0_nano_7 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_9: call ras_depth_call0_nano_8 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_10: call ras_depth_call0_nano_9 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_11: call ras_depth_call0_nano_10 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_12: call ras_depth_call0_nano_11 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_13: call ras_depth_call0_nano_12 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_14: call ras_depth_call0_nano_13 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_15: call ras_depth_call0_nano_14 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_16: call ras_depth_call0_nano_15 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_17: call ras_depth_call0_nano_16 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_18: call ras_depth_call0_nano_17 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_19: call ras_depth_call0_nano_18 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_20: call ras_depth_call0_nano_19 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_21: call ras_depth_call0_nano_20 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_22: call ras_depth_call0_nano_21 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_23: call ras_depth_call0_nano_22 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_24: call ras_depth_call0_nano_23 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_25: call ras_depth_call0_nano_24 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_26: call ras_depth_call0_nano_25 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_27: call ras_depth_call0_nano_26 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_28: call ras_depth_call0_nano_27 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_29: call ras_depth_call0_nano_28 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_30: call ras_depth_call0_nano_29 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_31: call ras_depth_call0_nano_30 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_32: call ras_depth_call0_nano_31 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_33: call ras_depth_call0_nano_32 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_34: call ras_depth_call0_nano_33 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_35: call ras_depth_call0_nano_34 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_36: call ras_depth_call0_nano_35 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_37: call ras_depth_call0_nano_36 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_38: call ras_depth_call0_nano_37 ; jmp ras_depth_call0_nano_1 .align 16; ras_depth_call0_nano_39: call ras_depth_call0_nano_38 ; jmp ras_depth_call0_nano_1 )"); // Test whether call 0 is treated as a call (Properly matched if call +0 is not treated as a call), Via Nano variant asm(R"( .align 16; ras_depth_call0b_nano_2: call 1f ; 1: pop %eax; ras_depth_call0b_nano_1: ret .align 16; ras_depth_call0b_nano_3: call ras_depth_call0b_nano_2 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_4: call ras_depth_call0b_nano_3 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_5: call ras_depth_call0b_nano_4 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_6: call ras_depth_call0b_nano_5 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_7: call ras_depth_call0b_nano_6 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_8: call ras_depth_call0b_nano_7 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_9: call ras_depth_call0b_nano_8 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_10: call ras_depth_call0b_nano_9 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_11: call ras_depth_call0b_nano_10 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_12: call ras_depth_call0b_nano_11 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_13: call ras_depth_call0b_nano_12 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_14: call ras_depth_call0b_nano_13 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_15: call ras_depth_call0b_nano_14 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_16: call ras_depth_call0b_nano_15 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_17: call ras_depth_call0b_nano_16 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_18: call ras_depth_call0b_nano_17 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_19: call ras_depth_call0b_nano_18 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_20: call ras_depth_call0b_nano_19 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_21: call ras_depth_call0b_nano_20 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_22: call ras_depth_call0b_nano_21 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_23: call ras_depth_call0b_nano_22 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_24: call ras_depth_call0b_nano_23 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_25: call ras_depth_call0b_nano_24 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_26: call ras_depth_call0b_nano_25 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_27: call ras_depth_call0b_nano_26 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_28: call ras_depth_call0b_nano_27 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_29: call ras_depth_call0b_nano_28 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_30: call ras_depth_call0b_nano_29 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_31: call ras_depth_call0b_nano_30 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_32: call ras_depth_call0b_nano_31 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_33: call ras_depth_call0b_nano_32 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_34: call ras_depth_call0b_nano_33 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_35: call ras_depth_call0b_nano_34 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_36: call ras_depth_call0b_nano_35 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_37: call ras_depth_call0b_nano_36 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_38: call ras_depth_call0b_nano_37 ; jmp ras_depth_call0b_nano_1 .align 16; ras_depth_call0b_nano_39: call ras_depth_call0b_nano_38 ; jmp ras_depth_call0b_nano_1 )"); unsigned int broffset=0; #define STR_(x) #x #define STR(x) STR_(x) #define STR4(x) STR(4*(x)) #define REPH(N) REP_##N #define REP(N,X) REPH(N)(X) #define REP_0(X) #define REP_1(X) X #define REP_2(X) X X #define REP_3(X) X X X #define REP_4(X) X X X X #define REP_5(X) X X X X X #define REP_6(X) X X X X X X #define REP_7(X) X X X X X X X #define REP_8(X) X X X X X X X X #define REP_9(X) REP_4(X) REP_5(X) #define REP_10(X) REP_5(X) REP_5(X) #define REP_11(X) REP_5(X) REP_6(X) #define REP_12(X) REP_6(X) REP_6(X) #define REP_13(X) REP_6(X) REP_7(X) #define REP_14(X) REP_7(X) REP_7(X) #define REP_15(X) REP_7(X) REP_8(X) #define REP_16(X) REP_8(X) REP_8(X) #define REP_17(X) REP_8(X) REP_9(X) #define REP_18(X) REP_9(X) REP_9(X) #define REP_19(X) REP_9(X) REP_10(X) #define REP_20(X) REP_10(X) REP_10(X) #define REP_21(X) REP_10(X) REP_11(X) #define REP_22(X) REP_11(X) REP_11(X) #define REP_23(X) REP_11(X) REP_12(X) #define REP_24(X) REP_12(X) REP_12(X) #define REP_25(X) REP_12(X) REP_13(X) #define REP_26(X) REP_13(X) REP_13(X) #define REP_27(X) REP_13(X) REP_14(X) #define REP_28(X) REP_14(X) REP_14(X) #define REP_29(X) REP_14(X) REP_15(X) #define REP_30(X) REP_15(X) REP_15(X) #define REP_31(X) REP_15(X) REP_16(X) #define REP_32(X) REP_16(X) REP_16(X) #define REP_33(X) REP_16(X) REP_17(X) #define REP_34(X) REP_17(X) REP_17(X) #define REP_35(X) REP_17(X) REP_18(X) #define REP_36(X) REP_18(X) REP_18(X) #define REP_37(X) REP_18(X) REP_19(X) #define REP_38(X) REP_19(X) REP_19(X) #define REP_39(X) REP_19(X) REP_20(X) #define REP_40(X) REP_20(X) REP_20(X) #define REP_41(X) REP_20(X) REP_21(X) #define REP_42(X) REP_21(X) REP_21(X) #define REP_43(X) REP_21(X) REP_22(X) #define REP_44(X) REP_22(X) REP_22(X) #define REP_45(X) REP_22(X) REP_23(X) #define REP_46(X) REP_23(X) REP_23(X) #define REP_47(X) REP_23(X) REP_24(X) #define REP_48(X) REP_24(X) REP_24(X) #define REP_49(X) REP_24(X) REP_25(X) #define REP_50(X) REP_25(X) REP_25(X) #define REP_51(X) REP_25(X) REP_26(X) #define REP_52(X) REP_26(X) REP_26(X) #define REP_53(X) REP_26(X) REP_27(X) #define REP_54(X) REP_27(X) REP_27(X) #define REP_55(X) REP_27(X) REP_28(X) #define REP_56(X) REP_28(X) REP_28(X) #define REP_57(X) REP_28(X) REP_29(X) #define REP_58(X) REP_29(X) REP_29(X) #define REP_59(X) REP_29(X) REP_30(X) #define REP_60(X) REP_30(X) REP_30(X) #define REP_61(X) REP_30(X) REP_31(X) #define REP_62(X) REP_31(X) REP_31(X) #define REP_63(X) REP_31(X) REP_32(X) #define REP_64(X) REP_32(X) REP_32(X) asm(R"( .align 4096; ras_depth2_1: ras_depth3_1: # Shared routine. Returns to [%esp]+2 mov (%esp), %eax )" #if (!BTBMISS) "add $2, %eax \n" // Return 2 bytes further #if(AMT==0) "mov %eax, (%esp)\n" #elif (AMT > 0) REP (AMT, "push %eax\n") #else "mov %eax, (%esp)\n" #endif // AMT #else // BTBMISS "add $2, %eax \n" // Return 2 bytes further. Do this because for some reason, Intel CPUs at high AMT (e.g. 33) gets lots of RAS hits (~26 hits of 33) #if(AMT==0) #elif (AMT > 0) REP (AMT, "push %eax\n") #else #endif // AMT #endif // BTBMISS // Use divb, aam, or imul sequence for a delay. None of these really work that well, perhaps this could be improved. R"( /*andl $0xff, %eax divb %al divb %al divb %al divb %al divb %al divb %al divb %al divb %al #8 divb %al divb %al divb %al divb %al divb %al divb %al divb %al divb %al #8*/ /*aam aam aam aam aam aam aam aam #8 aam aam aam aam aam aam aam aam #16*/ imul $-1, %eax imul $-1, %eax imul $-1, %eax imul $-1, %eax imul $-1, %eax imul $-1, %eax imul $-1, %eax imul $-1, %eax #8 imul $-1, %eax imul $-1, %eax imul $-1, %eax imul $-1, %eax imul $-1, %eax imul $-1, %eax imul $-1, %eax imul $-1, %eax #16 imul $-1, %eax imul $-1, %eax imul $-1, %eax imul $-1, %eax imul $-1, %eax imul $-1, %eax imul $-1, %eax imul $-1, %eax #24 imul $-1, %eax imul $-1, %eax imul $-1, %eax imul $-1, %eax imul $-1, %eax imul $-1, %eax imul $-1, %eax imul $-1, %eax #32 and $0x10, %eax and $0x1000, %eax # eax is now zero )" #if(!BTBMISS) #if (AMT<0) // Option 1: Pop off return addresses here. On nhm to ivb, this behaves differently if esp is changed before the return. // Option 2 is to pop off return addresses after the first return, instead of here before the first return. //"addl $" STR4(-AMT) ", %esp\n" // Option 1. #endif "add %eax, (%esp)\n" "ret\n" #else #if (AMT<0) // Option 1: Pop off return addresses here. On nhm to ivb, this behaves differently if esp is changed before the return. // Option 2 is to pop off return addresses after the first return. "addl $" STR4(-AMT) ", %esp\n" // Option 1 #endif // Cause a branch misprediction using an indirect branch, not a mispredicted ret R"( movzxb broffset(%eax), %edx add $5, %edx mov %edx, broffset add $1f, %edx jmp *%edx 1: .fill 272, 1, 0xc3 )" #endif // End of ras_depth2_1. R"( .align 16; ras_depth2_2: call ras_depth2_1 ; ret; ret )" #if (!BTBMISS) #if (AMT<0) // Option 2: Pop off return addresses after the first return (to ras_depth2_2), not in ras_depth2_1 before the return to ras_depth2_2. "addl $" STR4(-AMT) ", %esp\n" // Option 2 #endif #endif R"( ret .align 16; ras_depth2_15: call ras_depth2_14 ; ret; ret .align 16; ras_depth2_4: call ras_depth2_3 ; ret; ret .align 16; ras_depth2_34: call ras_depth2_33 ; ret; ret .align 16; ras_depth2_12: call ras_depth2_11 ; ret; ret .align 16; ras_depth2_32: call ras_depth2_31 ; ret; ret .align 16; ras_depth2_23: call ras_depth2_22 ; ret; ret .align 16; ras_depth2_35: call ras_depth2_34 ; ret; ret .align 16; ras_depth2_31: call ras_depth2_30 ; ret; ret .align 16; ras_depth2_3: call ras_depth2_2 ; ret; ret; .align 16; ras_depth2_14: call ras_depth2_13 ; ret; ret .align 16; ras_depth2_17: call ras_depth2_16 ; ret; ret .align 16; ras_depth2_33: call ras_depth2_32 ; ret; ret .align 16; ras_depth2_10: call ras_depth2_9 ; ret; ret .align 16; ras_depth2_21: call ras_depth2_20 ; ret; ret .align 16; ras_depth2_30: call ras_depth2_29 ; ret; ret .align 16; ras_depth2_25: call ras_depth2_24 ; ret; ret .align 16; ras_depth2_6: call ras_depth2_5 ; ret; ret .align 16; ras_depth2_11: call ras_depth2_10 ; ret; ret .align 16; ras_depth2_9: call ras_depth2_8 ; ret; ret .align 16; ras_depth2_29: call ras_depth2_28 ; ret; ret .align 16; ras_depth2_22: call ras_depth2_21 ; ret; ret .align 16; ras_depth2_5: call ras_depth2_4 ; ret; ret .align 16; ras_depth2_28: call ras_depth2_27 ; ret; ret .align 16; ras_depth2_27: call ras_depth2_26 ; ret; ret .align 16; ras_depth2_26: call ras_depth2_25 ; ret; ret .align 16; ras_depth2_8: call ras_depth2_7 ; ret; ret .align 16; ras_depth2_18: call ras_depth2_17 ; ret; ret .align 16; ras_depth2_7: call ras_depth2_6 ; ret; ret .align 16; ras_depth2_36: call ras_depth2_35 ; ret; ret .align 16; ras_depth2_20: call ras_depth2_19 ; ret; ret .align 16; ras_depth2_38: call ras_depth2_37 ; ret; ret .align 16; ras_depth2_13: call ras_depth2_12 ; ret; ret .align 16; ras_depth2_19: call ras_depth2_18 ; ret; ret .align 16; ras_depth2_16: call ras_depth2_15 ; ret; ret .align 16; ras_depth2_37: call ras_depth2_36 ; ret; ret .align 16; ras_depth2_39: call ras_depth2_38 ; ret; ret .align 16; ras_depth2_24: call ras_depth2_23 ; ret; ret )"); // A bunch of calls that terminates in an infinite loop. Only run this speculatively. // Ensure this code is less than 4KB (page size), fits inside a page, and the translation is kept in the L1-ITLB. // This function is only ever executed speculatively. // If this code is in its own page (or the function crosses a page boundary), then the OS // never gets to page-fault this code into memory, and the speculative code never executes // because the (speculative) instruction fetch hits a page fault, but the fault is never taken. // Call pf_ras_clobber1 non-speculatively to fault-in this code page. // Pentium Pro: Perhaps due to the small icache, where this code is located affects runtime. asm(R"( .align 16 pf_ras_clobber1: jmp 99f # Tries to prefetch every cache line of this code. .align 16; 1: jmp 2f .align 16; 2: jmp 3f; 99: jmp 99f .align 16; 3: jmp 4f .align 16; 4: jmp 1b; 99: jmp 99f .align 16; ras_clobber_1: jmp 1b .align 16; ras_clobber_2: call ras_clobber_1; ret; 99: jmp 99f .align 16; ras_clobber_3: call ras_clobber_2; ret .align 16; ras_clobber_4: call ras_clobber_3; ret; 99: jmp 99f .align 16; ras_clobber_5: call ras_clobber_4; ret .align 16; ras_clobber_6: call ras_clobber_5; ret; 99: jmp 99f .align 16; ras_clobber_7: call ras_clobber_6; ret .align 16; ras_clobber_8: call ras_clobber_7; ret; 99: jmp 99f .align 16; ras_clobber_9: call ras_clobber_8; ret .align 16; ras_clobber_10: call ras_clobber_9; ret; 99: jmp 99f .align 16; ras_clobber_11: call ras_clobber_10; ret .align 16; ras_clobber_12: call ras_clobber_11; ret; 99: jmp 99f .align 16; ras_clobber_13: call ras_clobber_12; ret .align 16; ras_clobber_14: call ras_clobber_13; ret; 99: jmp 99f .align 16; ras_clobber_15: call ras_clobber_14; ret .align 16; ras_clobber_16: call ras_clobber_15; ret; 99: jmp 99f .align 16; ras_clobber_17: call ras_clobber_16; ret .align 16; ras_clobber_18: call ras_clobber_17; ret; 99: jmp 99f .align 16; ras_clobber_19: call ras_clobber_18; ret .align 16; ras_clobber_20: call ras_clobber_19; ret; 99: jmp 99f .align 16; ras_clobber_21: call ras_clobber_20; ret .align 16; ras_clobber_22: call ras_clobber_21; ret; 99: jmp 99f .align 16; ras_clobber_23: call ras_clobber_22; ret .align 16; ras_clobber_24: call ras_clobber_23; ret; 99: jmp 99f .align 16; ras_clobber_25: call ras_clobber_24; ret .align 16; ras_clobber_26: call ras_clobber_25; ret; 99: jmp 99f .align 16; ras_clobber_27: call ras_clobber_26; ret .align 16; ras_clobber_28: call ras_clobber_27; ret; 99: jmp 99f .align 16; ras_clobber_29: call ras_clobber_28; ret .align 16; ras_clobber_30: call ras_clobber_29; ret; 99: jmp 99f .align 16; ras_clobber_31: call ras_clobber_30; ret .align 16; ras_clobber_32: call ras_clobber_31; ret; 99: jmp 99f .align 16; ras_clobber_33: call ras_clobber_32; ret .align 16; ras_clobber_34: call ras_clobber_33; ret; 99: jmp 99f .align 16; ras_clobber_35: call ras_clobber_34; ret .align 16; ras_clobber_36: call ras_clobber_35; ret; 99: jmp 99f .align 16; ras_clobber_37: call ras_clobber_36; ret .align 16; ras_clobber_38: call ras_clobber_37; ret; 99: jmp 99f .align 16; ras_clobber_39: call ras_clobber_38; ret .align 16; ras_clobber_40: call ras_clobber_39; ret; 99: jmp 99f /* .align 16; ras_clobber_41: call ras_clobber_40; ret .align 16; ras_clobber_42: call ras_clobber_41; ret; 99: jmp 99f .align 16; ras_clobber_43: call ras_clobber_42; ret .align 16; ras_clobber_44: call ras_clobber_43; ret; 99: jmp 99f .align 16; ras_clobber_45: call ras_clobber_44; ret .align 16; ras_clobber_46: call ras_clobber_45; ret; 99: jmp 99f .align 16; ras_clobber_47: call ras_clobber_46; ret .align 16; ras_clobber_48: call ras_clobber_47; ret; 99: jmp 99f .align 16; ras_clobber_49: call ras_clobber_48; ret .align 16; ras_clobber_50: call ras_clobber_49; ret; 99: jmp 99f .align 16; ras_clobber_51: call ras_clobber_50; ret .align 16; ras_clobber_52: call ras_clobber_51; ret; 99: jmp 99f .align 16; ras_clobber_53: call ras_clobber_52; ret .align 16; ras_clobber_54: call ras_clobber_53; ret; 99: jmp 99f .align 16; ras_clobber_55: call ras_clobber_54; ret .align 16; ras_clobber_56: call ras_clobber_55; ret; 99: jmp 99f .align 16; ras_clobber_57: call ras_clobber_56; ret .align 16; ras_clobber_58: call ras_clobber_57; ret; 99: jmp 99f .align 16; ras_clobber_59: call ras_clobber_58; ret .align 16; ras_clobber_60: call ras_clobber_59; ret; 99: jmp 99f .align 16; ras_clobber_61: call ras_clobber_60; ret .align 16; ras_clobber_62: call ras_clobber_61; ret; 99: jmp 99f .align 16; ras_clobber_63: call ras_clobber_62; ret .align 16; ras_clobber_64: call ras_clobber_63; ret; 99: jmp 99f .align 16; ras_clobber_65: call ras_clobber_64; ret*/ 99: jmp 99f .align 16; 1: call ras_clobber_inf .align 16; ras_clobber_inf: call 1b 99: jmp 99f .align 16; 1: ret .align 16; ras_clobber_inf2: call 1b; call 1b; call 1b; call 1b; call 1b; jmp ras_clobber_inf2 99: ret )"); asm(R"( //ras_depth3_1: // addl $2, (%esp); ret .align 16; ras_depth3_2: call ras_depth2_1 ; 1: jmp 1b; ret .align 16; ras_depth3_3: call ras_depth3_2 ; ret .align 16; ras_depth3_4: call ras_depth3_3 ; ret .align 16; ras_depth3_5: call ras_depth3_4 ; ret .align 16; ras_depth3_6: call ras_depth3_5 ; ret .align 16; ras_depth3_7: call ras_depth3_6 ; ret .align 16; ras_depth3_8: call ras_depth3_7 ; ret .align 16; ras_depth3_9: call ras_depth3_8 ; ret .align 16; ras_depth3_10: call ras_depth3_9 ; ret .align 16; ras_depth3_11: call ras_depth3_10 ; ret .align 16; ras_depth3_12: call ras_depth3_11 ; ret .align 16; ras_depth3_13: call ras_depth3_12 ; ret .align 16; ras_depth3_14: call ras_depth3_13 ; ret .align 16; ras_depth3_15: call ras_depth3_14 ; ret .align 16; ras_depth3_16: call ras_depth3_15 ; ret .align 16; ras_depth3_17: call ras_depth3_16 ; ret .align 16; ras_depth3_18: call ras_depth3_17 ; ret .align 16; ras_depth3_19: call ras_depth3_18 ; ret .align 16; ras_depth3_20: call ras_depth3_19 ; ret .align 16; ras_depth3_21: call ras_depth3_20 ; ret .align 16; ras_depth3_22: call ras_depth3_21 ; ret .align 16; ras_depth3_23: call ras_depth3_22 ; ret .align 16; ras_depth3_24: call ras_depth3_23 ; ret .align 16; ras_depth3_25: call ras_depth3_24 ; ret .align 16; ras_depth3_26: call ras_depth3_25 ; ret .align 16; ras_depth3_27: call ras_depth3_26 ; ret .align 16; ras_depth3_28: call ras_depth3_27 ; ret .align 16; ras_depth3_29: call ras_depth3_28 ; ret .align 16; ras_depth3_30: call ras_depth3_29 ; ret .align 16; ras_depth3_31: call ras_depth3_30 ; ret .align 16; ras_depth3_32: call ras_depth3_31 ; ret .align 16; ras_depth3_33: call ras_depth3_32 ; ret .align 16; ras_depth3_34: call ras_depth3_33 ; ret .align 16; ras_depth3_35: call ras_depth3_34 ; ret .align 16; ras_depth3_36: call ras_depth3_35 ; ret .align 16; ras_depth3_37: call ras_depth3_36 ; ret .align 16; ras_depth3_38: call ras_depth3_37 ; ret .align 16; ras_depth3_39: call ras_depth3_38 ; ret )"); void ras_depth() { printf("ras_depth: A chain of calls and returns\n"); printf ("Depth,Min,Max,Clocks,Clocks2\n"); T_BODY("1", "call ras_depth_1\n"); T_BODY("2", "call ras_depth_2\n"); T_BODY("3", "call ras_depth_3\n"); T_BODY("4", "call ras_depth_4\n"); T_BODY("5", "call ras_depth_5\n"); T_BODY("6", "call ras_depth_6\n"); T_BODY("7", "call ras_depth_7\n"); T_BODY("8", "call ras_depth_8\n"); T_BODY("9", "call ras_depth_9\n"); T_BODY("10", "call ras_depth_10\n"); T_BODY("11", "call ras_depth_11\n"); T_BODY("12", "call ras_depth_12\n"); T_BODY("13", "call ras_depth_13\n"); T_BODY("14", "call ras_depth_14\n"); T_BODY("15", "call ras_depth_15\n"); T_BODY("16", "call ras_depth_16\n"); T_BODY("17", "call ras_depth_17\n"); T_BODY("18", "call ras_depth_18\n"); T_BODY("19", "call ras_depth_19\n"); T_BODY("20", "call ras_depth_20\n"); T_BODY("21", "call ras_depth_21\n"); T_BODY("22", "call ras_depth_22\n"); T_BODY("23", "call ras_depth_23\n"); T_BODY("24", "call ras_depth_24\n"); T_BODY("25", "call ras_depth_25\n"); T_BODY("26", "call ras_depth_26\n"); T_BODY("27", "call ras_depth_27\n"); T_BODY("28", "call ras_depth_28\n"); T_BODY("29", "call ras_depth_29\n"); T_BODY("30", "call ras_depth_30\n"); T_BODY("31", "call ras_depth_31\n"); T_BODY("32", "call ras_depth_32\n"); T_BODY("33", "call ras_depth_33\n"); T_BODY("34", "call ras_depth_34\n"); T_BODY("35", "call ras_depth_35\n"); T_BODY("36", "call ras_depth_36\n"); T_BODY("37", "call ras_depth_37\n"); T_BODY("38", "call ras_depth_38\n"); T_BODY("39", "call ras_depth_39\n"); } void ras_depth_vianano() { printf("ras_depth: A chain of calls and returns, sharing one return (for Via Nano)\n"); printf ("Depth,Min,Max,Clocks,Clocks2\n"); T_BODY("1", "call ras_depth_nano_1\n"); T_BODY("2", "call ras_depth_nano_2\n"); T_BODY("3", "call ras_depth_nano_3\n"); T_BODY("4", "call ras_depth_nano_4\n"); T_BODY("5", "call ras_depth_nano_5\n"); T_BODY("6", "call ras_depth_nano_6\n"); T_BODY("7", "call ras_depth_nano_7\n"); T_BODY("8", "call ras_depth_nano_8\n"); T_BODY("9", "call ras_depth_nano_9\n"); T_BODY("10", "call ras_depth_nano_10\n"); T_BODY("11", "call ras_depth_nano_11\n"); T_BODY("12", "call ras_depth_nano_12\n"); T_BODY("13", "call ras_depth_nano_13\n"); T_BODY("14", "call ras_depth_nano_14\n"); T_BODY("15", "call ras_depth_nano_15\n"); T_BODY("16", "call ras_depth_nano_16\n"); T_BODY("17", "call ras_depth_nano_17\n"); T_BODY("18", "call ras_depth_nano_18\n"); T_BODY("19", "call ras_depth_nano_19\n"); T_BODY("20", "call ras_depth_nano_20\n"); T_BODY("21", "call ras_depth_nano_21\n"); T_BODY("22", "call ras_depth_nano_22\n"); T_BODY("23", "call ras_depth_nano_23\n"); T_BODY("24", "call ras_depth_nano_24\n"); T_BODY("25", "call ras_depth_nano_25\n"); T_BODY("26", "call ras_depth_nano_26\n"); T_BODY("27", "call ras_depth_nano_27\n"); T_BODY("28", "call ras_depth_nano_28\n"); T_BODY("29", "call ras_depth_nano_29\n"); T_BODY("30", "call ras_depth_nano_30\n"); T_BODY("31", "call ras_depth_nano_31\n"); T_BODY("32", "call ras_depth_nano_32\n"); T_BODY("33", "call ras_depth_nano_33\n"); T_BODY("34", "call ras_depth_nano_34\n"); T_BODY("35", "call ras_depth_nano_35\n"); T_BODY("36", "call ras_depth_nano_36\n"); T_BODY("37", "call ras_depth_nano_37\n"); T_BODY("38", "call ras_depth_nano_38\n"); T_BODY("39", "call ras_depth_nano_39\n"); } void ras_depth_mispredict() { printf("ras_depth_mispredict: The final return is mispredicted, with no delay in resolution.\n"); printf ("Depth,Min,Max,Clocks,Clocks2\n"); T_BODY("1", "call ras_depth_mp_1; nop\n"); T_BODY("2", "call ras_depth_mp_2\n"); T_BODY("3", "call ras_depth_mp_3\n"); T_BODY("4", "call ras_depth_mp_4\n"); T_BODY("5", "call ras_depth_mp_5\n"); T_BODY("6", "call ras_depth_mp_6\n"); T_BODY("7", "call ras_depth_mp_7\n"); T_BODY("8", "call ras_depth_mp_8\n"); T_BODY("9", "call ras_depth_mp_9\n"); T_BODY("10", "call ras_depth_mp_10\n"); T_BODY("11", "call ras_depth_mp_11\n"); T_BODY("12", "call ras_depth_mp_12\n"); T_BODY("13", "call ras_depth_mp_13\n"); T_BODY("14", "call ras_depth_mp_14\n"); T_BODY("15", "call ras_depth_mp_15\n"); T_BODY("16", "call ras_depth_mp_16\n"); T_BODY("17", "call ras_depth_mp_17\n"); T_BODY("18", "call ras_depth_mp_18\n"); T_BODY("19", "call ras_depth_mp_19\n"); T_BODY("20", "call ras_depth_mp_20\n"); T_BODY("21", "call ras_depth_mp_21\n"); T_BODY("22", "call ras_depth_mp_22\n"); T_BODY("23", "call ras_depth_mp_23\n"); T_BODY("24", "call ras_depth_mp_24\n"); T_BODY("25", "call ras_depth_mp_25\n"); T_BODY("26", "call ras_depth_mp_26\n"); T_BODY("27", "call ras_depth_mp_27\n"); T_BODY("28", "call ras_depth_mp_28\n"); T_BODY("29", "call ras_depth_mp_29\n"); T_BODY("30", "call ras_depth_mp_30\n"); T_BODY("31", "call ras_depth_mp_31\n"); T_BODY("32", "call ras_depth_mp_32\n"); T_BODY("33", "call ras_depth_mp_33\n"); T_BODY("34", "call ras_depth_mp_34\n"); T_BODY("35", "call ras_depth_mp_35\n"); T_BODY("36", "call ras_depth_mp_36\n"); T_BODY("37", "call ras_depth_mp_37\n"); T_BODY("38", "call ras_depth_mp_38\n"); T_BODY("39", "call ras_depth_mp_39\n"); } void ras_depth_mispredict_nano() { printf("ras_depth_mispredict: The final return is mispredicted, with no delay in resolution. Via Nano.\n"); printf ("Depth,Min,Max,Clocks,Clocks2\n"); T_BODY("1", "call ras_depth_mp_nano_1; nop\n"); T_BODY("2", "call ras_depth_mp_nano_2\n"); T_BODY("3", "call ras_depth_mp_nano_3\n"); T_BODY("4", "call ras_depth_mp_nano_4\n"); T_BODY("5", "call ras_depth_mp_nano_5\n"); T_BODY("6", "call ras_depth_mp_nano_6\n"); T_BODY("7", "call ras_depth_mp_nano_7\n"); T_BODY("8", "call ras_depth_mp_nano_8\n"); T_BODY("9", "call ras_depth_mp_nano_9\n"); T_BODY("10", "call ras_depth_mp_nano_10\n"); T_BODY("11", "call ras_depth_mp_nano_11\n"); T_BODY("12", "call ras_depth_mp_nano_12\n"); T_BODY("13", "call ras_depth_mp_nano_13\n"); T_BODY("14", "call ras_depth_mp_nano_14\n"); T_BODY("15", "call ras_depth_mp_nano_15\n"); T_BODY("16", "call ras_depth_mp_nano_16\n"); T_BODY("17", "call ras_depth_mp_nano_17\n"); T_BODY("18", "call ras_depth_mp_nano_18\n"); T_BODY("19", "call ras_depth_mp_nano_19\n"); T_BODY("20", "call ras_depth_mp_nano_20\n"); T_BODY("21", "call ras_depth_mp_nano_21\n"); T_BODY("22", "call ras_depth_mp_nano_22\n"); T_BODY("23", "call ras_depth_mp_nano_23\n"); T_BODY("24", "call ras_depth_mp_nano_24\n"); T_BODY("25", "call ras_depth_mp_nano_25\n"); T_BODY("26", "call ras_depth_mp_nano_26\n"); T_BODY("27", "call ras_depth_mp_nano_27\n"); T_BODY("28", "call ras_depth_mp_nano_28\n"); T_BODY("29", "call ras_depth_mp_nano_29\n"); T_BODY("30", "call ras_depth_mp_nano_30\n"); T_BODY("31", "call ras_depth_mp_nano_31\n"); T_BODY("32", "call ras_depth_mp_nano_32\n"); T_BODY("33", "call ras_depth_mp_nano_33\n"); T_BODY("34", "call ras_depth_mp_nano_34\n"); T_BODY("35", "call ras_depth_mp_nano_35\n"); T_BODY("36", "call ras_depth_mp_nano_36\n"); T_BODY("37", "call ras_depth_mp_nano_37\n"); T_BODY("38", "call ras_depth_mp_nano_38\n"); T_BODY("39", "call ras_depth_mp_nano_39\n"); } void ras_depth_mispredict_delay() { printf("ras_depth_mispredict_delay: The final return is mispredicted, with a delay in resolution.\n"); printf ("Depth,Min,Max,Clocks,Clocks2\n"); #if (!BTBMISS) T_BODY("1", "call ras_depth2_1; ret; ret\n"); #else T_BODY("1", "call ras_depth2_1\n"); #endif T_BODY("2", "call ras_depth2_2\n"); T_BODY("3", "call ras_depth2_3\n"); T_BODY("4", "call ras_depth2_4\n"); T_BODY("5", "call ras_depth2_5\n"); T_BODY("6", "call ras_depth2_6\n"); T_BODY("7", "call ras_depth2_7\n"); T_BODY("8", "call ras_depth2_8\n"); T_BODY("9", "call ras_depth2_9\n"); T_BODY("10", "call ras_depth2_10\n"); T_BODY("11", "call ras_depth2_11\n"); T_BODY("12", "call ras_depth2_12\n"); T_BODY("13", "call ras_depth2_13\n"); T_BODY("14", "call ras_depth2_14\n"); T_BODY("15", "call ras_depth2_15\n"); T_BODY("16", "call ras_depth2_16\n"); T_BODY("17", "call ras_depth2_17\n"); T_BODY("18", "call ras_depth2_18\n"); T_BODY("19", "call ras_depth2_19\n"); T_BODY("20", "call ras_depth2_20\n"); T_BODY("21", "call ras_depth2_21\n"); T_BODY("22", "call ras_depth2_22\n"); T_BODY("23", "call ras_depth2_23\n"); T_BODY("24", "call ras_depth2_24\n"); T_BODY("25", "call ras_depth2_25\n"); T_BODY("26", "call ras_depth2_26\n"); T_BODY("27", "call ras_depth2_27\n"); T_BODY("28", "call ras_depth2_28\n"); T_BODY("29", "call ras_depth2_29\n"); T_BODY("30", "call ras_depth2_30\n"); T_BODY("31", "call ras_depth2_31\n"); T_BODY("32", "call ras_depth2_32\n"); T_BODY("33", "call ras_depth2_33\n"); T_BODY("34", "call ras_depth2_34\n"); T_BODY("35", "call ras_depth2_35\n"); T_BODY("36", "call ras_depth2_36\n"); T_BODY("37", "call ras_depth2_37\n"); T_BODY("38", "call ras_depth2_38\n"); T_BODY("39", "call ras_depth2_39\n"); } void ras_depth_misalign() { printf("ras_depth_misalign: The final return uses an indirect branch. Test misalignment of the RAS.\n"); printf ("Depth,Min,Max,Clocks,Clocks2\n"); T_BODY("1", "call ras_depth_ma_1\n"); T_BODY("2", "call ras_depth_ma_2\n"); T_BODY("3", "call ras_depth_ma_3\n"); T_BODY("4", "call ras_depth_ma_4\n"); T_BODY("5", "call ras_depth_ma_5\n"); T_BODY("6", "call ras_depth_ma_6\n"); T_BODY("7", "call ras_depth_ma_7\n"); T_BODY("8", "call ras_depth_ma_8\n"); T_BODY("9", "call ras_depth_ma_9\n"); T_BODY("10", "call ras_depth_ma_10\n"); T_BODY("11", "call ras_depth_ma_11\n"); T_BODY("12", "call ras_depth_ma_12\n"); T_BODY("13", "call ras_depth_ma_13\n"); T_BODY("14", "call ras_depth_ma_14\n"); T_BODY("15", "call ras_depth_ma_15\n"); T_BODY("16", "call ras_depth_ma_16\n"); T_BODY("17", "call ras_depth_ma_17\n"); T_BODY("18", "call ras_depth_ma_18\n"); T_BODY("19", "call ras_depth_ma_19\n"); T_BODY("20", "call ras_depth_ma_20\n"); T_BODY("21", "call ras_depth_ma_21\n"); T_BODY("22", "call ras_depth_ma_22\n"); T_BODY("23", "call ras_depth_ma_23\n"); T_BODY("24", "call ras_depth_ma_24\n"); T_BODY("25", "call ras_depth_ma_25\n"); T_BODY("26", "call ras_depth_ma_26\n"); T_BODY("27", "call ras_depth_ma_27\n"); T_BODY("28", "call ras_depth_ma_28\n"); T_BODY("29", "call ras_depth_ma_29\n"); T_BODY("30", "call ras_depth_ma_30\n"); T_BODY("31", "call ras_depth_ma_31\n"); T_BODY("32", "call ras_depth_ma_32\n"); T_BODY("33", "call ras_depth_ma_33\n"); T_BODY("34", "call ras_depth_ma_34\n"); T_BODY("35", "call ras_depth_ma_35\n"); T_BODY("36", "call ras_depth_ma_36\n"); T_BODY("37", "call ras_depth_ma_37\n"); T_BODY("38", "call ras_depth_ma_38\n"); T_BODY("39", "call ras_depth_ma_39\n"); } void ras_depth_misalign_nano() { printf("ras_depth_misalign: The final return uses an indirect branch. Test misalignment of the RAS. Via Nano\n"); printf ("Depth,Min,Max,Clocks,Clocks2\n"); T_BODY("1", "call ras_depth_ma_nano_1\n"); T_BODY("2", "call ras_depth_ma_nano_2\n"); T_BODY("3", "call ras_depth_ma_nano_3\n"); T_BODY("4", "call ras_depth_ma_nano_4\n"); T_BODY("5", "call ras_depth_ma_nano_5\n"); T_BODY("6", "call ras_depth_ma_nano_6\n"); T_BODY("7", "call ras_depth_ma_nano_7\n"); T_BODY("8", "call ras_depth_ma_nano_8\n"); T_BODY("9", "call ras_depth_ma_nano_9\n"); T_BODY("10", "call ras_depth_ma_nano_10\n"); T_BODY("11", "call ras_depth_ma_nano_11\n"); T_BODY("12", "call ras_depth_ma_nano_12\n"); T_BODY("13", "call ras_depth_ma_nano_13\n"); T_BODY("14", "call ras_depth_ma_nano_14\n"); T_BODY("15", "call ras_depth_ma_nano_15\n"); T_BODY("16", "call ras_depth_ma_nano_16\n"); T_BODY("17", "call ras_depth_ma_nano_17\n"); T_BODY("18", "call ras_depth_ma_nano_18\n"); T_BODY("19", "call ras_depth_ma_nano_19\n"); T_BODY("20", "call ras_depth_ma_nano_20\n"); T_BODY("21", "call ras_depth_ma_nano_21\n"); T_BODY("22", "call ras_depth_ma_nano_22\n"); T_BODY("23", "call ras_depth_ma_nano_23\n"); T_BODY("24", "call ras_depth_ma_nano_24\n"); T_BODY("25", "call ras_depth_ma_nano_25\n"); T_BODY("26", "call ras_depth_ma_nano_26\n"); T_BODY("27", "call ras_depth_ma_nano_27\n"); T_BODY("28", "call ras_depth_ma_nano_28\n"); T_BODY("29", "call ras_depth_ma_nano_29\n"); T_BODY("30", "call ras_depth_ma_nano_30\n"); T_BODY("31", "call ras_depth_ma_nano_31\n"); T_BODY("32", "call ras_depth_ma_nano_32\n"); T_BODY("33", "call ras_depth_ma_nano_33\n"); T_BODY("34", "call ras_depth_ma_nano_34\n"); T_BODY("35", "call ras_depth_ma_nano_35\n"); T_BODY("36", "call ras_depth_ma_nano_36\n"); T_BODY("37", "call ras_depth_ma_nano_37\n"); T_BODY("38", "call ras_depth_ma_nano_38\n"); T_BODY("39", "call ras_depth_ma_nano_39\n"); } void ras_depth_mispredict_delay_lessspec() { printf("ras_depth_mispredict_delay_lessspec: The final return is mispredicted, with a delay in resolution. Speculatively execute just one return followed by infinite loop, to reduce disturbing the RAS.\n"); printf ("Depth,Min,Max,Clocks,Clocks2\n"); T_BODY("1", "call ras_depth3_1; 1: jmp 1b\n"); T_BODY("2", "call ras_depth3_2\n"); T_BODY("3", "call ras_depth3_3\n"); T_BODY("4", "call ras_depth3_4\n"); T_BODY("5", "call ras_depth3_5\n"); T_BODY("6", "call ras_depth3_6\n"); T_BODY("7", "call ras_depth3_7\n"); T_BODY("8", "call ras_depth3_8\n"); T_BODY("9", "call ras_depth3_9\n"); T_BODY("10", "call ras_depth3_10\n"); T_BODY("11", "call ras_depth3_11\n"); T_BODY("12", "call ras_depth3_12\n"); T_BODY("13", "call ras_depth3_13\n"); T_BODY("14", "call ras_depth3_14\n"); T_BODY("15", "call ras_depth3_15\n"); T_BODY("16", "call ras_depth3_16\n"); T_BODY("17", "call ras_depth3_17\n"); T_BODY("18", "call ras_depth3_18\n"); T_BODY("19", "call ras_depth3_19\n"); T_BODY("20", "call ras_depth3_20\n"); T_BODY("21", "call ras_depth3_21\n"); T_BODY("22", "call ras_depth3_22\n"); T_BODY("23", "call ras_depth3_23\n"); T_BODY("24", "call ras_depth3_24\n"); T_BODY("25", "call ras_depth3_25\n"); T_BODY("26", "call ras_depth3_26\n"); T_BODY("27", "call ras_depth3_27\n"); T_BODY("28", "call ras_depth3_28\n"); T_BODY("29", "call ras_depth3_29\n"); T_BODY("30", "call ras_depth3_30\n"); T_BODY("31", "call ras_depth3_31\n"); T_BODY("32", "call ras_depth3_32\n"); T_BODY("33", "call ras_depth3_33\n"); T_BODY("34", "call ras_depth3_34\n"); T_BODY("35", "call ras_depth3_35\n"); T_BODY("36", "call ras_depth3_36\n"); T_BODY("37", "call ras_depth3_37\n"); T_BODY("38", "call ras_depth3_38\n"); T_BODY("39", "call ras_depth3_39\n"); } void ras_depth_call0() { printf("ras_depth_call0: Test whether call +0 is treated as a call (RAS misalign if no)\n"); printf ("Depth,Min,Max,Clocks,Clocks2\n"); T_BODY("2", "call ras_depth_call0_2\n"); T_BODY("3", "call ras_depth_call0_3\n"); T_BODY("4", "call ras_depth_call0_4\n"); T_BODY("5", "call ras_depth_call0_5\n"); /*T_BODY("6", "call ras_depth_call0_6\n"); T_BODY("7", "call ras_depth_call0_7\n"); T_BODY("8", "call ras_depth_call0_8\n"); T_BODY("9", "call ras_depth_call0_9\n"); T_BODY("10", "call ras_depth_call0_10\n"); T_BODY("11", "call ras_depth_call0_11\n"); T_BODY("12", "call ras_depth_call0_12\n"); T_BODY("13", "call ras_depth_call0_13\n"); T_BODY("14", "call ras_depth_call0_14\n"); T_BODY("15", "call ras_depth_call0_15\n"); T_BODY("16", "call ras_depth_call0_16\n"); T_BODY("17", "call ras_depth_call0_17\n"); T_BODY("18", "call ras_depth_call0_18\n"); T_BODY("19", "call ras_depth_call0_19\n"); T_BODY("20", "call ras_depth_call0_20\n"); T_BODY("21", "call ras_depth_call0_21\n"); T_BODY("22", "call ras_depth_call0_22\n"); T_BODY("23", "call ras_depth_call0_23\n"); T_BODY("24", "call ras_depth_call0_24\n"); T_BODY("25", "call ras_depth_call0_25\n"); T_BODY("26", "call ras_depth_call0_26\n"); T_BODY("27", "call ras_depth_call0_27\n"); T_BODY("28", "call ras_depth_call0_28\n"); T_BODY("29", "call ras_depth_call0_29\n"); T_BODY("30", "call ras_depth_call0_30\n"); T_BODY("31", "call ras_depth_call0_31\n"); T_BODY("32", "call ras_depth_call0_32\n"); T_BODY("33", "call ras_depth_call0_33\n"); T_BODY("34", "call ras_depth_call0_34\n"); T_BODY("35", "call ras_depth_call0_35\n"); T_BODY("36", "call ras_depth_call0_36\n"); T_BODY("37", "call ras_depth_call0_37\n"); T_BODY("38", "call ras_depth_call0_38\n"); T_BODY("39", "call ras_depth_call0_39\n");*/ } void ras_depth_call0b() { printf("ras_depth_call0b: Test whether call +0 is treated as a call (RAS misalign if yes)\n"); printf ("Depth,Min,Max,Clocks,Clocks2\n"); T_BODY("2", "call ras_depth_call0b_2\n"); T_BODY("3", "call ras_depth_call0b_3\n"); T_BODY("4", "call ras_depth_call0b_4\n"); T_BODY("5", "call ras_depth_call0b_5\n"); /*T_BODY("6", "call ras_depth_call0b_6\n"); T_BODY("7", "call ras_depth_call0b_7\n"); T_BODY("8", "call ras_depth_call0b_8\n"); T_BODY("9", "call ras_depth_call0b_9\n"); T_BODY("10", "call ras_depth_call0b_10\n"); T_BODY("11", "call ras_depth_call0b_11\n"); T_BODY("12", "call ras_depth_call0b_12\n"); T_BODY("13", "call ras_depth_call0b_13\n"); T_BODY("14", "call ras_depth_call0b_14\n"); T_BODY("15", "call ras_depth_call0b_15\n"); T_BODY("16", "call ras_depth_call0b_16\n"); T_BODY("17", "call ras_depth_call0b_17\n"); T_BODY("18", "call ras_depth_call0b_18\n"); T_BODY("19", "call ras_depth_call0b_19\n"); T_BODY("20", "call ras_depth_call0b_20\n"); T_BODY("21", "call ras_depth_call0b_21\n"); T_BODY("22", "call ras_depth_call0b_22\n"); T_BODY("23", "call ras_depth_call0b_23\n"); T_BODY("24", "call ras_depth_call0b_24\n"); T_BODY("25", "call ras_depth_call0b_25\n"); T_BODY("26", "call ras_depth_call0b_26\n"); T_BODY("27", "call ras_depth_call0b_27\n"); T_BODY("28", "call ras_depth_call0b_28\n"); T_BODY("29", "call ras_depth_call0b_29\n"); T_BODY("30", "call ras_depth_call0b_30\n"); T_BODY("31", "call ras_depth_call0b_31\n"); T_BODY("32", "call ras_depth_call0b_32\n"); T_BODY("33", "call ras_depth_call0b_33\n"); T_BODY("34", "call ras_depth_call0b_34\n"); T_BODY("35", "call ras_depth_call0b_35\n"); T_BODY("36", "call ras_depth_call0b_36\n"); T_BODY("37", "call ras_depth_call0b_37\n"); T_BODY("38", "call ras_depth_call0b_38\n"); T_BODY("39", "call ras_depth_call0b_39\n");*/ } void ras_depth_call0_nano() { printf("ras_depth_call0: Test whether call +0 is treated as a call (RAS misalign if no), Via Nano\n"); printf ("Depth,Min,Max,Clocks,Clocks2\n"); T_BODY("2", "call ras_depth_call0_nano_2\n"); T_BODY("3", "call ras_depth_call0_nano_3\n"); T_BODY("4", "call ras_depth_call0_nano_4\n"); T_BODY("5", "call ras_depth_call0_nano_5\n"); } void ras_depth_call0b_nano() { printf("ras_depth_call0b: Test whether call +0 is treated as a call (RAS misalign if yes), Via Nano\n"); printf ("Depth,Min,Max,Clocks,Clocks2\n"); T_BODY("2", "call ras_depth_call0b_nano_2\n"); T_BODY("3", "call ras_depth_call0b_nano_3\n"); T_BODY("4", "call ras_depth_call0b_nano_4\n"); T_BODY("5", "call ras_depth_call0b_nano_5\n"); } #define MAKE_RAS_DEPTH2(N) \ void ras_depth_clobber_##N() \ { \ T_BODY("ras depth2 2 " #N, "call ras_depth2_2; call ras_depth3_" #N "\n"); \ T_BODY("ras depth2 3 " #N, "call ras_depth2_3; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 4 " #N, "call ras_depth2_4; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 5 " #N, "call ras_depth2_5; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 6 " #N, "call ras_depth2_6; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 7 " #N, "call ras_depth2_7; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 8 " #N, "call ras_depth2_8; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 9 " #N, "call ras_depth2_9; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 10 " #N, "call ras_depth2_10; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 11 " #N, "call ras_depth2_11; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 12 " #N, "call ras_depth2_12; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 13 " #N, "call ras_depth2_13; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 14 " #N, "call ras_depth2_14; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 15 " #N, "call ras_depth2_15; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 16 " #N, "call ras_depth2_16; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 17 " #N, "call ras_depth2_17; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 18 " #N, "call ras_depth2_18; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 19 " #N, "call ras_depth2_19; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 20 " #N, "call ras_depth2_20; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 21 " #N, "call ras_depth2_21; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 22 " #N, "call ras_depth2_22; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 23 " #N, "call ras_depth2_23; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 24 " #N, "call ras_depth2_24; call ras_depth3_" #N"\n"); \ } \ void ras_depth_clobber2x_##N() \ { \ T_BODY("ras depth2 2 " #N, "call ras_depth2_2; call ras_depth_"#N "; call ras_depth3_" #N "\n"); \ T_BODY("ras depth2 3 " #N, "call ras_depth2_3; call ras_depth_"#N "; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 4 " #N, "call ras_depth2_4; call ras_depth_"#N "; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 5 " #N, "call ras_depth2_5; call ras_depth_"#N "; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 6 " #N, "call ras_depth2_6; call ras_depth_"#N "; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 7 " #N, "call ras_depth2_7; call ras_depth_"#N "; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 8 " #N, "call ras_depth2_8; call ras_depth_"#N "; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 9 " #N, "call ras_depth2_9; call ras_depth_"#N "; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 10 " #N, "call ras_depth2_10; call ras_depth_"#N "; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 11 " #N, "call ras_depth2_11; call ras_depth_"#N "; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 12 " #N, "call ras_depth2_12; call ras_depth_"#N "; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 13 " #N, "call ras_depth2_13; call ras_depth_"#N "; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 14 " #N, "call ras_depth2_14; call ras_depth_"#N "; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 15 " #N, "call ras_depth2_15; call ras_depth_"#N "; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 16 " #N, "call ras_depth2_16; call ras_depth_"#N "; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 17 " #N, "call ras_depth2_17; call ras_depth_"#N "; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 18 " #N, "call ras_depth2_18; call ras_depth_"#N "; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 19 " #N, "call ras_depth2_19; call ras_depth_"#N "; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 20 " #N, "call ras_depth2_20; call ras_depth_"#N "; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 21 " #N, "call ras_depth2_21; call ras_depth_"#N "; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 22 " #N, "call ras_depth2_22; call ras_depth_"#N "; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 23 " #N, "call ras_depth2_23; call ras_depth_"#N "; call ras_depth3_" #N"\n"); \ T_BODY("ras depth2 24 " #N, "call ras_depth2_24; call ras_depth_"#N "; call ras_depth3_" #N"\n"); \ } \ /* MAKE_RAS_DEPTH2(2) MAKE_RAS_DEPTH2(3) MAKE_RAS_DEPTH2(4) MAKE_RAS_DEPTH2(5) MAKE_RAS_DEPTH2(6) MAKE_RAS_DEPTH2(7) MAKE_RAS_DEPTH2(8) MAKE_RAS_DEPTH2(9) MAKE_RAS_DEPTH2(10) MAKE_RAS_DEPTH2(11) MAKE_RAS_DEPTH2(12) MAKE_RAS_DEPTH2(13) MAKE_RAS_DEPTH2(14) MAKE_RAS_DEPTH2(15) MAKE_RAS_DEPTH2(16) MAKE_RAS_DEPTH2(17) MAKE_RAS_DEPTH2(18) MAKE_RAS_DEPTH2(19) MAKE_RAS_DEPTH2(20) MAKE_RAS_DEPTH2(21) MAKE_RAS_DEPTH2(22) MAKE_RAS_DEPTH2(23) MAKE_RAS_DEPTH2(24)*/ /* void ras_depth_clobber_1() { T_BODY("ras depth2 2 1", "call ras_depth2_2; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 3 1", "call ras_depth2_3; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 4 1", "call ras_depth2_4; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 5 1", "call ras_depth2_5; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 6 1", "call ras_depth2_6; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 7 1", "call ras_depth2_7; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 8 1", "call ras_depth2_8; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 9 1", "call ras_depth2_9; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 10 1", "call ras_depth2_10; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 11 1", "call ras_depth2_11; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 12 1", "call ras_depth2_12; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 13 1", "call ras_depth2_13; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 14 1", "call ras_depth2_14; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 15 1", "call ras_depth2_15; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 16 1", "call ras_depth2_16; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 17 1", "call ras_depth2_17; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 18 1", "call ras_depth2_18; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 19 1", "call ras_depth2_19; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 20 1", "call ras_depth2_20; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 21 1", "call ras_depth2_21; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 22 1", "call ras_depth2_22; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 23 1", "call ras_depth2_23; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 24 1", "call ras_depth2_24; call ras_depth3_1; 1: jmp 1b\n"); } void ras_depth_clobber2x_1() { T_BODY("ras depth2 2 1", "call ras_depth2_2; call ras_depth_1; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 3 1", "call ras_depth2_3; call ras_depth_1; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 4 1", "call ras_depth2_4; call ras_depth_1; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 5 1", "call ras_depth2_5; call ras_depth_1; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 6 1", "call ras_depth2_6; call ras_depth_1; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 7 1", "call ras_depth2_7; call ras_depth_1; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 8 1", "call ras_depth2_8; call ras_depth_1; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 9 1", "call ras_depth2_9; call ras_depth_1; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 10 1", "call ras_depth2_10; call ras_depth_1; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 11 1", "call ras_depth2_11; call ras_depth_1; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 12 1", "call ras_depth2_12; call ras_depth_1; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 13 1", "call ras_depth2_13; call ras_depth_1; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 14 1", "call ras_depth2_14; call ras_depth_1; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 15 1", "call ras_depth2_15; call ras_depth_1; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 16 1", "call ras_depth2_16; call ras_depth_1; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 17 1", "call ras_depth2_17; call ras_depth_1; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 18 1", "call ras_depth2_18; call ras_depth_1; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 19 1", "call ras_depth2_19; call ras_depth_1; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 20 1", "call ras_depth2_20; call ras_depth_1; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 21 1", "call ras_depth2_21; call ras_depth_1; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 22 1", "call ras_depth2_22; call ras_depth_1; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 23 1", "call ras_depth2_23; call ras_depth_1; call ras_depth3_1; 1: jmp 1b\n"); T_BODY("ras depth2 24 1", "call ras_depth2_24; call ras_depth_1; call ras_depth3_1; 1: jmp 1b\n"); } */ #define MAKE_RAS_SPECCLOBBER(N) \ void ras_depth_specclobber_##N()\ {\ if (AMT>-1) T_BODY("2, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_1 ; ret; ret; ret; 1:\n"); \ if (AMT>-2) T_BODY("3, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_2 ; ret; ret; 1:\n"); \ if (AMT>-3) T_BODY("4, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_3 ; ret; ret; 1:\n"); \ if (AMT>-4) T_BODY("5, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_4 ; ret; ret; 1:\n"); \ if (AMT>-5) T_BODY("6, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_5 ; ret; ret; 1:\n"); \ if (AMT>-6) T_BODY("7, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_6 ; ret; ret; 1:\n"); \ if (AMT>-7) T_BODY("8, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_7 ; ret; ret; 1:\n"); \ if (AMT>-8) T_BODY("9, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_8 ; ret; ret; 1:\n"); \ if (AMT>-9) T_BODY("10, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_9 ; ret; ret; 1:\n"); \ if (AMT>-10) T_BODY("11, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_10 ; ret; ret; 1:\n"); \ if (AMT>-11) T_BODY("12, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_11 ; ret; ret; 1:\n"); \ if (AMT>-12) T_BODY("13, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_12 ; ret; ret; 1:\n"); \ if (AMT>-13) T_BODY("14, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_13 ; ret; ret; 1:\n"); \ if (AMT>-14) T_BODY("15, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_14 ; ret; ret; 1:\n"); \ if (AMT>-15) T_BODY("16, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_15 ; ret; ret; 1:\n"); \ if (AMT>-16) T_BODY("17, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_16 ; ret; ret; 1:\n"); \ if (AMT>-17) T_BODY("18, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_17 ; ret; ret; 1:\n"); \ if (AMT>-18) T_BODY("19, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_18 ; ret; ret; 1:\n"); \ if (AMT>-19) T_BODY("20, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_19 ; ret; ret; 1:\n"); \ if (AMT>-20) T_BODY("21, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_20 ; ret; ret; 1:\n"); \ if (AMT>-21) T_BODY("22, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_21 ; ret; ret; 1:\n"); \ if (AMT>-22) T_BODY("23, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_22 ; ret; ret; 1:\n"); \ if (AMT>-23) T_BODY("24, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_23 ; ret; ret; 1:\n"); \ if (AMT>-24) T_BODY("25, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_24 ; ret; ret; 1:\n"); \ if (AMT>-25) T_BODY("26, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_25 ; ret; ret; 1:\n"); \ if (AMT>-26) T_BODY("27, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_26 ; ret; ret; 1:\n"); \ if (AMT>-27) T_BODY("28, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_27 ; ret; ret; 1:\n"); \ if (AMT>-28) T_BODY("29, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_28 ; ret; ret; 1:\n"); \ if (AMT>-29) T_BODY("30, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_29 ; ret; ret; 1:\n"); \ if (AMT>-30) T_BODY("31, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_30 ; ret; ret; 1:\n"); \ if (AMT>-31) T_BODY("32, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_31 ; ret; ret; 1:\n"); \ if (AMT>-32) T_BODY("33, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_32 ; ret; ret; 1:\n"); \ if (AMT>-33) T_BODY("34, " #N, "call 1f; call ras_clobber_" #N "; 1: movl $1f, (%%esp); call ras_depth2_33 ; ret; ret; 1:\n"); \ } #if SPECCLOBBER MAKE_RAS_SPECCLOBBER(1) MAKE_RAS_SPECCLOBBER(2) MAKE_RAS_SPECCLOBBER(3) MAKE_RAS_SPECCLOBBER(4) MAKE_RAS_SPECCLOBBER(5) MAKE_RAS_SPECCLOBBER(6) MAKE_RAS_SPECCLOBBER(7) MAKE_RAS_SPECCLOBBER(8) MAKE_RAS_SPECCLOBBER(9) MAKE_RAS_SPECCLOBBER(10) MAKE_RAS_SPECCLOBBER(11) MAKE_RAS_SPECCLOBBER(12) MAKE_RAS_SPECCLOBBER(13) MAKE_RAS_SPECCLOBBER(14) MAKE_RAS_SPECCLOBBER(15) MAKE_RAS_SPECCLOBBER(16) MAKE_RAS_SPECCLOBBER(17) MAKE_RAS_SPECCLOBBER(18) MAKE_RAS_SPECCLOBBER(19) MAKE_RAS_SPECCLOBBER(20) MAKE_RAS_SPECCLOBBER(21) MAKE_RAS_SPECCLOBBER(22) MAKE_RAS_SPECCLOBBER(23) MAKE_RAS_SPECCLOBBER(24) MAKE_RAS_SPECCLOBBER(25) MAKE_RAS_SPECCLOBBER(26) MAKE_RAS_SPECCLOBBER(27) MAKE_RAS_SPECCLOBBER(28) MAKE_RAS_SPECCLOBBER(29) MAKE_RAS_SPECCLOBBER(30) MAKE_RAS_SPECCLOBBER(31) MAKE_RAS_SPECCLOBBER(32) MAKE_RAS_SPECCLOBBER(33) MAKE_RAS_SPECCLOBBER(34) MAKE_RAS_SPECCLOBBER(35) MAKE_RAS_SPECCLOBBER(36) MAKE_RAS_SPECCLOBBER(37) MAKE_RAS_SPECCLOBBER(38) MAKE_RAS_SPECCLOBBER(39) MAKE_RAS_SPECCLOBBER(40) /* MAKE_RAS_SPECCLOBBER(41) MAKE_RAS_SPECCLOBBER(42) MAKE_RAS_SPECCLOBBER(43) MAKE_RAS_SPECCLOBBER(44) MAKE_RAS_SPECCLOBBER(45) MAKE_RAS_SPECCLOBBER(46) MAKE_RAS_SPECCLOBBER(47) MAKE_RAS_SPECCLOBBER(48) MAKE_RAS_SPECCLOBBER(49) MAKE_RAS_SPECCLOBBER(50) MAKE_RAS_SPECCLOBBER(51) MAKE_RAS_SPECCLOBBER(52) MAKE_RAS_SPECCLOBBER(53) MAKE_RAS_SPECCLOBBER(54) MAKE_RAS_SPECCLOBBER(55) MAKE_RAS_SPECCLOBBER(56) MAKE_RAS_SPECCLOBBER(57) MAKE_RAS_SPECCLOBBER(58) MAKE_RAS_SPECCLOBBER(59) MAKE_RAS_SPECCLOBBER(60) MAKE_RAS_SPECCLOBBER(61) MAKE_RAS_SPECCLOBBER(62) MAKE_RAS_SPECCLOBBER(63) MAKE_RAS_SPECCLOBBER(64)*/ void ras_depth_specclobber_0() { // Prefetch the code by running all of it once before the test. asm("call ras_depth2_39"); if (AMT>-1) T_BODY("2, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_1 ; ret; ret; nop; ret; 1:\n"); if (AMT>-2) T_BODY("3, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_2 ; ret; ret; 1:\n"); if (AMT>-3) T_BODY("4, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_3 ; ret; ret; 1:\n"); if (AMT>-4) T_BODY("5, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_4 ; ret; ret; 1:\n"); if (AMT>-5) T_BODY("6, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_5 ; ret; ret; 1:\n"); if (AMT>-6) T_BODY("7, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_6 ; ret; ret; 1:\n"); if (AMT>-7) T_BODY("8, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_7 ; ret; ret; 1:\n"); if (AMT>-8) T_BODY("9, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_8 ; ret; ret; 1:\n"); if (AMT>-9) T_BODY("10, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_9 ; ret; ret; 1:\n"); if (AMT>-10) T_BODY("11, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_10 ; ret; ret; 1:\n"); if (AMT>-11) T_BODY("12, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_11 ; ret; ret; 1:\n"); if (AMT>-12) T_BODY("13, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_12 ; ret; ret; 1:\n"); if (AMT>-13) T_BODY("14, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_13 ; ret; ret; 1:\n"); if (AMT>-14) T_BODY("15, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_14 ; ret; ret; 1:\n"); if (AMT>-15) T_BODY("16, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_15 ; ret; ret; 1:\n"); if (AMT>-16) T_BODY("17, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_16 ; ret; ret; 1:\n"); if (AMT>-17) T_BODY("18, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_17 ; ret; ret; 1:\n"); if (AMT>-18) T_BODY("19, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_18 ; ret; ret; 1:\n"); if (AMT>-19) T_BODY("20, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_19 ; ret; ret; 1:\n"); if (AMT>-20) T_BODY("21, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_20 ; ret; ret; 1:\n"); if (AMT>-21) T_BODY("22, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_21 ; ret; ret; 1:\n"); if (AMT>-22) T_BODY("23, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_22 ; ret; ret; 1:\n"); if (AMT>-23) T_BODY("24, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_23 ; ret; ret; 1:\n"); if (AMT>-24) T_BODY("25, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_24 ; ret; ret; 1:\n"); if (AMT>-25) T_BODY("26, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_25 ; ret; ret; 1:\n"); if (AMT>-26) T_BODY("27, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_26 ; ret; ret; 1:\n"); if (AMT>-27) T_BODY("28, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_27 ; ret; ret; 1:\n"); if (AMT>-28) T_BODY("29, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_28 ; ret; ret; 1:\n"); if (AMT>-29) T_BODY("30, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_29 ; ret; ret; 1:\n"); if (AMT>-30) T_BODY("31, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_30 ; ret; ret; 1:\n"); if (AMT>-31) T_BODY("32, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_31 ; ret; ret; 1:\n"); if (AMT>-32) T_BODY("33, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_32 ; ret; ret; 1:\n"); if (AMT>-33) T_BODY("34, 0", "call 1f; 3: jmp 3b; 1: movl $1f, (%%esp); call ras_depth2_33 ; ret; ret; 1:\n"); } void ras_depth_specclobber_inf() { if (AMT>-1) T_BODY("2, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_1 ; ret; ret; nop; ret; 1:\n"); if (AMT>-2) T_BODY("3, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_2 ; ret; ret; 1:\n"); if (AMT>-3) T_BODY("4, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_3 ; ret; ret; 1:\n"); if (AMT>-4) T_BODY("5, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_4 ; ret; ret; 1:\n"); if (AMT>-5) T_BODY("6, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_5 ; ret; ret; 1:\n"); if (AMT>-6) T_BODY("7, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_6 ; ret; ret; 1:\n"); if (AMT>-7) T_BODY("8, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_7 ; ret; ret; 1:\n"); if (AMT>-8) T_BODY("9, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_8 ; ret; ret; 1:\n"); if (AMT>-9) T_BODY("10, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_9 ; ret; ret; 1:\n"); if (AMT>-10) T_BODY("11, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_10 ; ret; ret; 1:\n"); if (AMT>-11) T_BODY("12, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_11 ; ret; ret; 1:\n"); if (AMT>-12) T_BODY("13, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_12 ; ret; ret; 1:\n"); if (AMT>-13) T_BODY("14, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_13 ; ret; ret; 1:\n"); if (AMT>-14) T_BODY("15, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_14 ; ret; ret; 1:\n"); if (AMT>-15) T_BODY("16, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_15 ; ret; ret; 1:\n"); if (AMT>-16) T_BODY("17, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_16 ; ret; ret; 1:\n"); if (AMT>-17) T_BODY("18, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_17 ; ret; ret; 1:\n"); if (AMT>-18) T_BODY("19, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_18 ; ret; ret; 1:\n"); if (AMT>-19) T_BODY("20, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_19 ; ret; ret; 1:\n"); if (AMT>-20) T_BODY("21, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_20 ; ret; ret; 1:\n"); if (AMT>-21) T_BODY("22, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_21 ; ret; ret; 1:\n"); if (AMT>-22) T_BODY("23, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_22 ; ret; ret; 1:\n"); if (AMT>-23) T_BODY("24, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_23 ; ret; ret; 1:\n"); if (AMT>-24) T_BODY("25, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_24 ; ret; ret; 1:\n"); if (AMT>-25) T_BODY("26, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_25 ; ret; ret; 1:\n"); if (AMT>-26) T_BODY("27, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_26 ; ret; ret; 1:\n"); if (AMT>-27) T_BODY("28, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_27 ; ret; ret; 1:\n"); if (AMT>-28) T_BODY("29, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_28 ; ret; ret; 1:\n"); if (AMT>-29) T_BODY("30, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_29 ; ret; ret; 1:\n"); if (AMT>-30) T_BODY("31, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_30 ; ret; ret; 1:\n"); if (AMT>-31) T_BODY("32, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_31 ; ret; ret; 1:\n"); if (AMT>-32) T_BODY("33, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_32 ; ret; ret; 1:\n"); if (AMT>-33) T_BODY("34, 42", "call 1f; call ras_clobber_inf; 1: movl $1f, (%%esp); call ras_depth2_33 ; ret; ret; 1:\n"); } void ras_depth_specclobber_inf2() { if (AMT>-1) T_BODY("2, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_1 ; ret; ret; nop; ret; 1:\n"); if (AMT>-2) T_BODY("3, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_2 ; ret; ret; 1:\n"); if (AMT>-3) T_BODY("4, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_3 ; ret; ret; 1:\n"); if (AMT>-4) T_BODY("5, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_4 ; ret; ret; 1:\n"); if (AMT>-5) T_BODY("6, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_5 ; ret; ret; 1:\n"); if (AMT>-6) T_BODY("7, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_6 ; ret; ret; 1:\n"); if (AMT>-7) T_BODY("8, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_7 ; ret; ret; 1:\n"); if (AMT>-8) T_BODY("9, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_8 ; ret; ret; 1:\n"); if (AMT>-9) T_BODY("10, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_9 ; ret; ret; 1:\n"); if (AMT>-10) T_BODY("11, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_10 ; ret; ret; 1:\n"); if (AMT>-11) T_BODY("12, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_11 ; ret; ret; 1:\n"); if (AMT>-12) T_BODY("13, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_12 ; ret; ret; 1:\n"); if (AMT>-13) T_BODY("14, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_13 ; ret; ret; 1:\n"); if (AMT>-14) T_BODY("15, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_14 ; ret; ret; 1:\n"); if (AMT>-15) T_BODY("16, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_15 ; ret; ret; 1:\n"); if (AMT>-16) T_BODY("17, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_16 ; ret; ret; 1:\n"); if (AMT>-17) T_BODY("18, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_17 ; ret; ret; 1:\n"); if (AMT>-18) T_BODY("19, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_18 ; ret; ret; 1:\n"); if (AMT>-19) T_BODY("20, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_19 ; ret; ret; 1:\n"); if (AMT>-20) T_BODY("21, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_20 ; ret; ret; 1:\n"); if (AMT>-21) T_BODY("22, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_21 ; ret; ret; 1:\n"); if (AMT>-22) T_BODY("23, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_22 ; ret; ret; 1:\n"); if (AMT>-23) T_BODY("24, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_23 ; ret; ret; 1:\n"); if (AMT>-24) T_BODY("25, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_24 ; ret; ret; 1:\n"); if (AMT>-25) T_BODY("26, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_25 ; ret; ret; 1:\n"); if (AMT>-26) T_BODY("27, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_26 ; ret; ret; 1:\n"); if (AMT>-27) T_BODY("28, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_27 ; ret; ret; 1:\n"); if (AMT>-28) T_BODY("29, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_28 ; ret; ret; 1:\n"); if (AMT>-29) T_BODY("30, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_29 ; ret; ret; 1:\n"); if (AMT>-30) T_BODY("31, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_30 ; ret; ret; 1:\n"); if (AMT>-31) T_BODY("32, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_31 ; ret; ret; 1:\n"); if (AMT>-32) T_BODY("33, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_32 ; ret; ret; 1:\n"); if (AMT>-33) T_BODY("34, 43", "call 1f; jmp ras_clobber_inf2; 1: movl $1f, (%%esp); call ras_depth2_33 ; ret; ret; 1:\n"); } #endif // if SPECCLOBBER int main() { #if !SPECCLOBBER calibrate_timer(); #endif #if 1 t_call_ret(); t_jmp_ret(); t_call_jmp(); t_jmp_jmp(); //t_call_nopret(); t_call_add0(); t_call_add1(); t_call4_ret(); t_jmp4_ret(); t_call4_jmp(); t_jmp4_jmp(); //t_call_nopret(); t_call4_add0(); t_call4_add1(); #endif #if 1 ras_depth(); printf ("\n\n"); ras_depth_misalign(); printf ("\n\n"); ras_depth_mispredict(); printf ("\n\n"); ras_depth_mispredict_delay(); printf ("\n\n"); #if (!BTBMISS) ras_depth_mispredict_delay_lessspec(); printf ("\n\n"); #endif ras_depth_vianano(); printf ("\n\n"); ras_depth_misalign_nano(); printf ("\n\n"); ras_depth_mispredict_nano(); printf ("\n\n"); ras_depth_call0(); printf ("\n\n"); ras_depth_call0b(); printf ("\n\n"); ras_depth_call0_nano(); printf ("\n\n"); ras_depth_call0b_nano(); #endif /*ras_depth_clobber_1(); ras_depth_clobber_2(); ras_depth_clobber_3(); ras_depth_clobber_4(); ras_depth_clobber_5(); ras_depth_clobber_6(); ras_depth_clobber_7(); ras_depth_clobber_8(); ras_depth_clobber_9(); ras_depth_clobber_10(); ras_depth_clobber_11(); ras_depth_clobber_12(); ras_depth_clobber_13(); ras_depth_clobber_14(); ras_depth_clobber_15(); ras_depth_clobber_16(); ras_depth_clobber_17(); ras_depth_clobber_18(); ras_depth_clobber_19(); ras_depth_clobber_20(); ras_depth_clobber_21(); ras_depth_clobber_22(); ras_depth_clobber_23(); ras_depth_clobber_24(); */ /*ras_depth_clobber2x_1(); ras_depth_clobber2x_2(); ras_depth_clobber2x_3(); ras_depth_clobber2x_4(); ras_depth_clobber2x_5(); ras_depth_clobber2x_6(); ras_depth_clobber2x_7(); ras_depth_clobber2x_8(); ras_depth_clobber2x_9(); ras_depth_clobber2x_10(); ras_depth_clobber2x_11(); ras_depth_clobber2x_12(); ras_depth_clobber2x_13(); ras_depth_clobber2x_14(); ras_depth_clobber2x_15(); ras_depth_clobber2x_16(); ras_depth_clobber2x_17(); ras_depth_clobber2x_18(); ras_depth_clobber2x_19(); ras_depth_clobber2x_20(); ras_depth_clobber2x_21(); ras_depth_clobber2x_22(); ras_depth_clobber2x_23(); ras_depth_clobber2x_24();*/ //mprotect(ras_depth2_1, 4096, PROT_READ|PROT_WRITE|PROT_EXEC); #if SPECCLOBBER printf ("Depth,Clobber,Min,Max,Clocks,Clocks2\n"); ras_depth_specclobber_0(); ras_depth_specclobber_1(); ras_depth_specclobber_2(); ras_depth_specclobber_3(); ras_depth_specclobber_4(); ras_depth_specclobber_5(); ras_depth_specclobber_6(); ras_depth_specclobber_7(); ras_depth_specclobber_8(); ras_depth_specclobber_9(); ras_depth_specclobber_10(); ras_depth_specclobber_11(); ras_depth_specclobber_12(); ras_depth_specclobber_13(); ras_depth_specclobber_14(); ras_depth_specclobber_15(); ras_depth_specclobber_16(); ras_depth_specclobber_17(); ras_depth_specclobber_18(); ras_depth_specclobber_19(); ras_depth_specclobber_20(); ras_depth_specclobber_21(); ras_depth_specclobber_22(); ras_depth_specclobber_23(); ras_depth_specclobber_24(); ras_depth_specclobber_25(); ras_depth_specclobber_26(); ras_depth_specclobber_27(); ras_depth_specclobber_28(); ras_depth_specclobber_29(); ras_depth_specclobber_30(); ras_depth_specclobber_31(); ras_depth_specclobber_32(); ras_depth_specclobber_33(); ras_depth_specclobber_34(); ras_depth_specclobber_35(); ras_depth_specclobber_36(); ras_depth_specclobber_37(); ras_depth_specclobber_38(); ras_depth_specclobber_39(); ras_depth_specclobber_40(); ras_depth_specclobber_inf(); //ras_depth_specclobber_inf2(); #else printf ("ras_depth_specclobber test not compiled. #define SPECCLOBBER 1 to enable.\n"); #endif }