Skip to content

Commit b883bc8

Browse files
committed
breaking API changes to all readInt/writeInt functions & more
* add `@bswap` builtin function. See #767 * comptime evaluation facilities are improved to be able to handle a `@ptrCast` with a backing array. * `@truncate` allows "truncating" a u0 value to any integer type, and the result is always comptime known to be `0`. * when specifying pointer alignment in a type expression, the alignment value of pointers which do not have addresses at runtime is ignored, and always has the default/ABI alignment * threw in a fix to freebsd/x86_64.zig to update syntax from language changes * some improvements are pending #863 closes #638 closes #1733 std lib API changes * io.InStream().readIntNe renamed to readIntNative * io.InStream().readIntLe renamed to readIntLittle * io.InStream().readIntBe renamed to readIntBig * introduced io.InStream().readIntForeign * io.InStream().readInt has parameter order changed * io.InStream().readVarInt has parameter order changed * io.InStream().writeIntNe renamed to writeIntNative * introduced io.InStream().writeIntForeign * io.InStream().writeIntLe renamed to writeIntLittle * io.InStream().writeIntBe renamed to writeIntBig * io.InStream().writeInt has parameter order changed * mem.readInt has different parameters and semantics * introduced mem.readIntNative * introduced mem.readIntForeign * mem.readIntBE renamed to mem.readIntBig and different API * mem.readIntLE renamed to mem.readIntLittle and different API * introduced mem.readIntSliceNative * introduced mem.readIntSliceForeign * introduced mem.readIntSliceLittle * introduced mem.readIntSliceBig * introduced mem.readIntSlice * mem.writeInt has different parameters and semantics * introduced mem.writeIntNative * introduced mem.writeIntForeign * mem.writeIntBE renamed to mem.readIntBig and different semantics * mem.writeIntLE renamed to mem.readIntLittle and different semantics * introduced mem.writeIntSliceForeign * introduced mem.writeIntSliceNative * introduced mem.writeIntSliceBig * introduced mem.writeIntSliceLittle * introduced mem.writeIntSlice * removed mem.endianSwapIfLe * removed mem.endianSwapIfBe * removed mem.endianSwapIf * added mem.littleToNative * added mem.bigToNative * added mem.toNative * added mem.nativeTo * added mem.nativeToLittle * added mem.nativeToBig
1 parent 634d11a commit b883bc8

34 files changed

+797
-398
lines changed

doc/langref.html.in

