Commits

David Schneider committed 81fad4c

implement the read timestamp operation. But it only works in privileged mode. Bah.

Comments (0)

Files changed (4)

pypy/jit/backend/arm/instruction_builder.py

     n = (0x3 << 26 | (table['op1'] & 0x3F) << 20 | (table['op'] & 0x1) << 4)
 
     def f(self, coproc, opc1, rt, crn, crm, opc2=0, cond=cond.AL):
+        assert coproc & 0xE != 0xA
         self.write32(n
                     | cond << 28
                     | (opc1 & 0x7) << 21

pypy/jit/backend/arm/instructions.py

 
 supervisor_and_coproc = {
     'MCR': {'op1': 0x20, 'op': 1, 'rn':0, 'coproc':0},
+    'MRC': {'op1': 0x21, 'op': 1, 'rn':0, 'coproc':0},
 }
 
 block_data = {

pypy/jit/backend/arm/opassembler.py

         return fcond
 
     emit_op_convert_float_bytes_to_longlong = gen_emit_unary_float_op('float_bytes_to_longlong', 'VMOV_cc')
+
+    def emit_op_read_timestamp(self, op, arglocs, regalloc, fcond):
+	tmp = arglocs[0]
+        res = arglocs[1]
+        self.mc.MRC(15, 0, tmp.value, 15, 12, 1)
+	self.mc.MOV_ri(r.ip.value, 0)
+        self.mc.VMOV_cr(res.value, tmp.value, r.ip.value)
+        return fcond

pypy/jit/backend/arm/regalloc.py

     prepare_op_convert_float_bytes_to_longlong = prepare_float_op(base=False,
 			    name='prepare_op_convert_float_bytes_to_longlong')
 
+    def prepare_op_read_timestamp(self, op, fcond):
+        loc = self.get_scratch_reg(INT)
+        res = self.vfprm.force_allocate_reg(op.result)
+        return [loc, res]
+
 
 def add_none_argument(fn):
     return lambda self, op, fcond: fn(self, op, None, fcond)
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.