mirror of
https://github.com/ziglang/zig.git
synced 2025-12-26 08:03:08 +00:00
stage2: sparcv9: Placeholder for Air instructions in genBody
This commit is contained in:
parent
94d70bdb69
commit
18c98eb429
@ -471,10 +471,181 @@ fn gen(self: *Self) !void {
|
||||
}
|
||||
|
||||
fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void {
|
||||
_ = self;
|
||||
_ = body;
|
||||
const air_tags = self.air.instructions.items(.tag);
|
||||
|
||||
@panic("TODO implement genBody");
|
||||
for (body) |inst| {
|
||||
const old_air_bookkeeping = self.air_bookkeeping;
|
||||
try self.ensureProcessDeathCapacity(Liveness.bpi);
|
||||
|
||||
switch (air_tags[inst]) {
|
||||
.arg => @panic("TODO implement arg"),
|
||||
.add => @panic("TODO implement add"),
|
||||
.addwrap => @panic("TODO implement addwrap"),
|
||||
.add_sat => @panic("TODO implement add_sat"),
|
||||
.sub => @panic("TODO implement sub"),
|
||||
.subwrap => @panic("TODO implement subwrap"),
|
||||
.sub_sat => @panic("TODO implement sub_sat"),
|
||||
.mul => @panic("TODO implement mul"),
|
||||
.mulwrap => @panic("TODO implement mulwrap"),
|
||||
.mul_sat => @panic("TODO implement mul_sat"),
|
||||
.div_float => @panic("TODO implement div_float"),
|
||||
.div_trunc => @panic("TODO implement div_trunc"),
|
||||
.div_floor => @panic("TODO implement div_floor"),
|
||||
.div_exact => @panic("TODO implement div_exact"),
|
||||
.rem => @panic("TODO implement rem"),
|
||||
.mod => @panic("TODO implement mod"),
|
||||
.ptr_add => @panic("TODO implement ptr_add"),
|
||||
.ptr_sub => @panic("TODO implement ptr_sub"),
|
||||
.max => @panic("TODO implement max"),
|
||||
.min => @panic("TODO implement min"),
|
||||
.add_with_overflow => @panic("TODO implement add_with_overflow"),
|
||||
.sub_with_overflow => @panic("TODO implement sub_with_overflow"),
|
||||
.mul_with_overflow => @panic("TODO implement mul_with_overflow"),
|
||||
.shl_with_overflow => @panic("TODO implement shl_with_overflow"),
|
||||
.alloc => @panic("TODO implement alloc"),
|
||||
.ret_ptr => @panic("TODO implement ret_ptr"),
|
||||
.assembly => @panic("TODO implement assembly"),
|
||||
.bit_and => @panic("TODO implement bit_and"),
|
||||
.bit_or => @panic("TODO implement bit_or"),
|
||||
.shr => @panic("TODO implement shr"),
|
||||
.shr_exact => @panic("TODO implement shr_exact"),
|
||||
.shl => @panic("TODO implement shl"),
|
||||
.shl_exact => @panic("TODO implement shl_exact"),
|
||||
.shl_sat => @panic("TODO implement shl_sat"),
|
||||
.xor => @panic("TODO implement xor"),
|
||||
.not => @panic("TODO implement not"),
|
||||
.bitcast => @panic("TODO implement bitcast"),
|
||||
.block => @panic("TODO implement block"),
|
||||
.loop => @panic("TODO implement loop"),
|
||||
.br => @panic("TODO implement br"),
|
||||
.breakpoint => @panic("TODO implement breakpoint"),
|
||||
.ret_addr => @panic("TODO implement ret_addr"),
|
||||
.frame_addr => @panic("TODO implement frame_addr"),
|
||||
.call => @panic("TODO implement call"),
|
||||
.call_always_tail => @panic("TODO implement call_always_tail"),
|
||||
.call_never_tail => @panic("TODO implement call_never_tail"),
|
||||
.call_never_inline => @panic("TODO implement call_never_inline"),
|
||||
.clz => @panic("TODO implement clz"),
|
||||
.ctz => @panic("TODO implement ctz"),
|
||||
.popcount => @panic("TODO implement popcount"),
|
||||
.byte_swap => @panic("TODO implement byte_swap"),
|
||||
.bit_reverse => @panic("TODO implement bit_reverse"),
|
||||
.sqrt => @panic("TODO implement sqrt"),
|
||||
.sin => @panic("TODO implement sin"),
|
||||
.cos => @panic("TODO implement cos"),
|
||||
.exp => @panic("TODO implement exp"),
|
||||
.exp2 => @panic("TODO implement exp2"),
|
||||
.log => @panic("TODO implement log"),
|
||||
.log2 => @panic("TODO implement log2"),
|
||||
.log10 => @panic("TODO implement log10"),
|
||||
.fabs => @panic("TODO implement fabs"),
|
||||
.floor => @panic("TODO implement floor"),
|
||||
.ceil => @panic("TODO implement ceil"),
|
||||
.round => @panic("TODO implement round"),
|
||||
.trunc_float => @panic("TODO implement trunc_float"),
|
||||
.cmp_lt => @panic("TODO implement cmp_lt"),
|
||||
.cmp_lte => @panic("TODO implement cmp_lte"),
|
||||
.cmp_eq => @panic("TODO implement cmp_eq"),
|
||||
.cmp_gte => @panic("TODO implement cmp_gte"),
|
||||
.cmp_gt => @panic("TODO implement cmp_gt"),
|
||||
.cmp_neq => @panic("TODO implement cmp_neq"),
|
||||
.cmp_vector => @panic("TODO implement cmp_vector"),
|
||||
.cond_br => @panic("TODO implement cond_br"),
|
||||
.switch_br => @panic("TODO implement switch_br"),
|
||||
.constant => @panic("TODO implement constant"),
|
||||
.const_ty => @panic("TODO implement const_ty"),
|
||||
.dbg_stmt => @panic("TODO implement dbg_stmt"),
|
||||
.dbg_block_begin => @panic("TODO implement dbg_block_begin"),
|
||||
.dbg_block_end => @panic("TODO implement dbg_block_end"),
|
||||
.dbg_inline_begin => @panic("TODO implement dbg_inline_begin"),
|
||||
.dbg_inline_end => @panic("TODO implement dbg_inline_end"),
|
||||
.dbg_var_ptr => @panic("TODO implement dbg_var_ptr"),
|
||||
.dbg_var_val => @panic("TODO implement dbg_var_val"),
|
||||
.is_null => @panic("TODO implement is_null"),
|
||||
.is_non_null => @panic("TODO implement is_non_null"),
|
||||
.is_null_ptr => @panic("TODO implement is_null_ptr"),
|
||||
.is_non_null_ptr => @panic("TODO implement is_non_null_ptr"),
|
||||
.is_err => @panic("TODO implement is_err"),
|
||||
.is_non_err => @panic("TODO implement is_non_err"),
|
||||
.is_err_ptr => @panic("TODO implement is_err_ptr"),
|
||||
.is_non_err_ptr => @panic("TODO implement is_non_err_ptr"),
|
||||
.bool_and => @panic("TODO implement bool_and"),
|
||||
.bool_or => @panic("TODO implement bool_or"),
|
||||
.load => @panic("TODO implement load"),
|
||||
.ptrtoint => @panic("TODO implement ptrtoint"),
|
||||
.bool_to_int => @panic("TODO implement bool_to_int"),
|
||||
.ret => @panic("TODO implement ret"),
|
||||
.ret_load => @panic("TODO implement ret_load"),
|
||||
.store => @panic("TODO implement store"),
|
||||
.unreach => @panic("TODO implement unreach"),
|
||||
.fptrunc => @panic("TODO implement fptrunc"),
|
||||
.fpext => @panic("TODO implement fpext"),
|
||||
.intcast => @panic("TODO implement intcast"),
|
||||
.trunc => @panic("TODO implement trunc"),
|
||||
.optional_payload => @panic("TODO implement optional_payload"),
|
||||
.optional_payload_ptr => @panic("TODO implement optional_payload_ptr"),
|
||||
.optional_payload_ptr_set => @panic("TODO implement optional_payload_ptr_set"),
|
||||
.wrap_optional => @panic("TODO implement wrap_optional"),
|
||||
.unwrap_errunion_payload => @panic("TODO implement unwrap_errunion_payload"),
|
||||
.unwrap_errunion_err => @panic("TODO implement unwrap_errunion_err"),
|
||||
.unwrap_errunion_payload_ptr => @panic("TODO implement unwrap_errunion_payload_ptr"),
|
||||
.unwrap_errunion_err_ptr => @panic("TODO implement unwrap_errunion_err_ptr"),
|
||||
.errunion_payload_ptr_set => @panic("TODO implement errunion_payload_ptr_set"),
|
||||
.wrap_errunion_payload => @panic("TODO implement wrap_errunion_payload"),
|
||||
.wrap_errunion_err => @panic("TODO implement wrap_errunion_err"),
|
||||
.struct_field_ptr => @panic("TODO implement struct_field_ptr"),
|
||||
.struct_field_ptr_index_0 => @panic("TODO implement struct_field_ptr_index_0"),
|
||||
.struct_field_ptr_index_1 => @panic("TODO implement struct_field_ptr_index_1"),
|
||||
.struct_field_ptr_index_2 => @panic("TODO implement struct_field_ptr_index_2"),
|
||||
.struct_field_ptr_index_3 => @panic("TODO implement struct_field_ptr_index_3"),
|
||||
.struct_field_val => @panic("TODO implement struct_field_val"),
|
||||
.set_union_tag => @panic("TODO implement set_union_tag"),
|
||||
.get_union_tag => @panic("TODO implement get_union_tag"),
|
||||
.slice => @panic("TODO implement slice"),
|
||||
.slice_len => @panic("TODO implement slice_len"),
|
||||
.slice_ptr => @panic("TODO implement slice_ptr"),
|
||||
.ptr_slice_len_ptr => @panic("TODO implement ptr_slice_len_ptr"),
|
||||
.ptr_slice_ptr_ptr => @panic("TODO implement ptr_slice_ptr_ptr"),
|
||||
.array_elem_val => @panic("TODO implement array_elem_val"),
|
||||
.slice_elem_val => @panic("TODO implement slice_elem_val"),
|
||||
.slice_elem_ptr => @panic("TODO implement slice_elem_ptr"),
|
||||
.ptr_elem_val => @panic("TODO implement ptr_elem_val"),
|
||||
.ptr_elem_ptr => @panic("TODO implement ptr_elem_ptr"),
|
||||
.array_to_slice => @panic("TODO implement array_to_slice"),
|
||||
.float_to_int => @panic("TODO implement float_to_int"),
|
||||
.int_to_float => @panic("TODO implement int_to_float"),
|
||||
.reduce => @panic("TODO implement reduce"),
|
||||
.splat => @panic("TODO implement splat"),
|
||||
.shuffle => @panic("TODO implement shuffle"),
|
||||
.select => @panic("TODO implement select"),
|
||||
.memset => @panic("TODO implement memset"),
|
||||
.memcpy => @panic("TODO implement memcpy"),
|
||||
.cmpxchg_weak => @panic("TODO implement cmpxchg_weak"),
|
||||
.cmpxchg_strong => @panic("TODO implement cmpxchg_strong"),
|
||||
.fence => @panic("TODO implement fence"),
|
||||
.atomic_load => @panic("TODO implement atomic_load"),
|
||||
.atomic_store_unordered => @panic("TODO implement atomic_store_unordered"),
|
||||
.atomic_store_monotonic => @panic("TODO implement atomic_store_monotonic"),
|
||||
.atomic_store_release => @panic("TODO implement atomic_store_release"),
|
||||
.atomic_store_seq_cst => @panic("TODO implement atomic_store_seq_cst"),
|
||||
.atomic_rmw => @panic("TODO implement atomic_rmw"),
|
||||
.tag_name => @panic("TODO implement tag_name"),
|
||||
.error_name => @panic("TODO implement error_name"),
|
||||
.aggregate_init => @panic("TODO implement aggregate_init"),
|
||||
.union_init => @panic("TODO implement union_init"),
|
||||
.prefetch => @panic("TODO implement prefetch"),
|
||||
.mul_add => @panic("TODO implement mul_add"),
|
||||
.field_parent_ptr => @panic("TODO implement field_parent_ptr"),
|
||||
|
||||
.wasm_memory_size, .wasm_memory_grow => unreachable,
|
||||
}
|
||||
|
||||
if (std.debug.runtime_safety) {
|
||||
if (self.air_bookkeeping < old_air_bookkeeping + 1) {
|
||||
std.debug.panic("in codegen.zig, handling of AIR instruction %{d} ('{}') did not do proper bookkeeping. Look for a missing call to finishAir.", .{ inst, air_tags[inst] });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn addInst(self: *Self, inst: Mir.Inst) error{OutOfMemory}!Mir.Inst.Index {
|
||||
@ -487,6 +658,11 @@ fn addInst(self: *Self, inst: Mir.Inst) error{OutOfMemory}!Mir.Inst.Index {
|
||||
return result_index;
|
||||
}
|
||||
|
||||
fn ensureProcessDeathCapacity(self: *Self, additional_count: usize) !void {
|
||||
const table = &self.branch_stack.items[self.branch_stack.items.len - 1].inst_table;
|
||||
try table.ensureUnusedCapacity(self.gpa, additional_count);
|
||||
}
|
||||
|
||||
fn fail(self: *Self, comptime format: []const u8, args: anytype) InnerError {
|
||||
@setCold(true);
|
||||
assert(self.err_msg == null);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user