Example #1
0
int
main (void)
{
  volatile float64_t minus_e, pi;
  float64_t expected, actual;

  pi = 3.14159265359;
  minus_e = -2.71828;

  expected = pi * minus_e;

  actual = vget_lane_f64 (vmul_n_f64 ((float64x1_t) { pi },
                                       minus_e), 0);
  if (expected != actual)
    abort ();

  return 0;
}
// CHECK-LABEL: define <1 x double> @test_vmul_n_f64(<1 x double> %a, double %b) #0 {
// CHECK:   [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8>
// CHECK:   [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x double>
// CHECK:   [[TMP2:%.*]] = bitcast <1 x double> [[TMP1]] to double
// CHECK:   [[TMP3:%.*]] = fmul double [[TMP2]], %b
// CHECK:   [[TMP4:%.*]] = bitcast double [[TMP3]] to <1 x double>
// CHECK:   ret <1 x double> [[TMP4]]
float64x1_t test_vmul_n_f64(float64x1_t a, float64_t b) {
  return vmul_n_f64(a, b);
}
float64x1_t test_vmul_n_f64(float64x1_t a, float64_t b) {
  // CHECK-LABEL: test_vmul_n_f64
  return vmul_n_f64(a, b);
  // CHECK: fmul {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+.d\[0\]|d[0-9]+}}
}