You've already forked FFmpeg
							
							
				mirror of
				https://github.com/FFmpeg/FFmpeg.git
				synced 2025-10-30 23:18:11 +02:00 
			
		
		
		
	riscv: fix scalar product initialisation
VSETVLI xd, x0, ...' has rather nonobvious semantics: - If xd is x0, then it preserves the current vector length. - If xd is not x0, it sets the vector length to the supported maximum. Also somewhat confusingly, while VMV.X.S always does its thing regardless of the selected vector length, VMV.S.X does _nothing_ if the selected vector length is zero. So the current code breaks fails to initialise the accumulator if we are unlucky to have a selected vector length of zero on entry. Fix it by forcing the vector length to one.
This commit is contained in:
		
				
					committed by
					
						 Lynne
						Lynne
					
				
			
			
				
	
			
			
			
						parent
						
							28ac2279ad
						
					
				
				
					commit
					96a83ceea4
				
			| @@ -21,7 +21,7 @@ | ||||
| #include "libavutil/riscv/asm.S" | ||||
|  | ||||
| func ff_scalarproduct_int16_rvv, zve32x | ||||
|         vsetvli     zero, zero, e16, m1, ta, ma | ||||
|         vsetivli    zero, 1, e16, m1, ta, ma | ||||
|         vmv.s.x     v8, zero | ||||
| 1: | ||||
|         vsetvli     t0, a2, e16, m1, ta, ma | ||||
|   | ||||
| @@ -166,7 +166,7 @@ endfunc | ||||
|  | ||||
| // a0 = (a0).(a1) [0..a2-1] | ||||
| func ff_scalarproduct_float_rvv, zve32f | ||||
|         vsetvli      zero, zero, e32, m1, ta, ma | ||||
|         vsetivli     zero, 1, e32, m1, ta, ma | ||||
|         vmv.s.x      v8, zero | ||||
| 1: | ||||
|         vsetvli      t0, a2, e32, m1, ta, ma | ||||
|   | ||||
		Reference in New Issue
	
	Block a user