| ... | ... | @@ -409,7 +409,7 @@ pub const Insn = packed struct { |
| 409 | 409 | msh = MSH, |
| 410 | 410 | }; |
| 411 | 411 | |
| 412 | | const AluOp = enum(u8) { |
| 412 | pub const AluOp = enum(u8) { |
| 413 | 413 | add = ADD, |
| 414 | 414 | sub = SUB, |
| 415 | 415 | mul = MUL, |
| ... | ... | @@ -432,7 +432,7 @@ pub const Insn = packed struct { |
| 432 | 432 | double_word = DW, |
| 433 | 433 | }; |
| 434 | 434 | |
| 435 | | const JmpOp = enum(u8) { |
| 435 | pub const JmpOp = enum(u8) { |
| 436 | 436 | ja = JA, |
| 437 | 437 | jeq = JEQ, |
| 438 | 438 | jgt = JGT, |
| ... | ... | @@ -453,7 +453,7 @@ pub const Insn = packed struct { |
| 453 | 453 | }; |
| 454 | 454 | |
| 455 | 455 | fn imm_reg(code: u8, dst: Reg, src: anytype, off: i16) Insn { |
| 456 | | const imm_or_reg = if (@typeInfo(@TypeOf(src)) == .EnumLiteral) |
| 456 | const imm_or_reg = if (@TypeOf(src) == Reg or @typeInfo(@TypeOf(src)) == .EnumLiteral) |
| 457 | 457 | ImmOrReg{ .reg = @as(Reg, src) } |
| 458 | 458 | else |
| 459 | 459 | ImmOrReg{ .imm = src }; |
| ... | ... | @@ -478,7 +478,7 @@ pub const Insn = packed struct { |
| 478 | 478 | }; |
| 479 | 479 | } |
| 480 | 480 | |
| 481 | | fn alu(comptime width: comptime_int, op: AluOp, dst: Reg, src: anytype) Insn { |
| 481 | pub fn alu(comptime width: comptime_int, op: AluOp, dst: Reg, src: anytype) Insn { |
| 482 | 482 | const width_bitfield = switch (width) { |
| 483 | 483 | 32 => ALU, |
| 484 | 484 | 64 => ALU64, |
| ... | ... | @@ -540,7 +540,7 @@ pub const Insn = packed struct { |
| 540 | 540 | return alu(64, .arsh, dst, src); |
| 541 | 541 | } |
| 542 | 542 | |
| 543 | | fn jmp(op: JmpOp, dst: Reg, src: anytype, off: i16) Insn { |
| 543 | pub fn jmp(op: JmpOp, dst: Reg, src: anytype, off: i16) Insn { |
| 544 | 544 | return imm_reg(JMP | @enumToInt(op), dst, src, off); |
| 545 | 545 | } |
| 546 | 546 | |