#include "config.h"
#include <string.h>
#include "cf_assert.h"
#include "cf_defs.h"
#include "ffops.h"
Go to the source code of this file.
|
#define | LIKELY(expression) |
| For optimizing if-branches.
|
|
#define | UNLIKELY(expression) |
|
◆ LIKELY
#define LIKELY |
( |
| expression | ) |
|
Value:
For optimizing if-branches.
Definition at line 19 of file ffops.cc.
◆ UNLIKELY
#define UNLIKELY |
( |
| expression | ) |
|
◆ ff_biginv()
int ff_biginv |
( |
const int | a | ) |
|
Definition at line 81 of file ffops.cc.
82{
84 return a;
85 int p, q, r1, r2, y1, y2;
87 q = r1 / a;
88 y1 = -q;
89 r1 -= a * q;
90 if (r1 == 1)
92 r2 = a;
93 y2 = 1;
94 for (;;)
95 {
96 q = r2 / r1;
97 y2 -= y1 * q;
98 r2 -= r1 * q;
99 if (r2 == 1)
100 {
101 if (y2 > 0)
102 return y2;
103 else
105 }
106 q = r1 / r2;
107 y1 -= y2 * q;
108 r1 -= r2 * q;
109 if (r1 == 1)
110 {
111 if (y1 > 0)
112 return y1;
113 else
115 }
116 }
117}
#define UNLIKELY(expression)
◆ ff_newinv()
int ff_newinv |
( |
const int | a | ) |
|
Definition at line 39 of file ffops.cc.
40{
41 if (a < 2)
43 int p, q, r1, r2, y1, y2;
45 q = r1 / a;
46 y1 = -q;
47 r1 -= a * q;
48 if (r1 == 1)
49 {
53 }
54 r2 = a;
55 y2 = 1;
56 for (;;)
57 {
58 q = r2 / r1;
59 y2 -= y1 * q;
60 r2 -= r1 * q;
61 if (r2 == 1)
62 {
63 if (y2 < 0)
67 }
68 q = r1 / r2;
69 y1 -= y2 * q;
70 r1 -= r2 * q;
71 if (r1 == 1)
72 {
73 if (y1 < 0)
77 }
78 }
79}
◆ ff_setprime()
void ff_setprime |
( |
const int | p | ) |
|
◆ ff_big
◆ ff_halfprime
◆ ff_invtab
VAR short* ff_invtab = new short [32767] |
◆ ff_prime