Hi Philipp:

Could you add zihintpause to -march parser and guard that on the
pattern and builtin like zifencei[1-2]?

And could you sent a PR to
https://github.com/riscv/riscv-c-api-doc/blob/master/riscv-c-api.md to
mention __builtin_riscv_pause?

Thanks!

[1] march parser change:
https://github.com/gcc-mirror/gcc/commit/b03be74bad08c382da47e048007a78fa3fb4ef49
[2] Default version for ext.:
https://github.com/gcc-mirror/gcc/commit/4b81528241ca682025d92558ff6aeec91dafdca8


> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/riscv/builtin_pause.c
> @@ -0,0 +1,10 @@
> +/* { dg-do compile } */
> +/* { dg-options "-O2" }  */
> +
> +void test_pause()

I would suggest you change the function name in the testcase,
otherwise the scan-assembler test will always pass even if you didn't
generate "pause" instruction.


> +{
> +  __builtin_riscv_pause ();
> +}
> +
> +/* { dg-final { scan-assembler "pause" } } */
> +
> --
> 2.18.4
>

Reply via email to