blob: 1a9c13417b67aeab35dd77c84cb85a29dce7a785 [file] [log] [blame]
Dan Gohman7d7409e2017-02-28 23:37:04 +00001; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals | FileCheck %s
Dan Gohmane2a7a822015-12-05 20:41:36 +00002
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 Gohman7d7409e2017-02-28 23:37:04 +00006target triple = "wasm32-unknown-unknown-wasm"
Dan Gohmane2a7a822015-12-05 20:41:36 +00007
8; CHECK-LABEL: frem32:
9; CHECK-NEXT: .param f32, f32{{$}}
10; CHECK-NEXT: .result f32{{$}}
Dan Gohman26c67652016-01-11 23:38:05 +000011; CHECK-NEXT: {{^}} f32.call $push0=, fmodf@FUNCTION, $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 Gohman26c67652016-01-11 23:38:05 +000021; CHECK-NEXT: {{^}} f64.call $push0=, fmod@FUNCTION, $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}