Skip to content

[PowerPC] Support half/f16 #39212

@vchuravy

Description

@vchuravy
Bugzilla Link 39865
Resolution FIXED
Resolved on Jan 17, 2021 20:15
Version trunk
OS Linux
CC @hfinkel,@nemanjai

Extended Description

I was exploring adding support for half/f16 in the Julia frontend and while testing on PPC I discovered that the backend doesn't support instructions targeting f16.

I am in particular interested in f16 support since the codegen of the Julia front-end does not differentiate between GPU/CPU codegen and I want to target NVIDIAs native f16 support. It would be absolutely fine if the PPC backend bails out early and emits library-calls.

I no longer have my particular test-case at hand, but running the fairly generic X86 testcase yields:

➜ llvm git:(master) llc -mtriple=ppc64le-unknown-linux-gnu test/CodeGen/X86/half.ll

LLVM ERROR: Cannot select: 0x561ac6ea0158: f32,ch = load<(load 2 from %ir.addr), anyext from f16> 0x561ac6e408f8, 0x561ac6e9ffb8, undef:i64
0x561ac6e9ffb8: i64,ch = CopyFromReg 0x561ac6e408f8, Register:i64 %0
0x561ac6ea0290: i64 = Register %0
0x561ac6ea0088: i64 = undef
In function: test_extend32

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions