2525qblas_dot (size_t n, Sleef_quad *x, size_t incx,
2626 Sleef_quad *y, size_t incy, Sleef_quad *result)
2727{
28- if (!x || !y || !result || n == 0 ) {
28+ if (!result) {
29+ return -1 ;
30+ }
31+ if (n == 0 ) {
32+ *result = Sleef_cast_from_doubleq1 (0.0 );
33+ return 0 ;
34+ }
35+ if (!x || !y) {
2936 return -1 ;
3037 }
3138 *result = cblas_qdot ((int )n, x, (int )incx, y, (int )incy);
@@ -38,7 +45,10 @@ qblas_gemv(char layout, char trans, size_t m, size_t n,
3845 Sleef_quad *x, size_t incx,
3946 Sleef_quad *beta, Sleef_quad *y, size_t incy)
4047{
41- if (!alpha || !A || !x || !beta || !y || m == 0 || n == 0 ) {
48+ if (m == 0 || n == 0 ) {
49+ return 0 ;
50+ }
51+ if (!alpha || !A || !x || !beta || !y) {
4252 return -1 ;
4353 }
4454 cblas_qgemv (to_layout (layout), to_trans (trans),
@@ -56,7 +66,10 @@ qblas_gemm(char layout, char transa, char transb,
5666 Sleef_quad *B, size_t ldb,
5767 Sleef_quad *beta, Sleef_quad *C, size_t ldc)
5868{
59- if (!alpha || !A || !B || !beta || !C || m == 0 || n == 0 || k == 0 ) {
69+ if (m == 0 || n == 0 || k == 0 ) {
70+ return 0 ;
71+ }
72+ if (!alpha || !A || !B || !beta || !C) {
6073 return -1 ;
6174 }
6275 cblas_qgemm (to_layout (layout), to_trans (transa), to_trans (transb),
0 commit comments