Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Perlito5::X64::Assembler - add scale factors for operands
  • Loading branch information
fglock committed Mar 24, 2013
1 parent 073e847 commit 27f3c4b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src5/lib/Perlito5/X64/Assembler.pm
Expand Up @@ -69,6 +69,15 @@ sub r13 { $r_r13 }
sub r14 { $r_r14 }
sub r15 { $r_r15 }

#--- scale factors for operands

sub times_1 { 0 }
sub times_2 { 1 }
sub times_4 { 2 }
sub times_8 { 3 }
sub times_int_size { times_4 }
sub times_pointer_size { times_8 }

#--- general

sub new {
Expand Down Expand Up @@ -169,6 +178,14 @@ sub _push {
}
}

# Push a 32 bit integer, and guarantee that it is actually pushed as a
# 32 bit value, the normal push will optimize the 8 bit case.
sub _push_imm32 {
my ( $src ) = @_;
emit(0x68);
emitl($src); # int32
}

sub _pushfq {
emit(0x9C);
}
Expand Down

0 comments on commit 27f3c4b

Please sign in to comment.