Skip to content

Commit 875e014

Browse files
[AArch64] Codegen for new SCVTF/UCVTF variants (FEAT_FPRCVT) (#123767)
Adds patterns of new SCVTF/UCVTF instructions to tablegen, with associated test .ll file.
1 parent 7ac4e46 commit 875e014

File tree

3 files changed

+452
-3
lines changed

3 files changed

+452
-3
lines changed

llvm/lib/Target/AArch64/AArch64InstrFormats.td

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5511,6 +5511,15 @@ multiclass IntegerToFPSIMDScalar<bits<2> rmode, bits<3> opcode, string asm, SDPa
55115511
let Inst{31} = 1; // 64-bit FPR flag
55125512
let Inst{23-22} = 0b00; // 32-bit FPR flag
55135513
}
5514+
5515+
def : Pat<(f16 (node (i32 (extractelt (v4i32 V128:$Rn), (i64 0))))),
5516+
(!cast<Instruction>(NAME # HSr) (EXTRACT_SUBREG $Rn, ssub))>;
5517+
def : Pat<(f64 (node (i32 (extractelt (v4i32 V128:$Rn), (i64 0))))),
5518+
(!cast<Instruction>(NAME # DSr) (EXTRACT_SUBREG $Rn, ssub))>;
5519+
def : Pat<(f16 (node (i64 (extractelt (v2i64 V128:$Rn), (i64 0))))),
5520+
(!cast<Instruction>(NAME # HDr) (EXTRACT_SUBREG $Rn, dsub))>;
5521+
def : Pat<(f32 (node (i64 (extractelt (v2i64 V128:$Rn), (i64 0))))),
5522+
(!cast<Instruction>(NAME # SDr) (EXTRACT_SUBREG $Rn, dsub))>;
55145523
}
55155524

55165525
//---
@@ -13319,4 +13328,3 @@ multiclass SIMDThreeSameVectorFP8MatrixMul<string asm>{
1331913328
let Predicates = [HasNEON, HasF8F32MM];
1332013329
}
1332113330
}
13322-

llvm/lib/Target/AArch64/AArch64InstrInfo.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5073,8 +5073,8 @@ defm SCVTF : IntegerToFP<0b00, 0b010, "scvtf", any_sint_to_fp>;
50735073
defm UCVTF : IntegerToFP<0b00, 0b011, "ucvtf", any_uint_to_fp>;
50745074

50755075
let Predicates = [HasNEON, HasFPRCVT] in {
5076-
defm SCVTF : IntegerToFPSIMDScalar<0b11, 0b100, "scvtf">;
5077-
defm UCVTF : IntegerToFPSIMDScalar<0b11, 0b101, "ucvtf">;
5076+
defm SCVTF : IntegerToFPSIMDScalar<0b11, 0b100, "scvtf", any_sint_to_fp>;
5077+
defm UCVTF : IntegerToFPSIMDScalar<0b11, 0b101, "ucvtf", any_uint_to_fp>;
50785078
}
50795079

50805080
def : Pat<(f16 (fdiv (f16 (any_sint_to_fp (i32 GPR32:$Rn))), fixedpoint_f16_i32:$scale)),

0 commit comments

Comments
 (0)