wok diff linld/stuff/src/pipehole.awk @ rev 20542

linld: relative lseek for load.cpp
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Nov 30 15:12:24 2018 +0100 (2018-11-30)
parents af959ebf1305
children 16d1d23aefee
line diff
     1.1 --- a/linld/stuff/src/pipehole.awk	Mon Nov 26 09:46:23 2018 +0100
     1.2 +++ b/linld/stuff/src/pipehole.awk	Fri Nov 30 15:12:24 2018 +0100
     1.3 @@ -36,7 +36,7 @@
     1.4  	}
     1.5  	else if (hold == 3) {
     1.6  		hold=0
     1.7 -		if (/^	add	[abcds][ix],/ || /^	sub	[abcds][ix],/) {
     1.8 +		if (/^	add	[abcds][ix],/) {
     1.9  			split($2,regs2,",")
    1.10  			if (regs[1] == regs2[1] && (regs2[2] == "offset" || isnum(regs2[2]))) {
    1.11  				t=$0; sub(/mov/,$1,s)
    1.12 @@ -118,6 +118,13 @@
    1.13  			print "	and	" substr(args[1],2) "," args[2]; next
    1.14  		}
    1.15  	}
    1.16 +	if (/^	add	[bcd]x,/ || /^	sub	[bcd]x,/) {
    1.17 +		split($0,args,",")
    1.18 +		if (isnum(args[2]) && (args[2] % 256 == 0)) {
    1.19 +			sub(/x,/,"h,",s)
    1.20 +			print s "/256"; next
    1.21 +		}
    1.22 +	}
    1.23  	if (/^	add	word ptr/ || /^	sub	word ptr/) {
    1.24  		split($0,args,",")
    1.25  		if (isnum(args[2]) && (args[2] % 256 == 0)) {