# Fmax And Fmin无硬件器件下的快速实现 **Repository Path**: LbwFree/fmax_fmin ## Basic Information - **Project Name**: Fmax And Fmin无硬件器件下的快速实现 - **Description**: Fmax And Fmin无硬件器件下的快速实现_不准确对比 - **Primary Language**: C++ - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-04-15 - **Last Updated**: 2024-04-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Fmax Fmin无硬件器件下的快速实现 ## **介绍:** > 在没有fmax的硬件指令的处理器中实现的fmax快速实现 在没有fmin的硬件指令的处理器中实现的fmin快速实现 - 代码中fmax1的实现是对于直接使用比较进行返回较大数 fmax2使用位运算来返回较大数,取消使用了判断运算,可以减少汇编代码中的跳转指令 - 代码中fmin1的实现是对于直接使用比较进行返回较小数 fmin2使用位运算来返回较小数,取消使用了判断运算,可以减少汇编代码中的跳转指令 ## **环境:** - Ubuntu 20.04.6 LTS (GNU/Linux 5.15.0-97-generic x86_64) - gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2) - Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz ## **编译 && 运行:** - g++ fmax.cpp -o fmax -lm -O0 -g - ./fmax ``` Execution time 0: 146682 microseconds ## math库 Execution time 1: 513335 microseconds ## 跳转比较 Execution time 2: 340299 microseconds ## 无跳转快速实现 (本库工作) ``` - g++ fmin.cpp -o fmin -lm -O0 -g - ./fmin ``` Execution time 0: 137283 microseconds ## math库 Execution time 1: 509097 microseconds ## 跳转比较 Execution time 2: 338389 microseconds ## 无跳转快速实现(本库工作) ```