This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Algol Front end


Table lookup is not the way to go for packed decimal addition.

Basically you want to do a standard addition, and then deal with the carries.

There are two cases of carries

1. Where there is a carry out of the four bits. Two subcases here
     100? + 100? => overflow, easily detected by an AND

     1001 + 0111 (or vice versa), detectable by some sequence of logical
     fiddling

2. Where the carry is within the four bits, i.e. the result is 11?? or 101?
    (again detectable by some logical fiddling)

That's as far as I have time to get right now, but starting from this, you
can figure out a series of logical operations to effect the carry adjust.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]