i386-pf-athlon-1.c

来自「gcc-you can use this code to learn somet」· C语言 代码 · 共 30 行

C
30
字号
/* Test that the correct data prefetch instructions are generated for i386   variants that use 3DNow! prefetchw or SSE prefetch instructions with   locality hints.  *//* { dg-do compile { target i?86-*-* } } */char *msg = "howdy there";void foo (char *p){  __builtin_prefetch (p, 0, 0);  __builtin_prefetch (p, 0, 1);  __builtin_prefetch (p, 0, 2);  __builtin_prefetch (p, 0, 3);  __builtin_prefetch (p, 1, 0);  __builtin_prefetch (p, 1, 1);  __builtin_prefetch (p, 1, 2);  __builtin_prefetch (p, 1, 3);}int main (){  foo (msg);  exit (0);}/* { dg-final { scan-assembler "prefetchw" } } *//* { dg-final { scan-assembler "prefetchnta" } } *//* { dg-final { scan-assembler "prefetcht" } } */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?