Re: [PATCH v2] improve folding of expressions that move a single bit around

2016-12-01 Thread Jeff Law
On 12/01/2016 04:21 AM, Paolo Bonzini wrote: In code like the following from KVM: /* it is a read fault? */ error_code = (exit_qualification << 2) & PFERR_FETCH_MASK; it would be nicer to write /* it is a read fault? */ error_code = (exit_qualification & VMX_EPT

Re: [PATCH v2] improve folding of expressions that move a single bit around

2016-12-01 Thread Richard Biener
On Thu, 1 Dec 2016, Paolo Bonzini wrote: > In code like the following from KVM: > > /* it is a read fault? */ > error_code = (exit_qualification << 2) & PFERR_FETCH_MASK; > > it would be nicer to write > > /* it is a read fault? */ > error_code = (exit_qualificat

[PATCH v2] improve folding of expressions that move a single bit around

2016-12-01 Thread Paolo Bonzini
In code like the following from KVM: /* it is a read fault? */ error_code = (exit_qualification << 2) & PFERR_FETCH_MASK; it would be nicer to write /* it is a read fault? */ error_code = (exit_qualification & VMX_EPT_READ_FAULT_MASK) ? PFERR_FETCH_MASK : 0; ins