Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4644,7 +4644,7 @@ bool SPIRVInstructionSelector::selectIToF(Register ResVReg,
TmpType = GR.getOrCreateSPIRVVectorType(TmpType, NumElts, I, TII);
}
SrcReg = createVirtualRegister(TmpType, &GR, MRI, MRI->getMF());
selectBoolToInt(SrcReg, TmpType, I.getOperand(1).getReg(), I, false);
selectBoolToInt(SrcReg, TmpType, I.getOperand(1).getReg(), I, IsSigned);
}
return selectOpWithSrcs(ResVReg, ResType, I, {SrcReg}, Opcode);
}
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/CodeGen/SPIRV/sitofp-with-bool.ll
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
; CHECK-DAG: %[[#float:]] = OpTypeFloat 32
; CHECK-DAG: %[[#bool:]] = OpTypeBool
; CHECK-DAG: %[[#zero:]] = OpConstantNull %[[#int_32]]
; CHECK-DAG: %[[#one:]] = OpConstant %[[#int_32]] 1
; CHECK-DAG: %[[#mone:]] = OpConstant %[[#int_32]] 4294967295
; CHECK-DAG: %[[#ptr:]] = OpTypePointer CrossWorkgroup %[[#float]]

; CHECK: OpFunction
; CHECK: %[[#A:]] = OpFunctionParameter %[[#ptr]]
; CHECK: %[[#B:]] = OpFunctionParameter %[[#]]
; CHECK: %[[#cmp_res:]] = OpSGreaterThan %[[#bool]] %[[#B]] %[[#zero]]
; CHECK: %[[#select_res:]] = OpSelect %[[#int_32]] %[[#cmp_res]] %[[#one]] %[[#zero]]
; CHECK: %[[#select_res:]] = OpSelect %[[#int_32]] %[[#cmp_res]] %[[#mone]] %[[#zero]]
; CHECK: %[[#stof_res:]] = OpConvertSToF %[[#]] %[[#select_res]]
; CHECK: OpStore %[[#A]] %[[#stof_res]]

Expand Down
4 changes: 2 additions & 2 deletions llvm/test/CodeGen/SPIRV/uitofp-with-bool.ll
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ entry:
; SPV: %[[#ufp2:]] = OpConvertUToF %[[#vec_float]] %[[#ufp2_res]]
%ufp2 = uitofp <2 x i1> %i1v to <2 x float>
store <2 x float> %ufp2, ptr @G_ufp2
; SPV: %[[#sfp1_res:]] = OpSelect %[[#int_32]] %[[#i1s]] %[[#one_32]] %[[#zero_32]]
; SPV: %[[#sfp1_res:]] = OpSelect %[[#int_32]] %[[#i1s]] %[[#mone_32]] %[[#zero_32]]
; SPV: %[[#sfp1:]] = OpConvertSToF %[[#float]] %[[#sfp1_res]]
%sfp1 = sitofp i1 %i1s to float
store float %sfp1, ptr @G_sfp1
; SPV: %[[#sfp2_res:]] = OpSelect %[[#vec_32]] %[[#i1v]] %[[#ones_32]] %[[#zeros_32]]
; SPV: %[[#sfp2_res:]] = OpSelect %[[#vec_32]] %[[#i1v]] %[[#mones_32]] %[[#zeros_32]]
; SPV: %[[#sfp2:]] = OpConvertSToF %[[#vec_float]] %[[#sfp2_res]]
%sfp2 = sitofp <2 x i1> %i1v to <2 x float>
store <2 x float> %sfp2, ptr @G_sfp2
Expand Down
Loading