From 882e81ec1cde25f15945c435ea098145c0c93d21 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Sun, 1 May 2011 01:16:36 +0200 Subject: [PATCH] Explicitly add %st as second argument to fucomip. It should really be assumed implicitly, but the GNU as shipping with Mac OS X 10.6 (Apple Inc version cctools-800~26, GNU assembler version 1.38) chokes on the instruction otherwise. --- gen/asm-x86-64.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gen/asm-x86-64.h b/gen/asm-x86-64.h index 32b783d3..e2c3ecd3 100644 --- a/gen/asm-x86-64.h +++ b/gen/asm-x86-64.h @@ -1897,6 +1897,20 @@ namespace AsmParserx8664 else stmt->error("instruction allows only ST as second argument"); } + + if ( op == Op_FCmpFlgP ) + { + // Explicitly add %st as second argument to fucomip – it should + // be implicit, but the GNU as shipping with Mac OS X (Apple Inc + // version cctools-800~26, GNU assembler version 1.38) chokes on + // it otherwise. + assert ( nOperands == 1 ); + nOperands = 2; + operands[1] = operands[0]; + memset ( operands, 0, sizeof( Operand ) ); + operands[0].cls = Opr_Reg; + operands[0].reg = Reg_ST; + } if ( opInfo->needsType ) {