# Integer arithmetic support on future HPC systems

I writing some robust geometric algorithms using quantization + integer arithmetic for evaluating exact predicates. However, since BlueGene's integer support is so terrible, it occurred to me that the use of integer math may (weirdly) kill the portability of the library in terms of performance.

How worried should I be about this? Are future HPC systems likely to have similar issues? I realize that a question about predicting the future may be difficult or impossible to answer, but this seems like an important design decision to get right. Any thoughts are appreciated.

In this case, there's an easy fallback: I can run an initial filtering step using floating point interval arithmetic (assuming the architecture has "round to $-\infty$" support). This has zero effect on the results since I'd fall back to integers if the filter fails. Other integer-based algorithms may not be so lucky, however.

-
I often see people using a type called real which they define as float or double or whatever. GPU Hardware is often benchmarked in floating point operations. For scientific computing double seems to be more important. When you need integer operations, you have no choice anyway. –  vanCompute Feb 20 '13 at 12:53
Would you mind being more specific about what you mean by its integer support being "terrible"? –  Jack Poulson Feb 20 '13 at 15:55
If you max out the number of threads on a BGQ node, each thread gets to do 1 integer op every other cycle, since four threads share a dual issue integer ALU. –  Geoffrey Irving Feb 20 '13 at 17:30

## 2 Answers

Different vendors have different paths forward on this, and most of it is under NDA. If you really want to know, ask Intel, AMD, IBM, ARM, and maybe NVIDIA for briefings under NDA. Some of these vendors will have full support for vectorized integer instructions in the future so that integer will keep up with floating-point, and some of them may not. For those that don't, you will most likely see performance at the single add, multiply, or logical operation per clock level with divide and remainder operations taking many cycles.

-
Thanks. I'll make sure to keep the floating point filter available as a compile time choice. –  Geoffrey Irving Feb 20 '13 at 17:31

To answer your first question: I wouldn't worry about floating-point being faster than integers. If floating point operations are faster than regular integer operations, I don't see why you shouldn't use them. If you stay within 23 bits, all single-precision floating-point operations on integer values should be identical to the integer operations on the same values.

-
I would worry. Some integer operations are used for subsequent indexing. Using floats for these operations requires type conversion and limits you to 23-bit indices. There are plenty of codes that need more than that. –  Bill Barth Feb 20 '13 at 14:36