c44cf7c MdePkg/BaseSynchronizationLib GCC: fix InternalSyncCompareExchange32()

Authored and Committed by lersek 5 years ago
    MdePkg/BaseSynchronizationLib GCC: fix InternalSyncCompareExchange32()
    
    (This patch is identical to the last one, except for the
    InternalSyncCompareExchange16() -> InternalSyncCompareExchange32() and
    "cmpxchgw" -> "cmpxchgl" replacements.)
    
    The CMPXCHG instruction has the following operands:
    - AX (implicit, CompareValue):    input and output
    - destination operand (*Value):   input and output
    - source operand (ExchangeValue): input
    
    The IA32 version of InternalSyncCompareExchange32() correctly marks
    CompareValue as input/output, but it marks (*Value) only as input.
    
    The X64 version of InternalSyncCompareExchange32() attempts to mark both
    CompareValue and (*Value) as input/output, but it doesn't use the
    appropriate constraints for either operand.
    
    Fix these issues. Furthermore, prefer the short "+" constraint for I/O
    operands over the <output-operand-number> constraint that can be applied
    to the input instances of I/O operands.
    
    Cc: Liming Gao <liming.gao@intel.com>
    Cc: Michael D Kinney <michael.d.kinney@intel.com>
    Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1208
    Contributed-under: TianoCore Contribution Agreement 1.1
    Signed-off-by: Laszlo Ersek <lersek@redhat.com>