1 {
2     Copyright (c) 2020 by Jonas Maebe
3 
4     Construct the cpu part of the triplet
5 
6     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10 
11     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15 
16     You should have received a copy of the GNU General Public License
17     along with this program; if not, write to the Free Software
18     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 
20  ****************************************************************************
21 }
22 unit tripletcpu;
23 
24 {$i fpcdefs.inc}
25 
26 interface
27 
28 uses
29   globtype;
30 
tripletcpustrnull31 function tripletcpustr(tripletstyle: ttripletstyle): ansistring;
32 
33 implementation
34 
35 uses
36   globals, cutils, systems, cpuinfo;
37 
tripletcpustrnull38 function tripletcpustr(tripletstyle: ttripletstyle): ansistring;
39   begin
40     result:=lower(cputypestr[current_settings.cputype]);
41     { llvm replaces the cpu name with thumb for when generating thumb code}
42     if (tripletstyle=triplet_llvm) and
43        (current_settings.instructionset=is_thumb) then
44       result:='thumb'+copy(result,4,255);
45     if target_info.endian=endian_big then
46       result:=result+'be';
47   end;
48 
49 
50 end.
51 
52