basix_doc 0.1
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 328 of file int.hpp.


Member Typedef Documentation

typedef unsigned_of_helper<C>::type uC

Definition at line 329 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 336 of file int.hpp.

References long_int_rshift_op< C >::n, and s.

                                   {
    if (s == 0) return;
    if (s < n) {
      dest0 = (dest0 >> s) | (dest1 << (n - s));
      dest1 = dest1 >> s;
    }
    else {
      dest0 = dest1 >> (s - n);
      dest1 = 0;
    }
  }
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 351 of file int.hpp.

References long_int_rshift_op< C >::n, and s.

                                     {
    bool ans;
    if (s == 0) return false;
    if (s < n) {
      ans = (dest0 & (((uC) -1) >> (n - s))) != 0;
      dest0 = (dest0 >> s) | (dest1 << (n - s));
      dest1 = dest1 >> s;
    }
    else {
      ans = dest0 != 0 || (dest1 & (((uC) -1) >> (2*n - s))) != 0;
      dest0 = dest1 >> (s - n);
      dest1 = 0;
    }
    return ans;
  }

Member Data Documentation

const nat n = 2 * n2 [static]

Definition at line 331 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 330 of file int.hpp.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines