authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2020-11-16 17:56:13+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-11-16 13:37:38-08:00
log8f47e8feb60e60cc85674a9eef281197ed8a7c27
tree5b2faa42a2c7567d68932a3cd48084577673934a
parentcd4b54fd38ff3ea3e494e330e9487069ef6762da

stage2 aarch64: add NOP instruction


1 files changed, 10 insertions(+), 0 deletions(-)

src/codegen/aarch64.zig+10
...@@ -238,6 +238,9 @@ pub const Instruction = union(enum) {...@@ -238,6 +238,9 @@ pub const Instruction = union(enum) {
238 fixed: u5 = 0b00101,238 fixed: u5 = 0b00101,
239 op: u1,239 op: u1,
240 },240 },
241 NoOperation: packed struct {
242 fixed: u32 = 0b1101010100_0_00_011_0010_0000_000_11111,
243 },
241244
242 pub fn toU32(self: Instruction) u32 {245 pub fn toU32(self: Instruction) u32 {
243 return switch (self) {246 return switch (self) {
...@@ -247,6 +250,7 @@ pub const Instruction = union(enum) {...@@ -247,6 +250,7 @@ pub const Instruction = union(enum) {
247 .ExceptionGeneration => |v| @bitCast(u32, v),250 .ExceptionGeneration => |v| @bitCast(u32, v),
248 .UnconditionalBranchRegister => |v| @bitCast(u32, v),251 .UnconditionalBranchRegister => |v| @bitCast(u32, v),
249 .UnconditionalBranchImmediate => |v| @bitCast(u32, v),252 .UnconditionalBranchImmediate => |v| @bitCast(u32, v),
253 .NoOperation => |v| @bitCast(u32, v),
250 };254 };
251 }255 }
252256
...@@ -599,6 +603,12 @@ pub const Instruction = union(enum) {...@@ -599,6 +603,12 @@ pub const Instruction = union(enum) {
599 pub fn bl(offset: i28) Instruction {603 pub fn bl(offset: i28) Instruction {
600 return unconditionalBranchImmediate(1, offset);604 return unconditionalBranchImmediate(1, offset);
601 }605 }
606
607 // Nop
608
609 pub fn nop() Instruction {
610 return Instruction{ .NoOperation = {} };
611 }
602};612};
603613
604test "" {614test "" {