A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-March/033895.html below:

acceptability of asm in python code?

[Python-Dev] Re: acceptability of asm in python code? [Python-Dev] Re: acceptability of asm in python code?Mats Wichmann mats@laplaza.org
Sat, 08 Mar 2003 15:31:25 -0700
 >
 >In the BINARY_ADD opcode, and in most arithmetic opcodes, there is a line
 >that checks for overflow that looks like this:
 >
 >if ((i^a) < 0 && (i^b) < 0) goto slow_add;
 >
 >I got a small speedup by replacing this with a macro defined thusly:
 >
 >#if defined(_MSC_VER) and defined(_M_IX86)
 >#define IF_OVERFLOW_GOTO(X) __asm { jo X };
 >#else
 >#define IF_OVERFLOW_GOTO(X) if ((i^a) < 0 && (i^b) < 0) goto X;
 >#endif
 >
 >Would this case be an acceptable use of snippets of inline assembler?

I'd personally be more comfortable if we didn't go
down that road; there are compilers that don't support
asm's (e.g. the Intel Linux compilers).




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4