writing python extensions in assembly

Dan Upton upton at virginia.edu
Fri May 16 14:28:27 EDT 2008


On Fri, May 16, 2008 at 2:08 PM, inhahe <inhahe at gmail.com> wrote:
>
> "Dan Upton" <upton at virginia.edu> wrote in message
> news:mailman.1236.1210959884.12834.python-list at python.org...
>
>
>>
>> On Fri, May 16, 2008 at 1:27 PM, Mensanator <mensanator at aol.com> wrote:
>>>
>>> Why wouldn't the compilers support it? It's part of the x86
>>> architexture,
>>> isn't it?
>>
>> Yeah, but I don't know if it uses it by default, and my guess is it
>> depends on how the compiler back end goes about optimizing the code
>> for whether it will see data access/computation patterns amenable to
>> SIMD.
>
> perhaps you explicitly use them with some extended syntax or something?
>

Hey, I learned something today.

http://www.tuleriit.ee/progs/rexample.php

Also, from the gcc manpage, apparently 387 is the default when
compiling for 32 bit architectures, and using sse instructions is
default on x86-64 architectures, but you can use -march=(some
architecture with simd instructions), -msse, -msse2, -msse3, or
-mfpmath=(one of 387, sse, or sse,387) to get the compiler to use
them.

As long as we're talking about compilers and such... anybody want to
chip in how this works in Python bytecode or what the bytecode
interpreter does?  Okay, wait, before anybody says that's
implementation-dependent: does anybody want to chip in what the
CPython implementation does?  (or any other implementation they're
familiar with, I guess)



More information about the Python-list mailing list