mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-03 21:09:12 +00:00 
			
		
		
		
	Do not compute sign bit if result is zero
This commit is contained in:
		
							parent
							
								
									60c4887d15
								
							
						
					
					
						commit
						d2c33863d0
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -69,7 +69,6 @@ module \$mul (A, B, Y);
 | 
			
		|||
		);
 | 
			
		||||
	else if (A_SIGNED && (A_WIDTH > `DSP_A_MAXWIDTH || B_WIDTH > `DSP_B_MAXWIDTH)) begin
 | 
			
		||||
		wire _;
 | 
			
		||||
		assign Y[Y_WIDTH-1] = A[A_WIDTH-1] ^ B[B_WIDTH-1];
 | 
			
		||||
		\$__mul #(
 | 
			
		||||
			.A_SIGNED(A_SIGNED),
 | 
			
		||||
			.B_SIGNED(B_SIGNED),
 | 
			
		||||
| 
						 | 
				
			
			@ -81,6 +80,8 @@ module \$mul (A, B, Y);
 | 
			
		|||
			.B(B),
 | 
			
		||||
			.Y({_,Y[Y_WIDTH-2:0]})
 | 
			
		||||
		);
 | 
			
		||||
		// For non-zero results, recompute sign bit
 | 
			
		||||
		assign Y[Y_WIDTH-1] = (|Y[Y_WIDTH-2:0]) & (A[A_WIDTH-1] ^ B[B_WIDTH-1]);
 | 
			
		||||
	end
 | 
			
		||||
	else
 | 
			
		||||
		\$__mul #(
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue