Difference between revisions of "Language related articles"

From Lazarus wiki
Jump to navigationJump to search
(No difference)

Revision as of 04:57, 8 September 2004

Back to Compiler development articles

Things FPC 1.9.x currently doesn't support

Things FPC 1.9.x partially support

  • variants rumouredly have some problems.
  • currency support needs testing (there was some work done recently afaik)
  • Dynarrays, inclding Slice function seems to have problems.
  • Reintroduce; is only skipped not processed (at least the compiler says so)

The heavily variants using package DECAL has been ported recently and worked fine. So I think the variants problems are mostly over, and only atypical conversions miss. (that can be usually fixed easily if you submit a bug with a simple example that works in Delphi and not in FPC). However some RTL support (the wrapper classes) are largely unimplemented

New in 1.9.x (not yet in the docs)

  • {$fputype xxx) to select a certain fpu style or -Cfxxx on command line/cfg file
    • all: soft (not yet implemented)
    • i386: x87, sse, sse2
      • code compiled with sse uses the sse to do calculations with the single data type. This code runs only on Pentium III and above and AthlonXP and above
      • code compiled with sse2 uses the sse unit to do calculations with the single and double data type. This code runs only on PentiumIV and above and Athlon64 and above
    • x86-64: sse64
    • powerpc: standard
    • arm: libgcc, fpa, fpa10, fpa11, vfp
  • procedural property support (property outside a class with normal procedures as getters/setters.
  • reuse keywords imports all units the reused unit imports.
  • reintroduce omits warning about hidden methods
  • Some mac pascal extensions, see Mode MacPas.
  • system.prefetch(const mem); depending on the target processor the compiler generates a prefetch hint on the given memory location. On iA32 this is the sse instruction prefetchnta which is supported by Pentium3/AthlonXP and above. If the intruction set, selected with -Cp (on iA-32, prefetch instructions are generated for -Oppentium3 and above) doesn't support this instruction, no code is generated for prefetch.
  • Interface type selection: The commandline switch -SI and the directive $interfaces (possible values: corba and com) allow you to choose the type of interfaces which has no parent. Interfaces with parent inherit the style from their parent regardless of the currently selected interface type.
    • COM style interfaces work like Delphi interfaces: they inherit implicitly from IUnknown and they are reference counted.
    • CORBA style interfaces are neither ref. counted nor do they inherit from IUnknown.

For new rtl related stuff have a look at New in the 1.9.x rtl (not yet in the docs).

SSE Usage

To determine the supported instruction set, use the is_sse_cpu and is_sse2_cpu of the mmx unit. Because the sse code is usually faster than x87-fpu code, it's recommended to use these switches for heavy floating point calculations. If you want an application which runs on all fpu architectures, a possible solution is to put the code into an include file and include this file twice into your program: once compiled with e.g. -Cfsse2 and once without. Use the e.g. is_sse2_cpu variable to select the appropriate code:

 {$fputype x87}
 procedure calc_x87;
 {$i mymathcode.inc}
 {$fputype sse2}
 procedure calc_sse2;
 {$i mymathcode.inc}
 begin 
   if is_sse2_cpu then
     calc_sse2
   else
     calc_x87;
 end;

二氧化氯 温湿度 管道 催化剂 电子秤 电加热器 开关柜 建材机械 保险柜 电路板 乳胶漆 工程塑料 特许经营 楼宇自控 喷码机 液位计 聚丙烯酰胺 电磁铁 超市设备 薄膜开关 指纹考勤 渔具 跑步机 防腐设备 锁具 弹簧 纸箱 煤炭 保龄球 木地板 家用电器 植绒 钻头 冲压件 建筑机械 实木地板 捏合机 整流器 酒店用品 升降台 转换器 软件下载 喷砂机 制罐 工业炉 生产线 瓷器 搅拌机 印刷机械 综合布线 避雷器 减震器 色织 燃烧器 机电设备 防雷器 地坪 纸品 冷弯型钢 木工机械 物流设备 铁塔 非开挖 热电偶 保险箱 吸塑机 喷漆 过滤材料 电刷 [1] 采暖 机械加工 照相器材 电镀原料 毛毡 交通设施 消毒机 压滤机 刻字机 接口转换器 电视电话会议 贴纸相机 橡胶机械 喷泉设备 丝印 精细化工 塑胶玩具 五金模具 电子设备 企业形象设计 指纹识别 搬运车 牛仔布 电动车配件 会议系统 终端服务器 录音笔 球磨机 园林设计 路由器 手套箱 实验室设备 童装 手机美容 户外用品 证卡 机床附件 彩电 酒店管理 电话录音 油墨 布线 蜡烛 印刷包装 表面活性剂 节能灯 调味品 齿轮 高压泵 红外热像仪 塑料托盘 吊带 工业锅炉 休闲服 反光材料 印刷设备 足球推介 热处理 压铸 商标注册 喷灌 逆变器 输送带 锻造 车库门 体育器材 太阳能热水器 绝缘材料 焊管 鼓风机 试验 插座 艺术品 矿山机械 图像监控 无缝钢管 激光切割 标签打印机 燃气表 手机配件 卫星定位 印染 玻璃机械 铝型材 注塑 液压升降机 打标机 工具柜 焚烧炉 电力设备 干燥剂 计量泵 程控交换机