]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgcc/config/i386/32/sfp-machine.h
middle-end, c++, i386, libgcc: std::bfloat16_t and __bf16 arithmetic support
[thirdparty/gcc.git] / libgcc / config / i386 / 32 / sfp-machine.h
index d81d9a366ca031c366fd68c23da7d3c8818a0d4b..7b59ff5b9096afb4d5ab0b465a7c43a0e3478427 100644 (file)
             "g" ((USItype) (y1)),                              \
             "2" ((USItype) (x0)),                              \
             "g" ((USItype) (y0)))
+#define __FP_FRAC_ADDI_4(x3,x2,x1,x0,i)                                \
+  __asm__ ("add{l} {%4,%3|%3,%4}\n\t"                          \
+          "adc{l} {$0,%2|%2,0}\n\t"                            \
+          "adc{l} {$0,%1|%1,0}\n\t"                            \
+          "adc{l} {$0,%0|%0,0}"                                \
+          : "+r" ((USItype) (x3)),                             \
+            "+&r" ((USItype) (x2)),                            \
+            "+&r" ((USItype) (x1)),                            \
+            "+&r" ((USItype) (x0))                             \
+          : "g" ((USItype) (i)))
 
 
+#define _FP_MUL_MEAT_S(R,X,Y)                          \
+  _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_D(R,X,Y)                          \
+  _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
 #define _FP_MUL_MEAT_Q(R,X,Y)                          \
   _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
 
+#define _FP_DIV_MEAT_S(R,X,Y)   _FP_DIV_MEAT_1_loop(S,R,X,Y)
+#define _FP_DIV_MEAT_D(R,X,Y)   _FP_DIV_MEAT_2_udiv(D,R,X,Y)
 #define _FP_DIV_MEAT_Q(R,X,Y)   _FP_DIV_MEAT_4_udiv(Q,R,X,Y)
 
+#define _FP_NANFRAC_H          _FP_QNANBIT_H
+#define _FP_NANFRAC_B          _FP_QNANBIT_B
 #define _FP_NANFRAC_S          _FP_QNANBIT_S
 #define _FP_NANFRAC_D          _FP_QNANBIT_D, 0
 /* Even if XFmode is 12byte,  we have to pad it to
 #define _FP_NANFRAC_Q          _FP_QNANBIT_Q, 0, 0, 0
 
 #ifndef _SOFT_FLOAT
+#define FP_EX_SHIFT 0
+
+#define _FP_DECL_EX \
+  unsigned short _fcw __attribute__ ((unused)) = FP_RND_NEAREST;
+
 #define FP_RND_NEAREST         0
 #define FP_RND_ZERO            0xc00
 #define FP_RND_PINF            0x800
 
 #define FP_RND_MASK            0xc00
 
-#define _FP_DECL_EX \
-  unsigned short _fcw __attribute__ ((unused)) = FP_RND_NEAREST;
-
 #define FP_INIT_ROUNDMODE                              \
   do {                                                 \
     __asm__ __volatile__ ("fnstcw\t%0" : "=m" (_fcw)); \