Fix missing clobber in x86/x86_64 blas_quickdivide inline assembly function (#2017)
authorMartin Kroeker <martin@ruby.chemie.uni-freiburg.de>
Thu, 14 Feb 2019 14:21:36 +0000 (15:21 +0100)
committerGitHub <noreply@github.com>
Thu, 14 Feb 2019 14:21:36 +0000 (15:21 +0100)
* Fix missing clobber in blas_quickdivide assembly

common_x86.h
common_x86_64.h

index 4f538c9..3fdffe2 100644 (file)
@@ -187,7 +187,7 @@ static __inline int blas_quickdivide(unsigned int x, unsigned int y){
        
   y = blas_quick_divide_table[y];
 
-  __asm__ __volatile__  ("mull %0" :"=d" (result) :"a"(x), "0" (y));
+  __asm__ __volatile__  ("mull %0" :"=d" (result), "+a"(x): "0" (y));
 
   return result;
 #endif
index f27c1e9..718a810 100644 (file)
@@ -210,7 +210,7 @@ static __inline int blas_quickdivide(unsigned int x, unsigned int y){
        
   y = blas_quick_divide_table[y];
 
-  __asm__ __volatile__  ("mull %0" :"=d" (result) :"a"(x), "0" (y));
+  __asm__ __volatile__  ("mull %0" :"=d" (result), "+a"(x) : "0" (y));
 
   return result;
 }