David Schneider avatar David Schneider committed a10cd0f

Add support for imm values in float load and store instructions

Comments (0)

Files changed (2)


         | 0x5 << 0x9
         | 0x1 << 0x8)
+    # The imm value for thins function has to be a multiple of 4,
+    # the value actually encoded is imm / 4
     def f(self, dd, rn, imm=0, cond=cond.AL):
+        assert imm % 4 == 0
+        imm = imm/4
         u, imm = self._encode_imm(imm)
         instr = ( n
                 | (cond & 0xF) << 28


         self.cb.VSUB(r.d1.value, r.d2.value, r.d3.value, conditions.GT)
         self.assert_equal("VSUBGT.F64 D1, D2, D3")
+    def test_vstr_offset(self):
+        assert py.test.raises(AssertionError, 'self.cb.VSTR(r.d1, r.r4, 3)')
     def test_pop_raises_on_lr(self):
         assert py.test.raises(AssertionError, 'self.cb.POP([r.lr.value])')
     tests = []
     for c,v in [('EQ', conditions.EQ), ('LE', conditions.LE), ('AL', conditions.AL)]:
         for reg in range(16):
-            if reg == 14:
-                tests.append(lambda self: py.test.skip('r14(lr) gives strange results'))
-                continue
-            for creg in range(16):
+            for creg in range(2):
                 asm = 'd%d, [r%d]' % (creg, reg)
                 tests.append((asm, (creg, reg)))
-                #asm = 'd%d, [r%d, #4]' % (creg, reg)
-                #tests.append((asm, (creg, reg, 4)))
+                asm = 'd%d, [r%d, #16]' % (creg, reg)
+                tests.append((asm, (creg, reg, 16)))
     return tests
 def gen_test_float64_data_proc_instructions_func(name, table):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.