Exemple #1
0
 def execute(self, processor):
     if processor.condition_passed():
         diff1 = processor.registers.get(
             self.n)[16:32].int - processor.registers.get(self.m)[16:32].int
         diff2 = processor.registers.get(
             self.n)[0:16].int - processor.registers.get(self.m)[0:16].int
         processor.registers.set(
             self.d,
             signed_sat(diff2, 16) + signed_sat(diff1, 16))
Exemple #2
0
 def execute(self, processor):
     if processor.condition_passed():
         n = processor.registers.get(self.n)
         m = processor.registers.get(self.m)
         sum_ = to_signed(substring(n, 15, 0), 16) + to_signed(
             substring(m, 31, 16), 16)
         diff = to_signed(substring(n, 31, 16), 16) - to_signed(
             substring(m, 15, 0), 16)
         d = set_substring(0, 15, 0, signed_sat(sum_, 16))
         d = set_substring(d, 31, 16, signed_sat(diff, 16))
         processor.registers.set(self.d, d)
Exemple #3
0
 def execute(self, processor):
     if processor.condition_passed():
         sum1 = processor.registers.get(
             self.n)[24:32].int + processor.registers.get(self.m)[24:32].int
         sum2 = processor.registers.get(
             self.n)[16:24].int + processor.registers.get(self.m)[16:24].int
         sum3 = processor.registers.get(
             self.n)[8:16].int + processor.registers.get(self.m)[8:16].int
         sum4 = processor.registers.get(
             self.n)[0:8].int + processor.registers.get(self.m)[0:8].int
         signed_sum = signed_sat(sum4, 8) + signed_sat(
             sum3, 8) + signed_sat(sum2, 8) + signed_sat(sum1, 8)
         processor.registers.set(self.d, signed_sum)
Exemple #4
0
 def execute(self, processor):
     if processor.condition_passed():
         diff1 = processor.registers.get(
             self.n)[24:32].int - processor.registers.get(self.m)[24:32].int
         diff2 = processor.registers.get(
             self.n)[16:24].int - processor.registers.get(self.m)[16:24].int
         diff3 = processor.registers.get(
             self.n)[8:16].int - processor.registers.get(self.m)[8:16].int
         diff4 = processor.registers.get(
             self.n)[0:8].int - processor.registers.get(self.m)[0:8].int
         processor.registers.set(
             self.d,
             signed_sat(diff4, 8) + signed_sat(diff3, 8) +
             signed_sat(diff2, 8) + signed_sat(diff1, 8))
Exemple #5
0
 def execute(self, processor):
     if processor.condition_passed():
         n = processor.registers.get(self.n)
         m = processor.registers.get(self.m)
         diff1 = to_signed(substring(n, 7, 0), 8) - to_signed(
             substring(m, 7, 0), 8)
         diff2 = to_signed(substring(n, 15, 8), 8) - to_signed(
             substring(m, 15, 8), 8)
         diff3 = to_signed(substring(n, 23, 16), 8) - to_signed(
             substring(m, 23, 16), 8)
         diff4 = to_signed(substring(n, 31, 24), 8) - to_signed(
             substring(m, 31, 24), 8)
         d = set_substring(0, 7, 0, signed_sat(diff1, 8))
         d = set_substring(d, 15, 8, signed_sat(diff2, 8))
         d = set_substring(d, 23, 16, signed_sat(diff3, 8))
         d = set_substring(d, 31, 24, signed_sat(diff4, 8))
         processor.registers.set(self.d, d)
Exemple #6
0
 def execute(self, processor):
     if processor.condition_passed():
         sum1 = processor.registers.get(self.n)[16:32].int + processor.registers.get(self.m)[16:32].int
         sum2 = processor.registers.get(self.n)[0:16].int + processor.registers.get(self.m)[0:16].int
         processor.registers.set(self.d, signed_sat(sum2, 16) + signed_sat(sum1, 16))