summaryrefslogtreecommitdiff
path: root/mbld
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2018-05-09 19:21:57 -0700
committerOri Bernstein <ori@eigenstate.org>2018-05-10 20:06:36 -0700
commita4f0ffa2a6755c7c0b8c1deb736d425540144ff7 (patch)
tree1a2cf3e81e4f74d361e8ee48146203c794e752e6 /mbld
parent3665783a1d1fe03db70cca452c615b439310a329 (diff)
downloadmc-a4f0ffa2a6755c7c0b8c1deb736d425540144ff7.tar.gz
Turn off fancy stuff when we have an old assembler.
Diffstat (limited to 'mbld')
-rw-r--r--mbld/syssel.myr32
1 files changed, 27 insertions, 5 deletions
diff --git a/mbld/syssel.myr b/mbld/syssel.myr
index 636792a..8c27812 100644
--- a/mbld/syssel.myr
+++ b/mbld/syssel.myr
@@ -162,13 +162,13 @@ const addsysattrs = {b, tags
match opt_arch
| "x64":
tag(b, "x64")
- if opt_cpufeatures & CpuidSSE2 == CpuidSSE2
+ if supports(CpuidSSE2)
tag(b, "sse2")
;;
- if opt_cpufeatures & CpuidSSE4 == CpuidSSE4
+ if supports(CpuidSSE4)
tag(b, "sse4")
;;
- if opt_cpufeatures & CpuidFMA == CpuidFMA
+ if supports(CpuidFMA)
tag(b, "fma")
;;
| unknown:
@@ -182,6 +182,19 @@ const addsysattrs = {b, tags
;;
}
+const supports = {feat
+ match (opt_sys, opt_cpufeatures & feat)
+ /* The version of gas that's shipped with openbsd is too old. */
+ | ("openbsd", CpuidSSE4): -> false
+ | ("openbsd", CpuidFMA): -> false
+ | ("freebsd", CpuidSSE4): -> false
+ | ("freebsd", CpuidFMA): -> false
+ | ("netbsd", CpuidSSE4): -> false
+ | ("netbsd", CpuidFMA): -> false
+ | (_, f): -> f == feat
+ ;;
+}
+
const loadtagfile = {b, tagfile
var data, sp
@@ -199,6 +212,15 @@ const loadtagfile = {b, tagfile
std.slfree(data)
}
-const tag = {b, tag
- std.htput(b.tags, std.sldup(tag), (-1, -1, -1))
+const tag = {b, t
+ var v
+ match std.strfind(t, ":")
+ | `std.None:
+ std.htput(b.tags, std.sldup(t), (-1, -1, -1))
+ | `std.Some idx:
+ v = parseversion(t[idx+1:])
+ std.put("version: {} : {}\n", t[:idx], v)
+ std.htput(b.tags, std.sldup(t[:idx]), v)
+ ;;
+
}