Skip to content

Commit 2143b7c

Browse files
author
Chen Zheng
committed
[PowerPC]perform bitcast lowering only at 64 bit
Perform bitcast lowering requires 64-bit to be native supported, However this is not true on 32-bit targets. Explicitly require 64-bit target. Fixes #92233
1 parent dd8cb3d commit 2143b7c

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

llvm/lib/Target/PowerPC/PPCISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9338,7 +9338,7 @@ SDValue PPCTargetLowering::LowerBITCAST(SDValue Op, SelectionDAG &DAG) const {
93389338
if ((Op.getValueType() != MVT::f128) ||
93399339
(Op0.getOpcode() != ISD::BUILD_PAIR) ||
93409340
(Op0.getOperand(0).getValueType() != MVT::i64) ||
9341-
(Op0.getOperand(1).getValueType() != MVT::i64))
9341+
(Op0.getOperand(1).getValueType() != MVT::i64) || !Subtarget.isPPC64())
93429342
return SDValue();
93439343

93449344
return DAG.getNode(PPCISD::BUILD_FP128, dl, MVT::f128, Op0.getOperand(0),

llvm/test/CodeGen/PowerPC/pr92233.ll

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2+
; RUN: llc -mcpu=pwr9 -verify-machineinstrs < %s -mtriple=powerpc-unknown-linux-gnu | FileCheck %s
3+
4+
define internal fp128 @f(i128 %v) nounwind {
5+
; CHECK-LABEL: f:
6+
; CHECK: # %bb.0: # %entry
7+
; CHECK-NEXT: stwu 1, -32(1)
8+
; CHECK-NEXT: stw 6, 28(1)
9+
; CHECK-NEXT: stw 5, 24(1)
10+
; CHECK-NEXT: stw 4, 20(1)
11+
; CHECK-NEXT: stw 3, 16(1)
12+
; CHECK-NEXT: lxv 34, 16(1)
13+
; CHECK-NEXT: addi 1, 1, 32
14+
; CHECK-NEXT: blr
15+
entry:
16+
%cast = bitcast i128 %v to fp128
17+
ret fp128 %cast
18+
}
19+

0 commit comments

Comments
 (0)