multiply_and_divide.py (6503:843ec3da7584) | multiply_and_divide.py (6513:e2ffac65a76a) |
---|---|
1# Copyright (c) 2007 The Hewlett-Packard Development Company 2# All rights reserved. 3# 4# Redistribution and use of this software in source and binary forms, 5# with or without modification, are permitted provided that the 6# following conditions are met: 7# 8# The software must be used only for Non-Commercial Use which means any --- 663 unchanged lines hidden (view full) --- 672 sub t1, t0, rax, flags=(ECF,) 673 ruflag t4, 3 674 sub t2, t0, rdx 675 sub t2, t2, t4 676 677 ld t8, seg, sib, disp 678 679 #Find the sign of the divisor | 1# Copyright (c) 2007 The Hewlett-Packard Development Company 2# All rights reserved. 3# 4# Redistribution and use of this software in source and binary forms, 5# with or without modification, are permitted provided that the 6# following conditions are met: 7# 8# The software must be used only for Non-Commercial Use which means any --- 663 unchanged lines hidden (view full) --- 672 sub t1, t0, rax, flags=(ECF,) 673 ruflag t4, 3 674 sub t2, t0, rdx 675 sub t2, t2, t4 676 677 ld t8, seg, sib, disp 678 679 #Find the sign of the divisor |
680 #FIXME!!! This depends on shifts setting the carry flag correctly. | |
681 slli t0, t8, 1, flags=(ECF,) 682 683 # Negate divisor 684 sub t3, t0, t8 685 # Put the divisor's absolute value into t3 686 mov t3, t3, t8, flags=(nCECF,) 687 688 #Find the sign of the dividend | 680 slli t0, t8, 1, flags=(ECF,) 681 682 # Negate divisor 683 sub t3, t0, t8 684 # Put the divisor's absolute value into t3 685 mov t3, t3, t8, flags=(nCECF,) 686 687 #Find the sign of the dividend |
689 #FIXME!!! This depends on shifts setting the carry flag correctly. | |
690 slli t0, rdx, 1, flags=(ECF,) 691 692 # Put the dividend's absolute value into t1 and t2 693 mov t1, t1, rax, flags=(nCECF,) 694 mov t2, t2, rdx, flags=(nCECF,) 695 696 # Do the initial part of the division 697 div1 t2, t3 --- 50 unchanged lines hidden (view full) --- 748 ruflag t4, 3 749 sub t2, t0, rdx 750 sub t2, t2, t4 751 752 rdip t7 753 ld t8, seg, riprel, disp 754 755 #Find the sign of the divisor | 688 slli t0, rdx, 1, flags=(ECF,) 689 690 # Put the dividend's absolute value into t1 and t2 691 mov t1, t1, rax, flags=(nCECF,) 692 mov t2, t2, rdx, flags=(nCECF,) 693 694 # Do the initial part of the division 695 div1 t2, t3 --- 50 unchanged lines hidden (view full) --- 746 ruflag t4, 3 747 sub t2, t0, rdx 748 sub t2, t2, t4 749 750 rdip t7 751 ld t8, seg, riprel, disp 752 753 #Find the sign of the divisor |
756 #FIXME!!! This depends on shifts setting the carry flag correctly. | |
757 slli t0, t8, 1, flags=(ECF,) 758 759 # Negate divisor 760 sub t3, t0, t8 761 # Put the divisor's absolute value into t3 762 mov t3, t3, t4, flags=(nCECF,) 763 764 #Find the sign of the dividend | 754 slli t0, t8, 1, flags=(ECF,) 755 756 # Negate divisor 757 sub t3, t0, t8 758 # Put the divisor's absolute value into t3 759 mov t3, t3, t4, flags=(nCECF,) 760 761 #Find the sign of the dividend |
765 #FIXME!!! This depends on shifts setting the carry flag correctly. | |
766 slli t0, rdx, 1, flags=(ECF,) 767 768 # Put the dividend's absolute value into t1 and t2 769 mov t1, t1, rax, flags=(nCECF,) 770 mov t2, t2, rdx, flags=(nCECF,) 771 772 # Do the initial part of the division 773 div1 t2, t3 --- 46 unchanged lines hidden --- | 762 slli t0, rdx, 1, flags=(ECF,) 763 764 # Put the dividend's absolute value into t1 and t2 765 mov t1, t1, rax, flags=(nCECF,) 766 mov t2, t2, rdx, flags=(nCECF,) 767 768 # Do the initial part of the division 769 div1 t2, t3 --- 46 unchanged lines hidden --- |