+9
Original file line numberDiff line numberDiff line change
@@ -5312,6 +5312,15 @@ comptime {
53125312
</p>
53135313
{#header_close#}
53145314

5315+
{#header_open|@bswap#}
5316+
<pre>{#syntax#}@swap(comptime T: type, value: T) T{#endsyntax#}</pre>
5317+
<p>{#syntax#}T{#endsyntax#} must be an integer type with bit count evenly divisible by 8.</p>
5318+
<p>
5319+
Swaps the byte order of the integer. This converts a big endian integer to a little endian integer,
5320+
and converts a little endian integer to a big endian integer.
5321+
</p>
5322+
{#header_close#}
5323+
53155324
{#header_open|@bytesToSlice#}
53165325
<pre>{#syntax#}@bytesToSlice(comptime Element: type, bytes: []u8) []Element{#endsyntax#}</pre>
53175326
<p>

example/guess_number/main.zig

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub fn main() !void {
1515
std.debug.warn("unable to seed random number generator: {}", err);
1616
return err;
1717
};
18-
const seed = std.mem.readInt(seed_bytes, u64, builtin.Endian.Big);
18+
const seed = std.mem.readIntNative(u64, &seed_bytes);
1919
var prng = std.rand.DefaultPrng.init(seed);
2020

2121
const answer = prng.random.range(u8, 0, 100) + 1;

src-self-hosted/compilation.zig

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub const ZigCompiler = struct {
5555

5656
var seed_bytes: [@sizeOf(u64)]u8 = undefined;
5757
try std.os.getRandomBytes(seed_bytes[0..]);
58-
const seed = std.mem.readInt(seed_bytes, u64, builtin.Endian.Big);
58+
const seed = mem.readIntNative(u64, &seed_bytes);
5959

6060
return ZigCompiler{
6161
.loop = loop,

src/all_types.hpp

+13
Original file line numberDiff line numberDiff line change
@@ -1415,6 +1415,7 @@ enum BuiltinFnId {
14151415
BuiltinFnIdErrorReturnTrace,
14161416
BuiltinFnIdAtomicRmw,
14171417
BuiltinFnIdAtomicLoad,
1418+
BuiltinFnIdBswap,
14181419
};
14191420

14201421
struct BuiltinFnEntry {
@@ -1487,6 +1488,7 @@ enum ZigLLVMFnId {
14871488
ZigLLVMFnIdFloor,
14881489
ZigLLVMFnIdCeil,
14891490
ZigLLVMFnIdSqrt,
1491+
ZigLLVMFnIdBswap,
14901492
};
14911493

14921494
enum AddSubMul {
@@ -1516,6 +1518,9 @@ struct ZigLLVMFnKey {
15161518
uint32_t bit_count;
15171519
bool is_signed;
15181520
} overflow_arithmetic;
1521+
struct {
1522+
uint32_t bit_count;
1523+
} bswap;
15191524
} data;
15201525
};
15211526

@@ -2158,6 +2163,7 @@ enum IrInstructionId {
21582163
IrInstructionIdMergeErrRetTraces,
21592164
IrInstructionIdMarkErrRetTracePtr,
21602165
IrInstructionIdSqrt,
2166+
IrInstructionIdBswap,
21612167
IrInstructionIdErrSetCast,
21622168
IrInstructionIdToBytes,
21632169
IrInstructionIdFromBytes,
@@ -3251,6 +3257,13 @@ struct IrInstructionCheckRuntimeScope {
32513257
IrInstruction *is_comptime;
32523258
};
32533259

3260+
struct IrInstructionBswap {
3261+
IrInstruction base;
3262+
3263+
IrInstruction *type;
3264+
IrInstruction *op;
3265+
};
3266+
32543267
static const size_t slice_ptr_index = 0;
32553268
static const size_t slice_len_index = 1;
32563269

src/analyze.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,8 @@ ZigType *get_promise_type(CodeGen *g, ZigType *result_type) {
401401
}
402402

403403
ZigType *get_pointer_to_type_extra(CodeGen *g, ZigType *child_type, bool is_const,
404-
bool is_volatile, PtrLen ptr_len, uint32_t byte_alignment, uint32_t bit_offset_in_host, uint32_t host_int_bytes)
404+
bool is_volatile, PtrLen ptr_len, uint32_t byte_alignment,
405+
uint32_t bit_offset_in_host, uint32_t host_int_bytes)
405406
{
406407
assert(!type_is_invalid(child_type));
407408
assert(ptr_len == PtrLenSingle || child_type->id != ZigTypeIdOpaque);
@@ -6110,6 +6111,8 @@ uint32_t zig_llvm_fn_key_hash(ZigLLVMFnKey x) {
61106111
return (uint32_t)(x.data.floating.bit_count) * (uint32_t)1953839089;
61116112
case ZigLLVMFnIdSqrt:
61126113
return (uint32_t)(x.data.floating.bit_count) * (uint32_t)2225366385;
6114+
case ZigLLVMFnIdBswap:
6115+
return (uint32_t)(x.data.bswap.bit_count) * (uint32_t)3661994335;
61136116
case ZigLLVMFnIdOverflowArithmetic:
61146117
return ((uint32_t)(x.data.overflow_arithmetic.bit_count) * 87135777) +
61156118
((uint32_t)(x.data.overflow_arithmetic.add_sub_mul) * 31640542) +
@@ -6128,6 +6131,8 @@ bool zig_llvm_fn_key_eql(ZigLLVMFnKey a, ZigLLVMFnKey b) {
61286131
return a.data.clz.bit_count == b.data.clz.bit_count;
61296132
case ZigLLVMFnIdPopCount:
61306133
return a.data.pop_count.bit_count == b.data.pop_count.bit_count;
6134+
case ZigLLVMFnIdBswap:
6135+
return a.data.bswap.bit_count == b.data.bswap.bit_count;
61316136
case ZigLLVMFnIdFloor:
61326137
case ZigLLVMFnIdCeil:
61336138
case ZigLLVMFnIdSqrt:

src/codegen.cpp

+31
Original file line numberDiff line numberDiff line change
@@ -3814,6 +3814,11 @@ static LLVMValueRef get_int_builtin_fn(CodeGen *g, ZigType *int_type, BuiltinFnI
38143814
n_args = 1;
38153815
key.id = ZigLLVMFnIdPopCount;
38163816
key.data.pop_count.bit_count = (uint32_t)int_type->data.integral.bit_count;
3817+
} else if (fn_id == BuiltinFnIdBswap) {
3818+
fn_name = "bswap";
3819+
n_args = 1;
3820+
key.id = ZigLLVMFnIdBswap;
3821+
key.data.bswap.bit_count = (uint32_t)int_type->data.integral.bit_count;
38173822
} else {
38183823
zig_unreachable();
38193824
}
@@ -5098,6 +5103,29 @@ static LLVMValueRef ir_render_sqrt(CodeGen *g, IrExecutable *executable, IrInstr
50985103
return LLVMBuildCall(g->builder, fn_val, &op, 1, "");
50995104
}
51005105

5106+
static LLVMValueRef ir_render_bswap(CodeGen *g, IrExecutable *executable, IrInstructionBswap *instruction) {
5107+
LLVMValueRef op = ir_llvm_value(g, instruction->op);
5108+
ZigType *int_type = instruction->base.value.type;
5109+
assert(int_type->id == ZigTypeIdInt);
5110+
if (int_type->data.integral.bit_count % 16 == 0) {
5111+
LLVMValueRef fn_val = get_int_builtin_fn(g, instruction->base.value.type, BuiltinFnIdBswap);
5112+
return LLVMBuildCall(g->builder, fn_val, &op, 1, "");
5113+
}
5114+
// Not an even number of bytes, so we zext 1 byte, then bswap, shift right 1 byte, truncate
5115+
ZigType *extended_type = get_int_type(g, int_type->data.integral.is_signed,
5116+
int_type->data.integral.bit_count + 8);
5117+
// aabbcc
5118+
LLVMValueRef extended = LLVMBuildZExt(g->builder, op, extended_type->type_ref, "");
5119+
// 00aabbcc
5120+
LLVMValueRef fn_val = get_int_builtin_fn(g, extended_type, BuiltinFnIdBswap);
5121+
LLVMValueRef swapped = LLVMBuildCall(g->builder, fn_val, &extended, 1, "");
5122+
// ccbbaa00
5123+
LLVMValueRef shifted = ZigLLVMBuildLShrExact(g->builder, swapped,
5124+
LLVMConstInt(extended_type->type_ref, 8, false), "");
5125+
// 00ccbbaa
5126+
return LLVMBuildTrunc(g->builder, shifted, int_type->type_ref, "");
5127+
}
5128+
51015129
static void set_debug_location(CodeGen *g, IrInstruction *instruction) {
51025130
AstNode *source_node = instruction->source_node;
51035131
Scope *scope = instruction->scope;
@@ -5335,6 +5363,8 @@ static LLVMValueRef ir_render_instruction(CodeGen *g, IrExecutable *executable,
53355363
return ir_render_mark_err_ret_trace_ptr(g, executable, (IrInstructionMarkErrRetTracePtr *)instruction);
53365364
case IrInstructionIdSqrt:
53375365
return ir_render_sqrt(g, executable, (IrInstructionSqrt *)instruction);
5366+
case IrInstructionIdBswap:
5367+
return ir_render_bswap(g, executable, (IrInstructionBswap *)instruction);
53385368
}
53395369
zig_unreachable();
53405370
}
@@ -6757,6 +6787,7 @@ static void define_builtin_fns(CodeGen *g) {
67576787
create_builtin_fn(g, BuiltinFnIdToBytes, "sliceToBytes", 1);
67586788
create_builtin_fn(g, BuiltinFnIdFromBytes, "bytesToSlice", 2);
67596789
create_builtin_fn(g, BuiltinFnIdThis, "This", 0);
6790+
create_builtin_fn(g, BuiltinFnIdBswap, "bswap", 2);
67606791
}
67616792

67626793
static const char *bool_to_str(bool b) {

src/ir.cpp

+146-10
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,10 @@ static constexpr IrInstructionId ir_instruction_id(IrInstructionSqrt *) {
856856
return IrInstructionIdSqrt;
857857
}
858858

859+
static constexpr IrInstructionId ir_instruction_id(IrInstructionBswap *) {
860+
return IrInstructionIdBswap;
861+
}
862+
859863
static constexpr IrInstructionId ir_instruction_id(IrInstructionCheckRuntimeScope *) {
860864
return IrInstructionIdCheckRuntimeScope;
861865
}
@@ -2705,6 +2709,17 @@ static IrInstruction *ir_build_sqrt(IrBuilder *irb, Scope *scope, AstNode *sourc
27052709
return &instruction->base;
27062710
}
27072711

2712+
static IrInstruction *ir_build_bswap(IrBuilder *irb, Scope *scope, AstNode *source_node, IrInstruction *type, IrInstruction *op) {
2713+
IrInstructionBswap *instruction = ir_build_instruction<IrInstructionBswap>(irb, scope, source_node);
2714+
instruction->type = type;
2715+
instruction->op = op;
2716+
2717+
if (type != nullptr) ir_ref_instruction(type, irb->current_basic_block);
2718+
ir_ref_instruction(op, irb->current_basic_block);
2719+
2720+
return &instruction->base;
2721+
}
2722+
27082723
static IrInstruction *ir_build_check_runtime_scope(IrBuilder *irb, Scope *scope, AstNode *source_node, IrInstruction *scope_is_comptime, IrInstruction *is_comptime) {
27092724
IrInstructionCheckRuntimeScope *instruction = ir_build_instruction<IrInstructionCheckRuntimeScope>(irb, scope, source_node);
27102725
instruction->scope_is_comptime = scope_is_comptime;
@@ -4689,6 +4704,21 @@ static IrInstruction *ir_gen_builtin_fn_call(IrBuilder *irb, Scope *scope, AstNo
46894704
IrInstruction *result = ir_build_enum_to_int(irb, scope, node, arg0_value);
46904705
return ir_lval_wrap(irb, scope, result, lval);
46914706
}
4707+
case BuiltinFnIdBswap:
4708+
{
4709+
AstNode *arg0_node = node->data.fn_call_expr.params.at(0);
4710+
IrInstruction *arg0_value = ir_gen_node(irb, arg0_node, scope);
4711+
if (arg0_value == irb->codegen->invalid_instruction)
4712+
return arg0_value;
4713+
4714+
AstNode *arg1_node = node->data.fn_call_expr.params.at(1);
4715+
IrInstruction *arg1_value = ir_gen_node(irb, arg1_node, scope);
4716+
if (arg1_value == irb->codegen->invalid_instruction)
4717+
return arg1_value;
4718+
4719+
IrInstruction *result = ir_build_bswap(irb, scope, node, arg0_value, arg1_value);
4720+
return ir_lval_wrap(irb, scope, result, lval);
4721+
}
46924722
}
46934723
zig_unreachable();
46944724
}
@@ -13674,18 +13704,55 @@ static Error ir_read_const_ptr(IrAnalyze *ira, AstNode *source_node,
1367413704
return ErrorNone;
1367513705
}
1367613706

13677-
if (dst_size > src_size) {
13678-
ir_add_error_node(ira, source_node,
13679-
buf_sprintf("attempt to read %zu bytes from pointer to %s which is %zu bytes",
13680-
dst_size, buf_ptr(&pointee->type->name), src_size));
13681-
return ErrorSemanticAnalyzeFail;
13707+
if (dst_size <= src_size) {
13708+
Buf buf = BUF_INIT;
13709+
buf_resize(&buf, src_size);
13710+
buf_write_value_bytes(ira->codegen, (uint8_t*)buf_ptr(&buf), pointee);
13711+
buf_read_value_bytes(ira->codegen, (uint8_t*)buf_ptr(&buf), out_val);
13712+
return ErrorNone;
1368213713
}
1368313714

13684-
Buf buf = BUF_INIT;
13685-
buf_resize(&buf, src_size);
13686-
buf_write_value_bytes(ira->codegen, (uint8_t*)buf_ptr(&buf), pointee);
13687-
buf_read_value_bytes(ira->codegen, (uint8_t*)buf_ptr(&buf), out_val);
13688-
return ErrorNone;
13715+
switch (ptr_val->data.x_ptr.special) {
13716+
case ConstPtrSpecialInvalid:
13717+
zig_unreachable();
13718+
case ConstPtrSpecialRef: {
13719+
ir_add_error_node(ira, source_node,
13720+
buf_sprintf("attempt to read %zu bytes from pointer to %s which is %zu bytes",
13721+
dst_size, buf_ptr(&pointee->type->name), src_size));
13722+
return ErrorSemanticAnalyzeFail;
13723+
}
13724+
case ConstPtrSpecialBaseArray: {
13725+
ConstExprValue *array_val = ptr_val->data.x_ptr.data.base_array.array_val;
13726+
assert(array_val->type->id == ZigTypeIdArray);
13727+
if (array_val->data.x_array.special != ConstArraySpecialNone)
13728+
zig_panic("TODO");
13729+
size_t elem_size = src_size;
13730+
src_size = elem_size *
13731+
(array_val->type->data.array.len - ptr_val->data.x_ptr.data.base_array.elem_index);
13732+
if (dst_size > src_size) {
13733+
ir_add_error_node(ira, source_node,
13734+
buf_sprintf("attempt to read %zu bytes from %s at index %" ZIG_PRI_usize " which is %zu bytes",
13735+
dst_size, buf_ptr(&array_val->type->name), ptr_val->data.x_ptr.data.base_array.elem_index,
13736+
src_size));
13737+
return ErrorSemanticAnalyzeFail;
13738+
}
13739+
size_t elem_count = (dst_size % elem_size == 0) ? (dst_size / elem_size) : (dst_size / elem_size + 1);
13740+
Buf buf = BUF_INIT;
13741+
buf_resize(&buf, elem_count * elem_size);
13742+
for (size_t i = 0; i < elem_count; i += 1) {
13743+
ConstExprValue *elem_val = &array_val->data.x_array.data.s_none.elements[i];
13744+
buf_write_value_bytes(ira->codegen, (uint8_t*)buf_ptr(&buf) + (i * elem_size), elem_val);
13745+
}
13746+
buf_read_value_bytes(ira->codegen, (uint8_t*)buf_ptr(&buf), out_val);
13747+
return ErrorNone;
13748+
}
13749+
case ConstPtrSpecialBaseStruct:
13750+
case ConstPtrSpecialDiscard:
13751+
case ConstPtrSpecialHardCodedAddr:
13752+
case ConstPtrSpecialFunction:
13753+
zig_panic("TODO");
13754+
}
13755+
zig_unreachable();
1368913756
}
1369013757

1369113758
static IrInstruction *ir_analyze_maybe(IrAnalyze *ira, IrInstructionUnOp *un_op_instruction) {
@@ -18054,6 +18121,12 @@ static IrInstruction *ir_analyze_instruction_truncate(IrAnalyze *ira, IrInstruct
1805418121
return ira->codegen->invalid_instruction;
1805518122
}
1805618123

18124+
if (src_type->data.integral.bit_count == 0) {
18125+
IrInstruction *result = ir_const(ira, &instruction->base, dest_type);
18126+
bigint_init_unsigned(&result->value.data.x_bigint, 0);
18127+
return result;
18128+
}
18129+
1805718130
if (src_type->data.integral.is_signed != dest_type->data.integral.is_signed) {
1805818131
const char *sign_str = dest_type->data.integral.is_signed ? "signed" : "unsigned";
1805918132
ir_add_error(ira, target, buf_sprintf("expected %s integer type, found '%s'", sign_str, buf_ptr(&src_type->name)));
@@ -20299,6 +20372,9 @@ static IrInstruction *ir_analyze_instruction_ptr_type(IrAnalyze *ira, IrInstruct
2029920372
return ira->codegen->invalid_instruction;
2030020373
if ((err = type_resolve(ira->codegen, child_type, ResolveStatusAlignmentKnown)))
2030120374
return ira->codegen->invalid_instruction;
20375+
if (!type_has_bits(child_type)) {
20376+
align_bytes = 0;
20377+
}
2030220378
} else {
2030320379
if ((err = type_resolve(ira->codegen, child_type, ResolveStatusZeroBitsKnown)))
2030420380
return ira->codegen->invalid_instruction;
@@ -20898,6 +20974,63 @@ static IrInstruction *ir_analyze_instruction_sqrt(IrAnalyze *ira, IrInstructionS
2089820974
return result;
2089920975
}
2090020976

20977+
static IrInstruction *ir_analyze_instruction_bswap(IrAnalyze *ira, IrInstructionBswap *instruction) {
20978+
ZigType *int_type = ir_resolve_type(ira, instruction->type->child);
20979+
if (type_is_invalid(int_type))
20980+
return ira->codegen->invalid_instruction;
20981+
20982+
IrInstruction *op = instruction->op->child;
20983+
if (type_is_invalid(op->value.type))
20984+
return ira->codegen->invalid_instruction;
20985+
20986+
if (int_type->id != ZigTypeIdInt) {
20987+
ir_add_error(ira, instruction->type,
20988+
buf_sprintf("expected integer type, found '%s'", buf_ptr(&int_type->name)));
20989+
return ira->codegen->invalid_instruction;
20990+
}
20991+
20992+
if (int_type->data.integral.bit_count % 8 != 0) {
20993+
ir_add_error(ira, instruction->type,
20994+
buf_sprintf("@bswap integer type '%s' has %" PRIu32 " bits which is not evenly divisible by 8",
20995+
buf_ptr(&int_type->name), int_type->data.integral.bit_count));
20996+
return ira->codegen->invalid_instruction;
20997+
}
20998+
20999+
IrInstruction *casted_op = ir_implicit_cast(ira, op, int_type);
21000+
if (type_is_invalid(casted_op->value.type))
21001+
return ira->codegen->invalid_instruction;
21002+
21003+
if (int_type->data.integral.bit_count == 0) {
21004+
IrInstruction *result = ir_const(ira, &instruction->base, int_type);
21005+
bigint_init_unsigned(&result->value.data.x_bigint, 0);
21006+
return result;
21007+
}
21008+
21009+
if (int_type->data.integral.bit_count == 8) {
21010+
return casted_op;
21011+
}
21012+
21013+
if (instr_is_comptime(casted_op)) {
21014+
ConstExprValue *val = ir_resolve_const(ira, casted_op, UndefBad);
21015+
if (!val)
21016+
return ira->codegen->invalid_instruction;
21017+
21018+
IrInstruction *result = ir_const(ira, &instruction->base, int_type);
21019+
size_t buf_size = int_type->data.integral.bit_count / 8;
21020+
uint8_t *buf = allocate_nonzero<uint8_t>(buf_size);
21021+
bigint_write_twos_complement(&val->data.x_bigint, buf, int_type->data.integral.bit_count, true);
21022+
bigint_read_twos_complement(&result->value.data.x_bigint, buf, int_type->data.integral.bit_count, false,
21023+
int_type->data.integral.is_signed);
21024+
return result;
21025+
}
21026+
21027+
IrInstruction *result = ir_build_bswap(&ira->new_irb, instruction->base.scope,
21028+
instruction->base.source_node, nullptr, casted_op);
21029+
result->value.type = int_type;
21030+
return result;
21031+
}
21032+
21033+
2090121034
static IrInstruction *ir_analyze_instruction_enum_to_int(IrAnalyze *ira, IrInstructionEnumToInt *instruction) {
2090221035
Error err;
2090321036
IrInstruction *target = instruction->target->child;
@@ -21233,6 +21366,8 @@ static IrInstruction *ir_analyze_instruction_nocast(IrAnalyze *ira, IrInstructio
2123321366
return ir_analyze_instruction_mark_err_ret_trace_ptr(ira, (IrInstructionMarkErrRetTracePtr *)instruction);
2123421367
case IrInstructionIdSqrt:
2123521368
return ir_analyze_instruction_sqrt(ira, (IrInstructionSqrt *)instruction);
21369+
case IrInstructionIdBswap:
21370+
return ir_analyze_instruction_bswap(ira, (IrInstructionBswap *)instruction);
2123621371
case IrInstructionIdIntToErr:
2123721372
return ir_analyze_instruction_int_to_err(ira, (IrInstructionIntToErr *)instruction);
2123821373
case IrInstructionIdErrToInt:
@@ -21454,6 +21589,7 @@ bool ir_has_side_effects(IrInstruction *instruction) {
2145421589
case IrInstructionIdCoroPromise:
2145521590
case IrInstructionIdPromiseResultType:
2145621591
case IrInstructionIdSqrt:
21592+
case IrInstructionIdBswap:
2145721593
case IrInstructionIdAtomicLoad:
2145821594
case IrInstructionIdIntCast:
2145921595
case IrInstructionIdFloatCast:

0 commit comments

Comments
 (0)