Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tricore] float-point in DVADJ operand #19

Closed
esaulenka opened this issue Nov 25, 2019 · 2 comments
Closed

[tricore] float-point in DVADJ operand #19

esaulenka opened this issue Nov 25, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@esaulenka
Copy link

@mumbel, if you dont mind, i will continue describe bugs in tricore sleigh here.

Describe the bug
According to p-Code operation manual, abs() function, that used in dvadj constructor, dealing with float-point operands, but any values, used in dvinit / dvstep / dvadj should be integer.

To Reproduce
Look at decompiled function, that uses dvadj

Expected behavior
I didnt fully understand, how dvXXX works, but according to tricore architecture manual, it should be redone as follows:

:dvadj Ree2831/Reo2831,Ree2427/Reo2427,Rd1215 is PCPMode=0 & Rd1215 & op0007=0x6b & op0811=0x0 ; Ree2427 & Reo2427 & Ree2831 & Reo2831 & op1623=0xd0
{
	#TODO  divide sequence
	local quotient:4 = Ree2427;		# E[d]  0..31
	local remainder:4 = Reo2427;	# E[d] 32..63
	local divisor:4 = Rd1215;		# D[b]
	
	local x_sign = remainder[31,1];
 	local q_sign = quotient[31,1];

	if (q_sign) goto <no_inc_quot>;
		quotient = quotient + 1;
	<no_inc_quot>
	if (((remainder == divisor) || (remainder == - divisor)) && x_sign) goto <nonzero_remainder>;
		remainder = 0;
	<nonzero_remainder>
	Reo2831 = remainder;
	Ree2831 = quotient;
}
@esaulenka esaulenka added the bug Something isn't working label Nov 25, 2019
@mumbel
Copy link
Owner

mumbel commented Nov 25, 2019

It looks like the issue, across my whole implementation, is the usage of abs().

Hopefully this isn't in the wrong direction, but I have put a PR in NationalSecurityAgency#1286

@mumbel mumbel closed this as completed Dec 1, 2019
@mumbel
Copy link
Owner

mumbel commented Dec 10, 2019

Thanks again @esaulenka looks merged in master

mumbel pushed a commit that referenced this issue May 2, 2021
'origin/GP-786_ryanmkurtz_PR-1505_astrelsky_exporters' (Closes #19,
Closes NationalSecurityAgency#1501, Closes NationalSecurityAgency#1505)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants