~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to mpeglib/lib/util/mmx.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  wrapper for MMX calls
 
3
  Copyright (C) 2000  Martin Vogt
 
4
 
 
5
  This program is free software; you can redistribute it and/or modify
 
6
  it under the terms of the GNU Library General Public License as published by
 
7
  the Free Software Foundation.
 
8
 
 
9
  For more information look at the file COPYRIGHT in this package
 
10
 
 
11
 */
 
12
 
 
13
 
 
14
 
 
15
#include "mmx.h"
 
16
 
 
17
static int mmSupport=-1;
 
18
 
 
19
#ifdef HAVE_CONFIG_H
 
20
#include "config.h"
 
21
#endif
 
22
 
 
23
 
 
24
#ifndef INTEL
 
25
int emms() {
 
26
  printf("urgs! emms() never should happen\n");
 
27
  exit(0);
 
28
}
 
29
  
 
30
int mm_support() {
 
31
  return 0;
 
32
}
 
33
 
 
34
#endif
 
35
 
 
36
 
 
37
#ifdef INTEL
 
38
 
 
39
extern unsigned int cpu_flags(void);
 
40
 
 
41
int emms() {
 
42
  __asm__  ("emms");
 
43
  return 1;
 
44
}
 
45
 
 
46
#define MMX_CPU              0x800000
 
47
 
 
48
int mm_support() {
 
49
 
 
50
  int val;
 
51
  int* rval = &val;
 
52
 
 
53
  if (mmSupport == -1) {
 
54
 
 
55
    val=cpu_flags(); 
 
56
    if (val & MMX_CPU) {
 
57
      mmSupport=1;
 
58
    } else {
 
59
      mmSupport=0;
 
60
    }
 
61
    
 
62
  }
 
63
  /* Return */
 
64
  return(mmSupport);
 
65
}
 
66
 
 
67
 
 
68
 
 
69
 
 
70
 
 
71
#endif