From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Sat, 29 Mar 2014 04:56:39 +0100 From: cinap_lenrek@felloff.net To: 9fans@9fans.net MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] 6c CMP reg, $0 optimization Topicbox-Message-UUID: d25791a4-ead8-11e9-9d60-3106f5b1d025 i changed the compiler to remove unneeded compare with zero instructions when the previous instruction already sets the zero flag in the peephole optimizaiton pass. http://felloff.net/usr/cinap_lenrek/6cpeep.diff this removes compares for zero/non zero tests only. it only looks at the previous non-nop instruction to see if it sets our compare value register. it seems to work fine so far. our pc64 kernel got arround 8K smaller, ghostscript got 5K smaller. i'm not a compiler expert tho, so i'd like to hear if there are any issues with this approach or if there are better ways to do this. -- cinap