Author: David Schneider <[email protected]>
Branch: arm-backend-2
Changeset: r56384:c8307cf9c66c
Date: 2012-07-22 10:46 +0200
http://bitbucket.org/pypy/pypy/changeset/c8307cf9c66c/

Log:    add cpu classes and detection for armhf

diff --git a/pypy/jit/backend/arm/runner.py b/pypy/jit/backend/arm/runner.py
--- a/pypy/jit/backend/arm/runner.py
+++ b/pypy/jit/backend/arm/runner.py
@@ -6,11 +6,13 @@
 from pypy.jit.backend.arm.arch import FORCE_INDEX_OFS
 
 
-class ArmCPU(AbstractLLCPU):
+class AbstractARMCPU(AbstractLLCPU):
 
     supports_floats = True
     supports_longlong = False # XXX requires an implementation of
                               # read_timestamp that works in user mode
+    
+    use_hf_abi = False        # use hard float abi flag
 
     def __init__(self, rtyper, stats, opts=None, translate_support_code=False,
                  gcdescr=None):
@@ -139,3 +141,12 @@
             mc.copy_to_raw_memory(jmp)
         # positions invalidated
         looptoken.compiled_loop_token.invalidate_positions = []
+
+class CPU_ARM(AbstractARMCPU):
+    """ARM v7 uses softfp ABI, requires vfp"""
+    pass
+ArmCPU = CPU_ARM
+
+class CPU_ARMHF(AbstractARMCPU):
+    """ARM v7 uses hardfp ABI, requires vfp"""
+    use_hf_abi = True
diff --git a/pypy/jit/backend/detect_cpu.py b/pypy/jit/backend/detect_cpu.py
--- a/pypy/jit/backend/detect_cpu.py
+++ b/pypy/jit/backend/detect_cpu.py
@@ -61,7 +61,9 @@
                 model = 'x86-without-sse2'
     if model == 'arm':
             from pypy.jit.backend.arm.detect import detect_hardfloat, 
detect_float
-            assert not detect_hardfloat(), 'armhf is not supported yet'
+            if detect_hardfloat():
+                model = 'armhf'
+                raise AssertionError, 'disabled for now (ABI switching issues 
with libffi)'
             assert detect_float(), 'the JIT-compiler requires a vfp unit'
     return model
     
@@ -79,7 +81,9 @@
     elif backend_name == 'llvm':
         return "pypy.jit.backend.llvm.runner", "LLVMCPU"
     elif backend_name == 'arm':
-        return "pypy.jit.backend.arm.runner", "ArmCPU"
+        return "pypy.jit.backend.arm.runner", "CPU_ARM"
+    elif backend_name == 'armhf':
+        return "pypy.jit.backend.arm.runner", "CPU_ARMHF"
     else:
         raise ProcessorAutodetectError, (
             "we have no JIT backend for this cpu: '%s'" % backend_name)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to