[PATCH] D44727: [RISCV] Extend getTargetDefines for RISCVTargetInfo

2018-04-05 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC329278: [PATCH] [RISCV] Extend getTargetDefines for RISCVTargetInfo (authored by shiva, committed by ). Changed prior to commit: https://reviews.llvm.org/D44727?vs=140959=141140#toc Repository: rC

[PATCH] D44727: [RISCV] Extend getTargetDefines for RISCVTargetInfo

2018-04-04 Thread Alex Bradbury via Phabricator via cfe-commits
asb accepted this revision. asb added a comment. This revision is now accepted and ready to land. Thanks, this looks good to me. Comment at: lib/Basic/Targets/RISCV.cpp:62-70 + if (HasD) +Builder.defineMacro("__riscv_flen", "64"); + else if (HasF) +

[PATCH] D44727: [RISCV] Extend getTargetDefines for RISCVTargetInfo

2018-04-04 Thread Kito Cheng via Phabricator via cfe-commits
kito-cheng updated this revision to Diff 140959. kito-cheng added a comment. Changes: - Reorder marco define into canonical order which specified in ISA manual. - Add missing test for marco. Repository: rC Clang https://reviews.llvm.org/D44727 Files: lib/Basic/Targets/RISCV.cpp

[PATCH] D44727: [RISCV] Extend getTargetDefines for RISCVTargetInfo

2018-04-04 Thread Alex Bradbury via Phabricator via cfe-commits
asb added a comment. Thanks Eli for the info on hasFeature. I think the only thing now missing is test coverage for the defines. Comment at: lib/Basic/Targets/RISCV.cpp:53-73 + if (HasM) { +Builder.defineMacro("__riscv_mul"); +Builder.defineMacro("__riscv_div"); +

[PATCH] D44727: [RISCV] Extend getTargetDefines for RISCVTargetInfo

2018-04-04 Thread Kito Cheng via Phabricator via cfe-commits
kito-cheng updated this revision to Diff 140913. kito-cheng added a comment. Changes: - Add testcase for TargetFeature: riscv, riscv32 and riscv64 Repository: rC Clang https://reviews.llvm.org/D44727 Files: lib/Basic/Targets/RISCV.cpp lib/Basic/Targets/RISCV.h

[PATCH] D44727: [RISCV] Extend getTargetDefines for RISCVTargetInfo

2018-04-04 Thread Kito Cheng via Phabricator via cfe-commits
kito-cheng added a comment. Hi Eli: Thanks your advise, I've checked those marco are match with GCC :) Repository: rC Clang https://reviews.llvm.org/D44727 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D44727: [RISCV] Extend getTargetDefines for RISCVTargetInfo

2018-03-28 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment. Do the macros you're defining here match gcc? Comment at: lib/Basic/Targets/RISCV.cpp:68 + +bool RISCVTargetInfo::hasFeature(StringRef Feature) const { + return llvm::StringSwitch(Feature) asb wrote: > It seems a number of other

[PATCH] D44727: [RISCV] Extend getTargetDefines for RISCVTargetInfo

2018-03-28 Thread Kito Cheng via Phabricator via cfe-commits
kito-cheng updated this revision to Diff 140046. kito-cheng retitled this revision from "[RISCV] Implement getTargetDefines, handleTargetFeatures and hasFeature for RISCVTargetInfo" to "[RISCV] Extend getTargetDefines for RISCVTargetInfo". kito-cheng edited the summary of this revision.