编译报错:"错误:已禁用 SSE 却在 SSE 寄存器中返回"是什么原因?如何解决?

发布于 2022-09-11 19:28:03 字数 1889 浏览 15 评论 0

问题说明

c语言编写的内核模块代码编译时报错:

 错误:已禁用 SSE 却在 SSE 寄存器中返回
                     struct eemtcp_subflow_item *sorted_subflow, int *base_round, int *base_rtt) {
                            ^~~~~~~~~~~~~~~~~~~

背景

  1. 编译器版本:c90
  2. 编写的是linux核心模块代码
  3. 问题代码:

    • 主要方法代码

      /* 根据公式计算平均吞吐量 */
      float get_loss_throughput_model_value(int k, int send_file_lengths[], int send_rounds[], 
                          struct eemtcp_subflow_item *sorted_subflow, int *base_round, int *base_rtt) {
        float throughput_sum = 0;
        float later_sum = 0;
        float throughput;
        int i;
        for(i = 0; i < k; i++) {
          throughput = send_file_lengths[i]/(send_rounds[i] * get_sock_rtt(sorted_subflow[i].subflow_sock));
          throughput_sum += throughput;
          if(sorted_subflow[i].is_wifi_port){
            later_sum += WIFI_POWER_PER_BIT * throughput + WIFI_OTHER_POWER ;
          } else {
            later_sum += LTE_POWER_PER_BIT * throughput + LTE_OTHER_POWER ;
          }
        }
        return (float) throughput_sum - (*base_round) * (*base_rtt) * later_sum;
      }
      
    • struct eemtcp_subflow_item声明代码

      struct eemtcp_subflow_item {
        struct sock *subflow_sock;
        float power_per_bit;
        int rtt;
        bool is_wifi_port;
      };
      
    • get_loss_throughput_model_value使用代码

      int send_file_lengths[i];
      int send_rounds[i];
      int base_round = 1;
      int base_rtt = sorted_subflow[i - 1].rtt;
      
      get_nr(sorted_subflow, send_file_lengths, send_rounds, &base_round, &base_rtt, i, skb->len);
      package_loss_transport_model[i] = 
            get_loss_throughput_model_value(i, send_file_lengths, send_rounds, sorted_subflow, &base_round, &base_rtt);

google找不到该错误相关信息, 程序中其他地方也使用了该结构体,但是没有这个错误。不知道是什么原因导致的报错。程序中也没有使用sse指令集代码。请问该如何解决?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

看轻我的陪伴 2022-09-18 19:28:03

解决方法:不要在linux内核模块代码中使用浮点数。
原因:
https://stackoverflow.com/que...
https://stackoverflow.com/que...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文