Add the FMA3 feature in order to test FMA encoding using the old jit.
authorNadav Rotem <nrotem@apple.com>
Wed, 21 Aug 2013 05:02:12 +0000 (05:02 +0000)
committerNadav Rotem <nrotem@apple.com>
Wed, 21 Aug 2013 05:02:12 +0000 (05:02 +0000)
Patch by Chris Bieneman!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188865 91177308-0d34-0410-b5e6-96231b3b80d8

test/lit.cfg

index cd17be1fdbb767ce1cb577334855099b1b718a03..13323b367b7c7d3e050e4cf209587fb5f92b7c23 100644 (file)
@@ -291,6 +291,16 @@ if re.search(r'with assertions', llc_cmd.stdout.read().decode('ascii')):
     config.available_features.add('asserts')
 llc_cmd.wait()
 
+if 'darwin' == sys.platform:
+    try:
+        sysctl_cmd = subprocess.Popen(['sysctl', 'hw.optional.fma'],
+                                    stdout = subprocess.PIPE)
+    except OSError:
+        print("Could not exec sysctl")
+    if -1 != sysctl_cmd.stdout.read().find("hw.optional.fma: 1"):
+        config.available_features.add('fma3')
+    sysctl_cmd.wait()
+
 # Check if we should use gmalloc.
 use_gmalloc_str = lit_config.params.get('use_gmalloc', None)
 if use_gmalloc_str is not None: