[Mesa-dev] [PATCH] llvmpipe: add cc clobber to inline asm
Grazvydas Ignotas
notasas at gmail.com
Mon Aug 20 21:31:52 UTC 2018
The bsr instruction modifies flags, so that needs to be indicated to the
compiler. No effect on generated code, but still needed for correctness.
---
src/gallium/drivers/llvmpipe/lp_setup_tri.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
index cec6198ec63..1852ec05d56 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
@@ -732,11 +732,12 @@ floor_pot(uint32_t n)
if (n == 0)
return 0;
__asm__("bsr %1,%0"
: "=r" (n)
- : "rm" (n));
+ : "rm" (n)
+ : "cc");
return 1 << n;
#else
n |= (n >> 1);
n |= (n >> 2);
n |= (n >> 4);
--
2.17.1
More information about the mesa-dev
mailing list