aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-09-18 16:35:57 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-09-18 16:35:57 -0400
commit86209e1a9259dca40803e56d612beacf5a35855c (patch)
tree21e2b617a7cd424f82e040b94014b1c176dcf63b /src/analyze.cpp
parent914ad1ec2eff4ea9061804ad0da9cde7dd6543b6 (diff)
parentef0f3ba905e992556a60f935cbb7cb30cf1f27db (diff)
downloadzig-86209e1a9259dca40803e56d612beacf5a35855c.tar.gz
zig-86209e1a9259dca40803e56d612beacf5a35855c.zip
Merge branch 'merge-shawnl-simd5'
This is the first 3 commits of #2945, plus my fixups.
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index d5d8745018..ac70d5646f 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -4708,6 +4708,7 @@ ZigType *get_int_type(CodeGen *g, bool is_signed, uint32_t size_in_bits) {
bool is_valid_vector_elem_type(ZigType *elem_type) {
return elem_type->id == ZigTypeIdInt ||
elem_type->id == ZigTypeIdFloat ||
+ elem_type->id == ZigTypeIdBool ||
get_codegen_ptr_type(elem_type) != nullptr;
}
@@ -4727,7 +4728,7 @@ ZigType *get_vector_type(CodeGen *g, uint32_t len, ZigType *elem_type) {
ZigType *entry = new_type_table_entry(ZigTypeIdVector);
if ((len != 0) && type_has_bits(elem_type)) {
- // Vectors can only be ints, floats, or pointers. ints and floats have trivially resolvable
+ // Vectors can only be ints, floats, bools, or pointers. ints (inc. bools) and floats have trivially resolvable
// llvm type refs. pointers we will use usize instead.
LLVMTypeRef example_vector_llvm_type;
if (elem_type->id == ZigTypeIdPointer) {