Akari the Testing Framework for optimizing and porting x86 Intrinsics to OpenPOWER

Intel x86-64 CPU are everywhere. From laptop PC to supercomputer. Intel x86-64 is CISC(Complex Instruction Set Computer) and very long history. And once code runs on Intel x86-64, it must run Intel forever. So Intel carries a lot of past heritage. On the other hand,IBM Power and ARM are RISC(Reduced Instruction Set Computer) and its same in the aspect of “it runs once, it must run forever” but instruction set are simple and RISC can use relatively new technology. So many supercomputer use RISC. But No 1 of market share of supercomputer is Intel because many Linux application is made for Intel. So if application for Intel x86-64 can run RISC like ARM or OpenPOWER by very optimized way. It's great advancement of Computer Science and Technology. There are many SIMD Intel x86 intrinsic function.Intel intrinsic function runs only on Intel,not on OpenPOWER Systems.So we need to port Intel x86 intrinsic code to OpenPOWER equivalent code to run application by good performance on OpenPOWER Systems.But porting Intel x86 Intrinsics to OpenPOWER Intrinsics is technically challenging.

Intrinsic functions is a way to directly access SIMD instructions from high level language like C. Intrinsic functions are specific to CPU architecture. Intel has specific intrinsic function and OpenPOWER and ARM has. And Intel intrinsic function are not 1 to 1 correspondence to other RISC intrinsic function. So porting is needed. porting has unique wrapping structure like below.

extern __inline __m128d __attribute__((__gnu_inline__,__always_inline__,__artificial__))
_mm_add_pd (__m128d __A, __m128d __B)                                                   
  return (__m128d) ((__v2df)__A + (__v2df)__B);                                         

Porting seems easy but one problem exist. Is behavior same? Need validating correctness of porting. But we cannot make sure porting is correct by gazing source code. Way to validate source code of porting is- for example source code shown above- Input random value to __A and __B to Intel intrinsic function and that of ported to OpenPOWER or other RISC architecture.And get return value from these function and make sure return value is same between Intel intrinsic functions and that of ported to other RISC.To make this testing framework. We have to mutually connect Intel and OpenPOWER or other RISC on the cloud computer by internet or other computer network.

AkariSpecification Architecture

AkariSpecification Architecture v0.1.2 2022/08/30 09:00(JST) Takahashi Akari                    
+-------------------+               +----------------------+               +-------------------+
|  IntelCPU Server  |               |    Central Server    |               |  OpenPOWER Server |
|       VPS         |               |         VPS          |               |     Minicloud     |
|      x86_64       +<-SSH or SCP ->+       x86_64         +<-SSH or SCP-->+       ppc64       |
|  Ubuntu 20.04LTS  |               |  Ubuntu 20.04LTS     |               |  Ubuntu 20.04LTS  |
|        GCC        |               |        Python        |               |        GCC        |
|                   |               |        Fabric        |               |                   |
+---------+---------+               +----------+-----------+               +---------+---------+
          |                                   |                                      |          
                                          SSH or SCP                                            
                                   |   Admin Computer   |                                       
                                   |      ClientPC      |                                       
                                   |       x86_64       |                                       
                                   |   Ubuntu 22.04LTS  |                                       

We are only part of software developer in worldwide.

We don't want to follow any religious leaders, but sometimes we respect what they say.