zig fmt and delete unused type
This commit is contained in:
parent
aa92446365
commit
1eed0cf0f3
@ -54,7 +54,7 @@ pub fn generateSymbol(
|
||||
// Prepare the function parameters
|
||||
switch (bin_file.options.target.cpu.arch) {
|
||||
.x86_64 => {
|
||||
const integer_registers = [_]Reg(.x86_64){.rdi, .rsi, .rdx, .rcx, .r8, .r9};
|
||||
const integer_registers = [_]Reg(.x86_64){ .rdi, .rsi, .rdx, .rcx, .r8, .r9 };
|
||||
var next_int_reg: usize = 0;
|
||||
|
||||
for (param_types) |param_type, src_i| {
|
||||
@ -64,7 +64,7 @@ pub fn generateSymbol(
|
||||
try mc_args.append(.{ .stack_offset = next_stack_offset });
|
||||
next_stack_offset += param_type.abiSize(bin_file.options.target);
|
||||
} else {
|
||||
try mc_args.append(.{ .register = @enumToInt(integer_registers[next_int_reg])});
|
||||
try mc_args.append(.{ .register = @enumToInt(integer_registers[next_int_reg]) });
|
||||
next_int_reg += 1;
|
||||
}
|
||||
},
|
||||
@ -75,10 +75,9 @@ pub fn generateSymbol(
|
||||
"TODO implement function parameters of type {}",
|
||||
.{@tagName(param_type.zigTypeTag())},
|
||||
),
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
else => return Result{
|
||||
.fail = try ErrorMsg.create(
|
||||
@ -689,7 +688,7 @@ const Function = struct {
|
||||
},
|
||||
.stack_offset => |off| {
|
||||
return self.fail(src, "TODO implement genSetReg for stack variables", .{});
|
||||
}
|
||||
},
|
||||
},
|
||||
else => return self.fail(src, "TODO implement genSetReg for more architectures", .{}),
|
||||
}
|
||||
|
@ -68,24 +68,3 @@ pub const Register = enum(u8) {
|
||||
};
|
||||
|
||||
// zig fmt: on
|
||||
|
||||
/// After argument values have been computed, they are placed either in registers
|
||||
/// or pushed on the stack. The way values are passed depends on the class.
|
||||
pub const ParameterClass = enum {
|
||||
/// Integral types that fit into one of the general purpose registers.
|
||||
integer,
|
||||
/// Types that fit into a vector register.
|
||||
sse,
|
||||
/// Types that fit into a vector register and can be passed
|
||||
/// and returned in the upper bytes of it.
|
||||
sse_up,
|
||||
/// Types that will be returned via the x87FPU.
|
||||
x87,
|
||||
/// Types that will be returned via the x87FPU and can be passed and returned
|
||||
/// in the upper bytes of it.
|
||||
x87_up,
|
||||
/// Types that will be returned via the x87FPU.
|
||||
complex_x87,
|
||||
/// Types that will be passed and returned in mem-ory via the stack.
|
||||
memory,
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user