gcc - x86 assembly to get register as int? -


the portable way of accessing bits in fp representation write union, writes memory. @ least, that's glibc does. code below looks wildly overcomplicated, slow. i'm wondering whether there x86 instruction copy 64 accessible bits of fp register integer register bits can manipulated? wouldn't portable, idea have inline function, , each port has implement standard clean (and fast) routine.

in case i'm looking @ isnan, implemented as:

#define extract_words(ix0,ix1,d)                \ {                            \   ieee_double_shape_type ew_u;              \   ew_u.value = (d);                     \   (ix0) = ew_u.parts.msw;                   \   (ix1) = ew_u.parts.lsw;                   \ } while (0)  int __isnan(double x) {     int32_t hx,lx;     extract_words(hx,lx,x);     hx &= 0x7fffffff;     hx |= (u_int32_t)(lx|(-lx))>>31;     hx = 0x7ff00000 - hx;     return (int)(((u_int32_t)hx)>>31); } 

there no x86 instruction copy fp register integer register or vice versa. can want using sse instrinsics instead, since sse register can contain both integer , floating point values.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -