Skip to content

Commit 3fd93b9

Browse files
committed
temp patch float -> integer
1 parent bbb0eb1 commit 3fd93b9

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

llvm/include/llvm/CodeGenTypes/LowLevelType.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,25 +139,25 @@ class LLT {
139139
}
140140

141141
// Get a 16-bit brain float value.
142-
static constexpr LLT bfloat() { return integer(16); }
142+
static constexpr LLT bfloat() { return floatingPoint(16, FPInfo::VARIANT_FLOAT_1); }
143143

144144
/// Get a 16-bit IEEE half value.
145-
static constexpr LLT float16() { return integer(16); }
145+
static constexpr LLT float16() { return floatingPoint(16, FPInfo::IEEE_FLOAT); }
146146

147147
/// Get a 32-bit IEEE float value.
148-
static constexpr LLT float32() { return integer(32); }
148+
static constexpr LLT float32() { return floatingPoint(32, FPInfo::IEEE_FLOAT); }
149149

150150
/// Get a 64-bit IEEE double value.
151-
static constexpr LLT float64() { return integer(64); }
151+
static constexpr LLT float64() { return floatingPoint(64, FPInfo::IEEE_FLOAT); }
152152

153153
/// Get a 80-bit X86 floating point value.
154-
static constexpr LLT x86fp80() { return integer(80); }
154+
static constexpr LLT x86fp80() { return floatingPoint(80, FPInfo::VARIANT_FLOAT_1); }
155155

156156
/// Get a 128-bit IEEE quad value.
157157
static constexpr LLT float128() { return floatingPoint(128, FPInfo::IEEE_FLOAT); }
158158

159159
/// Get a 128-bit PowerPC double double value.
160-
static constexpr LLT ppcf128() { return integer(128); }
160+
static constexpr LLT ppcf128() { return floatingPoint(128, FPInfo::VARIANT_FLOAT_1); }
161161

162162
/// Get a low-level fixed-width vector of some number of elements and element
163163
/// width.

llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,11 @@ static LegalityPredicate elementTypeIsLegal(unsigned TypeIdx) {
282282
static const LLT S1 = LLT::scalar(1);
283283
static const LLT S8 = LLT::scalar(8);
284284
static const LLT S16 = LLT::scalar(16);
285+
static const LLT F16 = LLT::integer(16);
285286
static const LLT S32 = LLT::scalar(32);
286-
static const LLT F32 = LLT::float32();
287+
static const LLT F32 = LLT::integer(32);
287288
static const LLT S64 = LLT::scalar(64);
288-
static const LLT F64 = LLT::float64();
289+
static const LLT F64 = LLT::integer(64);
289290
static const LLT S96 = LLT::scalar(96);
290291
static const LLT S128 = LLT::scalar(128);
291292
static const LLT S160 = LLT::scalar(160);
@@ -305,7 +306,7 @@ static const LLT V10S16 = LLT::fixed_vector(10, 16);
305306
static const LLT V12S16 = LLT::fixed_vector(12, 16);
306307
static const LLT V16S16 = LLT::fixed_vector(16, 16);
307308

308-
static const LLT V2F16 = LLT::fixed_vector(2, LLT::float16());
309+
static const LLT V2F16 = LLT::fixed_vector(2, LLT::integer(16));
309310
static const LLT V2BF16 = V2F16; // FIXME
310311

311312
static const LLT V2S32 = LLT::fixed_vector(2, 32);
@@ -3198,10 +3199,10 @@ bool AMDGPULegalizerInfo::legalizeFMad(
31983199

31993200
// TODO: Always legal with future ftz flag.
32003201
// FIXME: Do we need just output?
3201-
if (Ty == LLT::float32() &&
3202+
if (Ty == F32 &&
32023203
MFI->getMode().FP32Denormals == DenormalMode::getPreserveSign())
32033204
return true;
3204-
if (Ty == LLT::float16() &&
3205+
if (Ty == F16 &&
32053206
MFI->getMode().FP64FP16Denormals == DenormalMode::getPreserveSign())
32063207
return true;
32073208

@@ -3753,8 +3754,6 @@ bool AMDGPULegalizerInfo::legalizeFPow(MachineInstr &MI,
37533754
Register Src1 = MI.getOperand(2).getReg();
37543755
unsigned Flags = MI.getFlags();
37553756
LLT Ty = B.getMRI()->getType(Dst);
3756-
const LLT F16 = LLT::float16();
3757-
const LLT F32 = LLT::float32();
37583757

37593758
if (Ty == F32) {
37603759
auto Log = B.buildFLog2(F32, Src0, Flags);
@@ -3797,7 +3796,6 @@ bool AMDGPULegalizerInfo::legalizeFFloor(MachineInstr &MI,
37973796
MachineIRBuilder &B) const {
37983797

37993798
const LLT S1 = LLT::scalar(1);
3800-
const LLT F64 = LLT::float64();
38013799
Register Dst = MI.getOperand(0).getReg();
38023800
Register OrigSrc = MI.getOperand(1).getReg();
38033801
unsigned Flags = MI.getFlags();

0 commit comments

Comments
 (0)