Skip to content

Commit

Permalink
[parc][amo] Reverting changes to pydgin.utils and use trim_32 for uns…
Browse files Browse the repository at this point in the history
…igned

#32 (comment)
  • Loading branch information
hawajkm committed Mar 28, 2016
1 parent 987e505 commit 441aac4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
6 changes: 3 additions & 3 deletions parc/isa.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#=======================================================================

from utils import trim_5
from pydgin.utils import signed , unsigned , sext_16 , sext_8, \
trim_32, bits2float, float2bits, r_uint
from pydgin.utils import signed , sext_16 , sext_8, trim_32, \
bits2float, float2bits, r_uint

from pydgin.misc import create_risc_decoder, FatalError

Expand Down Expand Up @@ -783,7 +783,7 @@ def execute_amo_xchg( s, inst ):
#-----------------------------------------------------------------------
def execute_amo_min( s, inst ):
temp = s.mem.read( s.rf[ inst.rs ], 4 )
s.mem.write( s.rf[inst.rs], 4, unsigned( min( signed( temp ), signed( s.rf[inst.rt] ) ) ) )
s.mem.write( s.rf[inst.rs], 4, trim_32( min( signed( temp ), signed( s.rf[inst.rt] ) ) ) )
s.rf[ inst.rd ] = temp
s.pc += 4

Expand Down
9 changes: 0 additions & 9 deletions pydgin/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,6 @@ def signed( value ):
return -intmask( trim_32( twos_complement ) )
return intmask( value )

#-----------------------------------------------------------------------
# unsigned
#-----------------------------------------------------------------------
def unsigned( value ):
temp = value
if temp < 0:
temp = (2**32) + temp
return intmask( temp )

#-----------------------------------------------------------------------
# trim_32
#-----------------------------------------------------------------------
Expand Down

0 comments on commit 441aac4

Please sign in to comment.