long_int_rshift_op< C > Struct Template Reference

#include <int.hpp>

List of all members.

Public Types

Static Public Member Functions

Static Public Attributes


Detailed Description

template<typename C>
struct mmx::long_int_rshift_op< C >

Definition at line 361 of file int.hpp.


Member Typedef Documentation

typedef unsigned_of_helper<C>::type uC

Definition at line 362 of file int.hpp.


Member Function Documentation

static void op ( uC dest1,
uC dest0,
nat  s 
) [inline, static]

dest1 R + dest0 >>= s

Definition at line 369 of file int.hpp.

References long_int_rshift_op< C >::n.

00369                                    {
00370     if (s == 0) return;
00371     if (s < n) {
00372       dest0 = (dest0 >> s) | (dest1 << (n - s));
00373       dest1 = dest1 >> s;
00374     }
00375     else {
00376       dest0 = dest1 >> (s - n);
00377       dest1 = 0;
00378     }
00379   }

static bool op_b ( uC dest1,
uC dest0,
nat  s 
) [inline, static]

dest1 R + dest0 >>= s. Return true iff some nonzero bits have been pushed out.

Definition at line 384 of file int.hpp.

References long_int_rshift_op< C >::n.

00384                                      {
00385     bool ans;
00386     if (s == 0) return false;
00387     if (s < n) {
00388       ans = (dest0 & (((uC) -1) >> (n - s))) != 0;
00389       dest0 = (dest0 >> s) | (dest1 << (n - s));
00390       dest1 = dest1 >> s;
00391     }
00392     else {
00393       ans = dest0 != 0 || (dest1 & (((uC) -1) >> (2*n - s))) != 0;
00394       dest0 = dest1 >> (s - n);
00395       dest1 = 0;
00396     }
00397     return ans;
00398   }


Member Data Documentation

const nat n = 2 * n2 [static]

Definition at line 364 of file int.hpp.

Referenced by long_int_rshift_op< C >::op(), and long_int_rshift_op< C >::op_b().

const nat n2 = 4 * sizeof (uC) [static]

Definition at line 363 of file int.hpp.


The documentation for this struct was generated from the following file:

Generated on 6 Dec 2012 for basix by  doxygen 1.6.1