diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-08-01 02:37:22 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-08-01 02:46:37 -0400 |
| commit | 38b5812c4895eb0157f99348f51c40bbd17c3b94 (patch) | |
| tree | 4c58a300cfdfe438d7362489e702d7c1f857f695 /src/ir.cpp | |
| parent | ceec2393cfbe20b0993bd7cccb43e930438281fe (diff) | |
| download | zig-38b5812c4895eb0157f99348f51c40bbd17c3b94.tar.gz zig-38b5812c4895eb0157f99348f51c40bbd17c3b94.zip | |
allow 128 bit cmpxchg on x86_64
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index be7a8e2e51..f34c840496 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -24735,10 +24735,11 @@ static ZigType *ir_resolve_atomic_operand_type(IrAnalyze *ira, IrInstruction *op operand_type->data.integral.bit_count)); return ira->codegen->builtin_types.entry_invalid; } - if (operand_type->data.integral.bit_count > ira->codegen->pointer_size_bytes * 8) { + uint32_t max_atomic_bits = target_arch_largest_atomic_bits(ira->codegen->zig_target->arch); + if (operand_type->data.integral.bit_count > max_atomic_bits) { ir_add_error(ira, op, - buf_sprintf("expected integer type pointer size or smaller, found %" PRIu32 "-bit integer type", - operand_type->data.integral.bit_count)); + buf_sprintf("expected %" PRIu32 "-bit integer type or smaller, found %" PRIu32 "-bit integer type", + max_atomic_bits, operand_type->data.integral.bit_count)); return ira->codegen->builtin_types.entry_invalid; } if (!is_power_of_2(operand_type->data.integral.bit_count)) { |
