blob: 1d7ac959e5bfcbdc56ba5d036c27e2e88b0cad9b [file] [log] [blame]
Dan Gohmane2a7a822015-12-05 20:41:36 +00001; RUN: llc < %s -asm-verbose=false | FileCheck %s
2
3; Test that the frem instruction works.
4
Dan Gohman0c6f5ac2016-01-07 03:19:23 +00005target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
Dan Gohmane2a7a822015-12-05 20:41:36 +00006target triple = "wasm32-unknown-unknown"
7
8; CHECK-LABEL: frem32:
9; CHECK-NEXT: .param f32, f32{{$}}
10; CHECK-NEXT: .result f32{{$}}
Dan Gohmanc7c04452015-12-14 22:56:51 +000011; CHECK-NEXT: {{^}} f32.call $push0=, fmodf, $0, $1{{$}}
Dan Gohmane2a7a822015-12-05 20:41:36 +000012; CHECK-NEXT: return $pop0{{$}}
13define float @frem32(float %x, float %y) {
14 %a = frem float %x, %y
15 ret float %a
16}
17
18; CHECK-LABEL: frem64:
19; CHECK-NEXT: .param f64, f64{{$}}
20; CHECK-NEXT: .result f64{{$}}
Dan Gohmanc7c04452015-12-14 22:56:51 +000021; CHECK-NEXT: {{^}} f64.call $push0=, fmod, $0, $1{{$}}
Dan Gohmane2a7a822015-12-05 20:41:36 +000022; CHECK-NEXT: return $pop0{{$}}
23define double @frem64(double %x, double %y) {
24 %a = frem double %x, %y
25 ret double %a
26}