From 9dc3ede509c9dbe76ff123d280f31b011467ed08 Mon Sep 17 00:00:00 2001 From: Misha Brukman Date: Wed, 4 Jun 2003 02:26:14 +0000 Subject: [PATCH] Added instruction format class 3.15 and floating-point compare instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6594 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/SparcV9/SparcV9.td | 15 ++++++--------- lib/Target/SparcV9/SparcV9_F3.td | 18 ++++++++++++++++-- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/lib/Target/SparcV9/SparcV9.td b/lib/Target/SparcV9/SparcV9.td index adc9e4d1a0a..ca2d0be1ec1 100644 --- a/lib/Target/SparcV9/SparcV9.td +++ b/lib/Target/SparcV9/SparcV9.td @@ -188,15 +188,12 @@ def FSUBD : F3_16<2, 0b110100, 0x46, "fsubd">; // fsubd f, f, f def FSUBQ : F3_16<2, 0b110100, 0x47, "fsubq">; // fsubq f, f, f // Section A.13: Floating-point compare - p159 -// FIXME: FCMPS, FCMPD, FCMPQ !!! -#if 0 -def FSTOX : F3_14<2, 0b110100, 0b011001001, "fstod">; // fstod rs2, rd -def FDTOX : F3_14<2, 0b110100, 0b011001101, "fstoq">; // fstoq rs2, rd -def FQTOX : F3_14<2, 0b110100, 0b011000110, "fstos">; // fstos rs2, rd -def FSTOI : F3_14<2, 0b110100, 0b011001110, "fdtoq">; // fdtoq rs2, rd -def FDTOI : F3_14<2, 0b110100, 0b011000111, "fqtos">; // fqtos rs2, rd -def FQTOI : F3_14<2, 0b110100, 0b011001011, "fqtod">; // fqtod rs2, rd -#endif +def FCMPS : F3_15<2, 0b110101, 0b010100001, "fcmps">; // fcmps %fcc, r1, r2 +def FCMPD : F3_15<2, 0b110101, 0b010100010, "fcmpd">; // fcmpd %fcc, r1, r2 +def FCMPQ : F3_15<2, 0b110101, 0b010100011, "fcmpq">; // fcmpq %fcc, r1, r2 +def FCMPES : F3_15<2, 0b110101, 0b010100101, "fcmpes">; // fcmpes %fcc, r1, r2 +def FCMPED : F3_15<2, 0b110101, 0b010100110, "fcmped">; // fcmped %fcc, r1, r2 +def FCMPEQ : F3_15<2, 0b110101, 0b010100111, "fcmpeq">; // fcmpeq %fcc, r1, r2 // Section A.14: Convert floating-point to integer - p161 def FSTOX : F3_14<2, 0b110100, 0b010000001, "fstox">; // fstox rs2, rd diff --git a/lib/Target/SparcV9/SparcV9_F3.td b/lib/Target/SparcV9/SparcV9_F3.td index f29a3f82196..a0033d84ce1 100644 --- a/lib/Target/SparcV9/SparcV9_F3.td +++ b/lib/Target/SparcV9/SparcV9_F3.td @@ -202,12 +202,26 @@ class F3_13 opVal, bits<6> op3Val, string name> : F3_rs1 { } class F3_14 opVal, bits<6> op3Val, - bits<9> opfval, string name> : F3_rs2rd { + bits<9> opfVal, string name> : F3_rs2rd { set op = opVal; set op3 = op3Val; set Name = name; //set Inst{18-14} = dontcare; - set Inst{13-5} = opfval; + set Inst{13-5} = opfVal; +} + +class F3_15 opVal, bits<6> op3Val, + bits<9> opfVal, string name> : F3 { + bits<2> cc; + bits<5> rs1; + bits<5> rs2; + + set op = opVal; + set op3 = op3Val; + set Inst{26-25} = cc; + set Inst{18-14} = rs1; + set Inst{13-5} = opfVal; + set Inst{4-0} = rs2; } class F3_16 opVal, bits<6> op3Val,