mirror of
				https://github.com/hedge-dev/XenonRecomp.git
				synced 2025-10-30 07:11:38 +00:00 
			
		
		
		
	Handle float to integer conversion overflow.
This commit is contained in:
		
							parent
							
								
									7f43723ff0
								
							
						
					
					
						commit
						aef470a0f0
					
				
					 1 changed files with 4 additions and 4 deletions
				
			
		|  | @ -433,17 +433,17 @@ bool Recompiler::Recompile(const Function& fn, uint32_t base, const ppc_insn& in | |||
| 
 | ||||
|     case PPC_INST_FCTID: | ||||
|         println("\tctx.fpscr.setFlushMode(false);"); | ||||
|         println("\tctx.f{}.s64 = _mm_cvtsd_si64(_mm_load1_pd(&ctx.f{}.f64));", insn.operands[0], insn.operands[1]); | ||||
|         println("\tctx.f{}.s64 = (ctx.f{}.f64 > double(LLONG_MAX)) ? LLONG_MAX : _mm_cvtsd_si64(_mm_load1_pd(&ctx.f{}.f64));", insn.operands[0], insn.operands[1], insn.operands[1]); | ||||
|         break; | ||||
| 
 | ||||
|     case PPC_INST_FCTIDZ: | ||||
|         println("\tctx.fpscr.setFlushMode(false);"); | ||||
|         println("\tctx.f{}.s64 = _mm_cvttsd_si64(_mm_load1_pd(&ctx.f{}.f64));", insn.operands[0], insn.operands[1]); | ||||
|         println("\tctx.f{}.s64 = (ctx.f{}.f64 > double(LLONG_MAX)) ? LLONG_MAX : _mm_cvttsd_si64(_mm_load1_pd(&ctx.f{}.f64));", insn.operands[0], insn.operands[1], insn.operands[1]); | ||||
|         break; | ||||
| 
 | ||||
|     case PPC_INST_FCTIWZ: | ||||
|         println("\tctx.fpscr.setFlushMode(false);"); | ||||
|         println("\tctx.f{}.s64 = _mm_cvttsd_si32(_mm_load1_pd(&ctx.f{}.f64));", insn.operands[0], insn.operands[1]); | ||||
|         println("\tctx.f{}.s64 = (ctx.f{}.f64 > double(INT_MAX)) ? INT_MAX : _mm_cvttsd_si32(_mm_load1_pd(&ctx.f{}.f64));", insn.operands[0], insn.operands[1], insn.operands[1]); | ||||
|         break; | ||||
| 
 | ||||
|     case PPC_INST_FDIV: | ||||
|  | @ -518,7 +518,7 @@ bool Recompiler::Recompile(const Function& fn, uint32_t base, const ppc_insn& in | |||
| 
 | ||||
|     case PPC_INST_FRES: | ||||
|         println("\tctx.fpscr.setFlushMode(false);"); | ||||
|         println("\tctx.f{}.f64 = 1.0f / float(ctx.f{}.f64);", insn.operands[0], insn.operands[1]); | ||||
|         println("\tctx.f{}.f64 = float(1.0 / ctx.f{}.f64);", insn.operands[0], insn.operands[1]); | ||||
|         break; | ||||
| 
 | ||||
|     case PPC_INST_FRSP: | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Skyth
						Skyth