@@ -297,6 +297,32 @@ entry:
297297 ret void
298298}
299299
300+ define void @test_modf (double %dbl , float %flt , ptr %pdbl , ptr %pflt ) {
301+ ; CHECK-LABEL: define void @test_modf(
302+ ; CHECK-SAME: double [[DBL:%.*]], float [[FLT:%.*]], ptr [[PDBL:%.*]], ptr [[PFLT:%.*]]) {
303+ ; CHECK-NEXT: [[ENTRY:.*:]]
304+ ; CHECK-NEXT: [[TMP0:%.*]] = tail call { double, double } @__hipstdpar_modf_f64(double [[DBL]])
305+ ; CHECK-NEXT: [[TMP1:%.*]] = extractvalue { double, double } [[TMP0]], 0
306+ ; CHECK-NEXT: [[TMP2:%.*]] = extractvalue { double, double } [[TMP0]], 1
307+ ; CHECK-NEXT: store double [[TMP2]], ptr [[PDBL]], align 8
308+ ; CHECK-NEXT: [[TMP3:%.*]] = tail call { float, float } @__hipstdpar_modf_f32(float [[FLT]])
309+ ; CHECK-NEXT: [[TMP4:%.*]] = extractvalue { float, float } [[TMP3]], 0
310+ ; CHECK-NEXT: [[TMP5:%.*]] = extractvalue { float, float } [[TMP3]], 1
311+ ; CHECK-NEXT: store float [[TMP5]], ptr [[PFLT]], align 4
312+ ; CHECK-NEXT: ret void
313+ ;
314+ entry:
315+ %0 = tail call { double , double } @llvm.modf.f64 (double %dbl )
316+ %1 = extractvalue { double , double } %0 , 0
317+ %2 = extractvalue { double , double } %0 , 1
318+ store double %2 , ptr %pdbl , align 8
319+ %3 = tail call { float , float } @llvm.modf.f32 (float %flt )
320+ %4 = extractvalue { float , float } %3 , 0
321+ %5 = extractvalue { float , float } %3 , 1
322+ store float %5 , ptr %pflt , align 4
323+ ret void
324+ }
325+
300326define void @test_pow (double %dbl ) {
301327; CHECK-LABEL: define void @test_pow(
302328; CHECK-SAME: double [[DBL:%.*]]) {
@@ -439,6 +465,10 @@ declare hidden double @log1p(double)
439465
440466declare hidden float @log1pf (float )
441467
468+ declare { float , float } @llvm.modf.f32 (float )
469+
470+ declare { double , double } @llvm.modf.f64 (double )
471+
442472declare double @llvm.pow.f64 (double , double )
443473
444474declare hidden double @cbrt (double )
0 commit comments