public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcc/114907] New: Missing __extendhfbf2 in libgcc
@ 2024-05-01 14:16 hjl.tools at gmail dot com
  2024-05-01 14:29 ` [Bug libgcc/114907] " hjl.tools at gmail dot com
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: hjl.tools at gmail dot com @ 2024-05-01 14:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114907

            Bug ID: 114907
           Summary: Missing __extendhfbf2 in libgcc
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcc
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: crazylht at gmail dot com
  Target Milestone: ---
            Target: x86-64

From https://sourceware.org/bugzilla/show_bug.cgi?id=31685

$ cat x.cc
#include <stdlib.h>
#include <cstdint>
#include <array>
#include <iostream>

#define SIZE 8

typedef _Float16 T;
//typedef volatile float T;

void fp16tobf16(_Float16 * f) {
        __bf16 * b = reinterpret_cast<__bf16*>(f);
        for(int i=0; i<SIZE; i++){
            T temp = f[i];
            b[i] = (__bf16) temp;
        }
}

int main(){

    std::array<_Float16, SIZE> a{};
    std::fill(a.begin(), a.end(), (_Float16) 1.7653432432424324);
    fp16tobf16(a.data());

    __bf16 * b = reinterpret_cast<__bf16*>(a.data());

    std::cout << "\n";
    for(int i=0; i<SIZE; i++)
        std::cout << ((double) b[i]) << "\n";

    return 0;
}
$ g++ -O0 -std=c++23 x.cc
/usr/local/bin/ld: /tmp/ccWrIm0Z.o: in function `fp16tobf16(_Float16*)':
x.cc:(.text+0x4d): undefined reference to `__extendhfbf2'
collect2: error: ld returned 1 exit status
$

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2024-05-09  8:18 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-01 14:16 [Bug libgcc/114907] New: Missing __extendhfbf2 in libgcc hjl.tools at gmail dot com
2024-05-01 14:29 ` [Bug libgcc/114907] " hjl.tools at gmail dot com
2024-05-01 14:29 ` hjl.tools at gmail dot com
2024-05-01 14:34 ` hjl.tools at gmail dot com
2024-05-01 14:49 ` [Bug libgcc/114907] __trunchfbf2 should be renamed to __extendhfbf2 hjl.tools at gmail dot com
2024-05-01 16:50 ` hjl.tools at gmail dot com
2024-05-01 16:58 ` hjl.tools at gmail dot com
2024-05-01 18:17 ` jakub at gcc dot gnu.org
2024-05-05  8:31 ` liuhongt at gcc dot gnu.org
2024-05-06 14:08 ` [Bug middle-end/114907] " jakub at gcc dot gnu.org
2024-05-07 19:30 ` cvs-commit at gcc dot gnu.org
2024-05-07 19:31 ` cvs-commit at gcc dot gnu.org
2024-05-07 19:33 ` jakub at gcc dot gnu.org
2024-05-09  4:26 ` cvs-commit at gcc dot gnu.org
2024-05-09  8:18 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).