fix float to u64 intrinsics
reverts commit
310e3b428c
(more info there)
now functions check for
sign bit in float.
now hopefully this patch will
cover entirety of areas it might affect
			
			
This commit is contained in:
		
							parent
							
								
									60c1f70bb9
								
							
						
					
					
						commit
						618ba55a81
					
				
					 2 changed files with 27 additions and 10 deletions
				
			
		| 
						 | 
				
			
			@ -543,8 +543,14 @@ unsigned long long __fixunssfdi (float a1)
 | 
			
		|||
    if (exp >= 41)
 | 
			
		||||
	    return (unsigned long long)-1;
 | 
			
		||||
    else if (exp >= 0)
 | 
			
		||||
	    if(SIGN(fl1.l))
 | 
			
		||||
		    return (unsigned long long)-(l << exp);
 | 
			
		||||
	    else
 | 
			
		||||
		    return (unsigned long long)l << exp;
 | 
			
		||||
    else if (exp >= -23)
 | 
			
		||||
	    if(SIGN(fl1.l))
 | 
			
		||||
		    return -(l >> -exp);
 | 
			
		||||
	    else
 | 
			
		||||
		    return l >> -exp;
 | 
			
		||||
    else
 | 
			
		||||
	    return 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -575,8 +581,14 @@ unsigned long long __fixunsdfdi (double a1)
 | 
			
		|||
    if (exp >= 12)
 | 
			
		||||
	    return (unsigned long long)-1;
 | 
			
		||||
    else if (exp >= 0)
 | 
			
		||||
	    if(SIGND(dl1))
 | 
			
		||||
		    return -(l >> exp);
 | 
			
		||||
	    else
 | 
			
		||||
		    return l << exp;
 | 
			
		||||
    else if (exp >= -52)
 | 
			
		||||
	    if(SIGND(dl1))
 | 
			
		||||
		    return -(l >> -exp);
 | 
			
		||||
	    else
 | 
			
		||||
		    return l >> -exp;
 | 
			
		||||
    else
 | 
			
		||||
	    return 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -608,7 +620,12 @@ unsigned long long __fixunsxfdi (long double a1)
 | 
			
		|||
    if (exp > 0)
 | 
			
		||||
	return (unsigned long long)-1;
 | 
			
		||||
    else if (exp >= -63) 
 | 
			
		||||
    {
 | 
			
		||||
	    if(SIGNLD(dl1))
 | 
			
		||||
		    return -(l >> -exp);
 | 
			
		||||
	    else
 | 
			
		||||
		    return l >> -exp;
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
        return 0;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								tccgen.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								tccgen.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -3478,7 +3478,7 @@ again:
 | 
			
		|||
                vtop->c.i = (vtop->c.ld != 0);
 | 
			
		||||
            } else {
 | 
			
		||||
                if(sf)
 | 
			
		||||
                    vtop->c.i = (int64_t)vtop->c.ld;
 | 
			
		||||
                    vtop->c.i = vtop->c.ld;
 | 
			
		||||
                else if (sbt_bt == VT_LLONG || (PTR_SIZE == 8 && sbt == VT_PTR))
 | 
			
		||||
                    ;
 | 
			
		||||
                else if (sbt & VT_UNSIGNED)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue